montaseri has asked for the wisdom of the Perl Monks concerning the following question:

I am trying to compose a request using SOAP::Lite to a method which takes one param only. I would like the payload to look like this
<S:Body> <getAllLocalGroups xmlns="http://www.xxx.com">1</getAllLocalGroups> </S:Body>
I have simplified this request, but sufice to say that getAllLocalGroups() method is supposed to take an unsignedShort. The WSDL defines the request as
<xs:element name="getAllLocalGroups" type="xs:unsignedShort"/>
And the style is literal/document-wrapped. Currently, my unit test client is generating a payload like
<soap:Body> <ns0:getAllLocalGroups xmlns:ns0="http://www.bluearc.com/BAService +/LocalGroupProvider"> <ns0:evsId xsi:type="xsd:unsignedShort">1</ns0:evsId> </ns0:getAllLocalGroups> </soap:Body>
Note how evsId is a nested element under getAllLocalGroups(). But can I somehow force SOAP::Lite to compose the request the way I want it, i.e use the methodName and place value of evsId in methodName element. Thanks Medi

Replies are listed 'Best First'.
Re: SOAP::Lite method with one param
by Anonymous Monk on Jan 20, 2015 at 03:29 UTC
      XML-Compile-SOAP-3.07/t/11soapfault.t xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <faultcode>SOAP-ENV:Server.first</faultcode> MARKOV/XML-Compile-SOAP-3.07
        Unfortunately I don't understand your answer. Can you elaborate?
      Looks like your solution is a bit different. Here is how I wanted the Body to look like
      <Body><getAllLocallGroups> 1 </getAllLocalGroups> </Body>
      your answer has an element under the methodName.
      <Body><SomeMethod><nums>xx</nums></SomeMethod></Body>
      Not sure if this is a namespace issue.