in reply to SOAP::Lite method with one param

Remember my response in SOAP::Lite additional namespace ?

Here is another tip <S:Body> · CPAN->grep --> https://metacpan.org/source/PHRED/SOAP-Lite-1.13/t/02-payload.t

xmlns:c='http://www.w3.org/2001/XMLSchema-instance'> <S:Body><a:SomeMethod> <nums E:arrayType='b:anyType[2,2]'>

Here is another tip [google://site:stackoverflow.com perl soap "<S:Body>"] site:stackoverflow.com perl soap "<S:Body>" -> http://stackoverflow.com/questions/17947551/problems-created-a-soaplite-perl-web-services-client, http://stackoverflow.com/questions/17480666/soap-action-issue-when-calling-wcf-service-in-perl-soap-lite, http://stackoverflow.com/questions/12253941/how-do-i-use-soaplite-with-wcf

looks like simple namespace issue, and IIRC the microsoft tutorials on SOAP::Lite cover namespaces

Replies are listed 'Best First'.
Re^2: SOAP::Lite method with one param
by Anonymous Monk on Jan 20, 2015 at 03:32 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?
Re^2: SOAP::Lite method with one param
by montaseri (Initiate) on Jan 21, 2015 at 21:18 UTC
    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.
        Yes, perhaps I should post a complete question:

        My WSDL reads:

        <wsdl:message name="getAllLocalGroupsIn"> <wsdl:part name="parameter" element="tns:getAllLocalGroups"/> </wsdl:message> <wsdl:message name="getAllLocalGroupsOut"> <wsdl:part name="parameter" element="tns:getAllLocalGroupsResp +onse"/> </wsdl:message>
        And then
        <wsdl:portType name="LocalGroupProviderPortType"> <wsdl:operation name="getAllLocalGroups"> <wsdl:input message="tns:getAllLocalGroupsIn"/> <wsdl:output message="tns:getAllLocalGroupsOut"/> </wsdl:operation>
        and yet then
        <wsdl:binding name="LocalGroupProviderBinding" type="tns:LocalGrou +pProviderPortType"> <soap:binding style="document" transport="http://schemas.xmlso +ap.org/soap/http"/> <wsdl:operation name="getAllLocalGroups"> <soap:operation soapAction="" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output>
        My XSD files has
        <xs:element name="getAllLocalGroups" type="xs:unsignedShort"/> <xs:element name="getAllLocalGroupsResponse"> <xs:complexType> <xs:sequence> <xs:element name="localGroups" type="ns1:LocalGroup" m +axOccurs="unbounded"/> </xs:sequence> </xs:complexType> </xs:element>
        Note: how the input is not a complexType.

        A JAX-WS client is generating the fllowing payload by parsing this WSDL and Schema file(s).

        <?xml version="1.0" ?><S:Envelope xmlns:S="http://www.w3.org/2003/05/s +oap-envelope"><S:Body><getAllLocalGroups xmlns="http://www.bluearc.co +m/BAService/LocalGroupProvider" xmlns:ns2="http://www.bluearc.com/BAS +ervice/LocalGroupProvider/Types">0</getAllLocalGroups></S:Body></S:En +velope>
        Note how value of 0 (zero) is placed in element getAllLocalGroups which is the methodName.

        In my Perl client I write the following....I am skipping some generic send request parts...

        # ------------------- getAllLocalGroups() ---------------------------- sub LocalGroupProvider::getAllLocalGroups() { my $this = shift; my ($rawJson, $methodRef, $inputRef) = @_; my $method = SOAP::Data->new( 'name' => $this->{'Hyas'}->getMethod(), 'prefix' => 'ns0' ); my $provider = $this->{'Hyas'}->getProvider(); $method->attr({ 'xmlns:ns0' => "http://www.bluearc.com/BAService/$provider +" }); $$methodRef = $method; my $jbuf = {}; if ( $rawJson ) { my $job = JSON->new(); $jbuf = $job->decode($rawJson); } my $evsId = SOAP::Data->new( 'name' => 'evsId', 'value' => $jbuf->{'evsId'}, 'prefix' => 'ns0', 'type' => 'unsignedShort' ); @$inputRef = ($evsId); return(1); } # --------------------------------------------------------------------
        Which generates the following payload
        <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soap:Body> <ns0:getAllLocalGroups xmlns:ns0="http://www.bluearc.com/BAService +/LocalGroupProvider"> <ns0:evsId xsi:type="xsd:unsignedShort">0</ns0:evsId> </ns0:getAllLocalGroups> </soap:Body> </soap:Envelope>
        And my gSOAP server gives me the following error
        faultString = Validation constraint violation: data type mismatch in +element <ns0:getAllLocalGroups> faultCode = SOAP-ENV:Client
        So the difference is that the working WSDL and JAX client are sending
        <methodName>paramValue</methodName>
        where as my perl client is sending
        <methodName> <paramName>paramValue</paramName> </methodName>
        And I am trying to find a way with SOAP::Lite to send what JAX client is sending.