soap4r and capitalized wsdl:part names

I

Ian Neubert

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
 
P

Payal Patel

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
 

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

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top