soap4r and capitalized wsdl:part names

Discussion in 'Ruby' started by Ian Neubert, Mar 24, 2008.

  1. Ian Neubert

    Ian Neubert Guest

    Hello all,

    I'm having a problem with writing a SOPA client with soap4r (1.5.8) and
    a WSDL file that includes WSDL operations with parameter names that are
    in all caps. When I try to access one of those SOAP operations it sets
    all the parameters to xsi:nil=true in the XML sent to the SOAP endpoint.

    Is this a bug or do I need to handle this situation differently? Note:
    everything works great if I change the names of the wsdl:part elements
    to lowercase letters.

    Here is the example code:
    driver.getResellerCostPrice("myname", "mypassword", "myrole", "en", 1)

    Here is the XML sent to the SOAP endpoint:
    ..snip..
    <SERVICE_USERNAME xsi:nil=\"true\"></SERVICE_USERNAME>
    <SERVICE_PASSWORD xsi:nil=\"true\"></SERVICE_PASSWORD>
    <SERVICE_ROLE xsi:nil=\"true\"></SERVICE_ROLE>
    <SERVICE_LANGPREF xsi:nil=\"true\"></SERVICE_LANGPREF>
    <SERVICE_PARENTID xsi:nil=\"true\"></SERVICE_PARENTID>
    ..snip..

    And an example of the WSDL file:
    <wsdl:message name="getResellerCostPriceRequest">
    <wsdl:part name="SERVICE_USERNAME" type="xsd:string"/>
    <wsdl:part name="SERVICE_PASSWORD" type="xsd:string"/>
    <wsdl:part name="SERVICE_ROLE" type="xsd:string"/>
    <wsdl:part name="SERVICE_LANGPREF" type="xsd:string"/>
    <wsdl:part name="SERVICE_PARENTID" type="xsd:int"/>
    </wsdl:message>

    Thanks in advance for any help you may provide.

    -Ian Neubert
    --
    Posted via http://www.ruby-forum.com/.
    Ian Neubert, Mar 24, 2008
    #1
    1. Advertising

  2. Ian Neubert

    Payal Patel Guest

    Hi,

    I am trying to build a SOAP client, in order to generate a soap request
    from a wsdl. I am using ruby 1.9.2 and soap4r 1.5.8
    I have used wsdl2ruby.rb --wsdl inquiry2010V1.wsdl --type client --force

    Initially I got errors in xml processing that lead me to do changes in
    a) soap4r-1.5.8\lib\xsd/charset.rb (changed "@internal_encoding =
    $KCODE" to "@internal_encoding = (RUBY_VERSION.to_f >= 1.9) ? 'UTF8'
    : $KCODE)


    b)soap4r-1.5.8\lib\xsd/xmlparser.rb (changes at line #66 -- changed
    "c.downcase == name" to "c.to_s.downcase == name")

    c)soap4r-1.5.8\lib\xsd\codegen\gensupport.rb (changed .collect to
    'split(/^/).each'

    After doing these changes wsdltoruby generates 4 classes as in
    inquiry.wsdl.rb, inquiry.wsdlMappingReistry.rb, inquirywsdlDriver.rb and
    InquiryServiceClient.rb.

    My wsdl has certain params in capital case: so the error thrown is as
    follows:

    inquiry.wsdl.rb:526: dynamic constant assignment
    SEMI_ANNUALLY = Recurrence_Enum.new("SEMI_ANNUALLY")
    ^
    The above error is repeated for all the capital params.

    Also, the ruby files obtained have some string errors (new line
    character absent) like endend, def xyz Methods.each ,etc.

    Please guide, if some other files of SOAP4r needs to be updated.

    -Payal Patel

    --
    Posted via http://www.ruby-forum.com/.
    Payal Patel, Dec 8, 2010
    #2
    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. Craig
    Replies:
    0
    Views:
    436
    Craig
    Feb 9, 2004
  2. Peng Yu
    Replies:
    0
    Views:
    176
    Peng Yu
    Jul 16, 2010
  3. Ian Macdonald

    SOAP4R and WSDL

    Ian Macdonald, Jan 17, 2004, in forum: Ruby
    Replies:
    8
    Views:
    181
    Ian Macdonald
    Jan 19, 2004
  4. Michael Gebhart

    Soap4r and wsdl

    Michael Gebhart, May 11, 2005, in forum: Ruby
    Replies:
    1
    Views:
    101
    Michael Gebhart
    May 11, 2005
  5. Trans
    Replies:
    4
    Views:
    142
    David A. Black
    Nov 30, 2005
Loading...

Share This Page