Solution consuming .NET SOAP service

Discussion in 'Ruby' started by Tim Perrett, Mar 4, 2007.

  1. Tim Perrett

    Tim Perrett Guest

    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

    --
    Posted via http://www.ruby-forum.com/.
     
    Tim Perrett, Mar 4, 2007
    #1
    1. Advertising

  2. Tim Perrett

    Tim Becker Guest

    On 3/4/07, Tim Perrett <> wrote:
    > 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
     
    Tim Becker, Mar 4, 2007
    #2
    1. Advertising

  3. Tim Perrett

    Tim Perrett Guest

    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

    --
    Posted via http://www.ruby-forum.com/.
     
    Tim Perrett, Mar 4, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Nick Chan
    Replies:
    0
    Views:
    505
    Nick Chan
    Sep 13, 2007
  2. Tony C
    Replies:
    2
    Views:
    358
    Xiangyang Liu
    Jul 20, 2003
  3. Curt K
    Replies:
    3
    Views:
    462
    John Saunders [MVP]
    Jun 15, 2007
  4. Saeed Bhuta

    Consuming a SOAP Service in Ruby.

    Saeed Bhuta, Jul 6, 2010, in forum: Ruby
    Replies:
    2
    Views:
    319
    Tim Becker
    Jul 7, 2010
  5. Saeed Bhuta
    Replies:
    4
    Views:
    270
    Saeed Bhuta
    Jul 13, 2010
Loading...

Share This Page