[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

SOAP::RPC::StandaloneServer and WSDLs

Robert Gray

3/12/2008 1:50:00 PM


I have seen this posted several times on this forum without a definitive
response. I'd imagine the incantation is pretty easy, but I've been
unable to find it.

For what it's worth, this is NOT in a rails environment.

I've got the following example server code working, but I also need to
be able to generate a WSDL for this web service.

"""
require 'soap/rpc/standaloneServer'

class TestWebServices < SOAP::RPC::StandaloneServer

def initialize(* args)
super
add_method(self, 'sayhelloto', 'username')
end

def sayhelloto(username)
t = Time.now
puts("#{username} logged on #{t}")
"Hello, #{username} on #{t}."
end

end

server =
TestWebServices.new('TestWebServiceServer','urn:TestWebServices','localhost',8005)
trap('INT') {server.shutdown}
server.start
"""

When I go to http://localhost:8005/sayhelloto/wsdl/ I get a "Method Not
Allowed" message.

Any help with this would be GREATLY appreciated!

Thanks
--
Posted via http://www.ruby-....

6 Answers

Raffaele Tesi

3/12/2008 4:41:00 PM

0

Robert Gray wrote:
>
> I have seen this posted several times on this forum without a definitive
> response. I'd imagine the incantation is pretty easy, but I've been
> unable to find it.
>
> For what it's worth, this is NOT in a rails environment.
>
> I've got the following example server code working, but I also need to
> be able to generate a WSDL for this web service.
>
> """
> require 'soap/rpc/standaloneServer'
>
> class TestWebServices < SOAP::RPC::StandaloneServer
>
> def initialize(* args)
> super
> add_method(self, 'sayhelloto', 'username')
> end
>
> def sayhelloto(username)
> t = Time.now
> puts("#{username} logged on #{t}")
> "Hello, #{username} on #{t}."
> end
>
> end
>
> server =
> TestWebServices.new('TestWebServiceServer','urn:TestWebServices','localhost',8005)
> trap('INT') {server.shutdown}
> server.start
> """
>
> When I go to http://localhost:8005/sayhelloto/wsdl/ I get a "Method Not
> Allowed" message.
>
> Any help with this would be GREATLY appreciated!
>
> Thanks

you get a
"
Method Not Allowed
GET request not allowed
"


library snippet (standaloneserver.rb):
"
if request.method != 'POST'
raise SAError.new("Method '#{ request.method }' not allowed.")
end
"

clear?
--
Posted via http://www.ruby-....

Robert Gray

3/12/2008 7:23:00 PM

0


> library snippet (standaloneserver.rb):
> "
> if request.method != 'POST'
> raise SAError.new("Method '#{ request.method }' not allowed.")
> end
> "
>
> clear?

Kind of.

My questions was... how do you get a StandaloneServer to generate a WSDL
(preferably without writing it by hand)?

Are you saying that it cannot be done with this class?
--
Posted via http://www.ruby-....

Raffaele Tesi

3/13/2008 10:07:00 AM

0

Robert Gray wrote:
>
>> library snippet (standaloneserver.rb):
>> "
>> if request.method != 'POST'
>> raise SAError.new("Method '#{ request.method }' not allowed.")
>> end
>> "
>>
>> clear?
>
> Kind of.
>
> My questions was... how do you get a StandaloneServer to generate a WSDL
> (preferably without writing it by hand)?
>
> Are you saying that it cannot be done with this class?

take a look at action web service
http://rubyforge.org/pro...

--
Posted via http://www.ruby-....

Raffaele Tesi

3/13/2008 10:35:00 AM

0

verrry useful post about your question (i hope)


http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a7ad90...


--
Posted via http://www.ruby-....

Robert Gray

3/14/2008 2:39:00 PM

0

Raffaele Tesi wrote:
> verrry useful post about your question (i hope)
>
>
> http://groups.google.com/group/comp.lang.ruby/browse_thread/thread/a7ad90...


Thank you for taking the time to respond to this post. I really
appreciate the help.

I've got to run this outside of a rails environment and I don't think
I'll be able to use action web service.

I was able to set up and test this from within that framework and the
automatic WSDL generation worked great. I'm just looking for a way to
incorporate some of that functionality into a non rails environment.

Thanks again for your thoughts,

Brad
--
Posted via http://www.ruby-....

Vipin Vm

7/19/2008 6:05:00 AM

0

Hi Guys,

> Robert Gray wrote:
> I was able to set up and test this from within that framework and the
> automatic WSDL generation worked great.

how u able to create WSDLs automatically without AWS? can u pls help me
to create WSDLs like this http://localhost:8005/sayhelloto/wsdl/ ?

thanks in advance

Vipin
--
Posted via http://www.ruby-....