Solution consuming .NET SOAP service

T

Tim Perrett

Hey all

I have been trying to consume a .NET exposed web-service with soap4r and
have found some things that might help others when doing the same thing

Oddly, soap4r interprted the following WSDL

<s:element name="GetAllProperties">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="inUsername"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="inPassword"
type="s:string" />
<s:element minOccurs="0" maxOccurs="1" name="inAccountID"
type="s:string" />
</s:sequence>
</s:complexType>
</s:element>

As only having the one paramater, inAccountID. So to get around this and
pass all three params as a struct object like this:

soap = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
Request = Struct.new:)inAccountID, :inUsername, :inPassword)
soap.GetAllProperties(Request.new('2', 'test', 'test'))

And as its a .NET WS, i had to employ the following also:

soap.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler.new

Hope this helps somone

Tim
 
T

Tim Becker

I have been trying to consume a .NET exposed web-service with soap4r and
have found some things that might help others when doing the same thing


I too have found soap very difficult to work with. It doesn't
necessarily help that soap4r is virtually undocumented. Here's the
approach that ended up working for a particularly troublesome wdsl: I
generated a client using apache axis, ran a couple of tests, sniffed
the traffic and generated templates from the xml axis produced for the
call. Then picked the responses apart using REXML. Not pretty, but it
works well enough and was easier than guessing around with soap4r.

Just my opinion: Soap itself is entirely convoluted, if you really
need xml overhead for rpc (hint: you don't) it should at least be
human readable, xmlrpc I can live with, I don't see the point of soap.
-tim
 
T

Tim Perrett

I agree - the lack of documentaion and per-service implementation
differences does make it somewhat of a minefield!

SOAP implementations tend to be quite complex on most platforms/lanuages
(unless your using an IDE to do all the work for you with somthing like
C# VS) - even for those which have frameworks in place e.g. soap4R,
WebServicesCore etc etc. I have been working on a SOAP client in
objective-c consuming the same service and in comparison makes Soap4R
seem like a well implemented walk in the park! haha

If anyone has any other handy SOAP tips by all means tag them onto here

Cheers

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top