Loading ...
Sorry, an error occurred while loading the content.

Problem setting params in a client call

Expand Messages
  • paolo_asioli
    Hello, I m trying to call a webservice (which I think is generated using axis). If I specify the WSDL I always get the same empty param in the request even if
    Message 1 of 1 , Oct 20, 2008
    • 0 Attachment
      Hello,

      I'm trying to call a webservice (which I think is generated using axis).

      If I specify the WSDL I always get the same empty param in the request even if I try to create it manually using SOAP:Data:Builder

      I'm attaching the WSDL (with some obfuscatin for security reasons).

      I'd be really grateful if someone could help me understand where I'm making a mistake...

      Best regards,
           Paolo


      Here is the relevant code:
              # create new Builder object
              my $soap_data_builder = SOAP::Data::Builder->new();

              #my $array = $soap_data_builder->add_elem(name => 'NonWHStockConfirmationRequest',
              #                             attributes => {"xsi:type"=>"impl:ArrayType0"});
              my $array = $soap_data_builder->add_elem(name => 'NonWHStockConfirmationRequest');

              my $richiesta = $soap_data_builder->add_elem(name => 'NonWHStockConfirmation',
                                           parent => $array);

              $soap_data_builder->add_elem(name => 'annoOrdineFornitore',
                                           value => $anno_ordine_fornitore,
                                           parent => $richiesta);
             
              $soap_data_builder->add_elem(name => 'catena',
                                           value => $catena,
                                           parent => $richiesta);
             
              $soap_data_builder->add_elem(name => 'numeroOrdineFornitore',
                                           value => $numero_ordine_fornitore,
                                           parent => $richiesta);
             
              $soap_data_builder->add_elem(name => 'rigaOrdineFornitore',
                                           value => $riga_ordine_fornitore,
                                           parent => $richiesta);
             
              $soap_data_builder->add_elem(name => 'quantita',
                                           value => $quantita,
                                           parent => $richiesta);
             
              print Dumper(SOAP::Lite->service($wsdl)->NonWHStockConfirmation($soap_data_builder->to_soap_data));



      The request that is sent is the following :

      POST http://XXXXXXXXX/StockWS HTTP/1.1
      Accept: text/xml
      Accept: multipart/*
      Accept: application/soap
      Content-Length: 771
      Content-Type: text/xml; charset=utf-8
      SOAPAction: ""

      <?xml version="1.0" encoding="UTF-8"?><soap:Envelope
      xmlns:tns2="http://common.core.beehive.intershop.com"
      xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:apachesoap="http://xml.apache.org/xml-soap"
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:impl="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body>
      <impl:NonWHStockConfirmation><NonWHStockConfirmationRequest xsi:nil="true"
      xsi:type="impl:ArrayType0" /></impl:NonWHStockConfirmation></soap:Body>
      </soap:Envelope>


      I can't understand why SOAP::Lite is ignoring the data element I supply (and I've also tried with different combinations of SOAP::Data) using an empty parameter.


      Here is the WSDL
      <wsdl:definitions xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns1="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com" xmlns:tns2="http://common.core.beehive.intershop.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com">
        <wsdl:types>
          <schema targetNamespace="http://common.core.beehive.intershop.com" xmlns="http://www.w3.org/2001/XMLSchema">
            <import namespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com"/>
            <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
            <complexType abstract="true" name="DObject">
              <sequence/>
            </complexType>
          </schema>
          <schema targetNamespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com" xmlns="http://www.w3.org/2001/XMLSchema">
            <import namespace="http://common.core.beehive.intershop.com"/>
            <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
            <complexType name="NonWHStockConfirmation">
              <complexContent>
                <extension base="tns2:DObject">
                  <sequence>
                    <element name="annoOrdineFornitore" nillable="true" type="soapenc:int"/>
                    <element name="catena" nillable="true" type="soapenc:string"/>
                    <element name="numeroOrdineFornitore" nillable="true" type="soapenc:int"/>
                    <element name="quantita" nillable="true" type="soapenc:int"/>
                    <element name="rigaOrdineFornitore" nillable="true" type="soapenc:int"/>
                  </sequence>
                </extension>
              </complexContent>
            </complexType>
            <complexType name="PickingConfirmation">
              <complexContent>
                <extension base="tns2:DObject">
                  <sequence>
                    <element name="catena" nillable="true" type="soapenc:string"/>
                    <element name="dataBolla" nillable="true" type="soapenc:string"/>
                    <element name="lineItemPosition" nillable="true" type="soapenc:int"/>
                    <element name="numeroBolla" nillable="true" type="soapenc:int"/>
                    <element name="orderNumber" nillable="true" type="soapenc:int"/>
                    <element name="quantita" nillable="true" type="soapenc:int"/>
                  </sequence>
                </extension>
              </complexContent>
            </complexType>
            <complexType name="ArrayType0">
              <complexContent>
                <restriction base="soapenc:Array">
                  <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:NonWHStockConfirmation[]"/>
                </restriction>
              </complexContent>
            </complexType>
            <complexType name="ArrayType2">
              <complexContent>
                <restriction base="soapenc:Array">
                  <attribute ref="soapenc:arrayType" wsdl:arrayType="tns1:PickingConfirmation[]"/>
                </restriction>
              </complexContent>
            </complexType>
            <complexType name="ArrayType3">
              <complexContent>
                <restriction base="soapenc:Array">
                  <attribute ref="soapenc:arrayType" wsdl:arrayType="soapenc:string[]"/>
                </restriction>
              </complexContent>
            </complexType>
          </schema>
        </wsdl:types>
        <wsdl:message name="PickingConfirmationRequest">
          <wsdl:part name="PickingConfirmationRequest" type="impl:ArrayType2"/>
        </wsdl:message>
        <wsdl:message name="NonWHStockConfirmationRequest">
          <wsdl:part name="NonWHStockConfirmationRequest" type="impl:ArrayType0"/>
        </wsdl:message>
        <wsdl:message name="PickingConfirmationResponse">
          <wsdl:part name="PickingConfirmationResponse" type="impl:ArrayType3"/>
        </wsdl:message>
        <wsdl:message name="EchoTestRequest">
          <wsdl:part name="Input" type="xsd:string"/>
        </wsdl:message>
        <wsdl:message name="NonWHStockConfirmationResponse">
          <wsdl:part name="NonWHStockConfirmationResponse" type="impl:ArrayType3"/>
        </wsdl:message>
        <wsdl:message name="EchoTestResponse">
          <wsdl:part name="Output" type="xsd:string"/>
        </wsdl:message>
        <wsdl:portType name="StockWS">
          <wsdl:operation name="NonWHStockConfirmation" parameterOrder="NonWHStockConfirmationRequest">
            <wsdl:input name="NonWHStockConfirmationRequest" message="impl:NonWHStockConfirmationRequest"/>
            <wsdl:output name="NonWHStockConfirmationResponse" message="impl:NonWHStockConfirmationResponse"/>
          </wsdl:operation>
          <wsdl:operation name="PickingConfirmation" parameterOrder="PickingConfirmationRequest">
            <wsdl:input name="PickingConfirmationRequest" message="impl:PickingConfirmationRequest"/>
            <wsdl:output name="PickingConfirmationResponse" message="impl:PickingConfirmationResponse"/>
          </wsdl:operation>
          <wsdl:operation name="EchoTest" parameterOrder="Output Input">
            <wsdl:input name="EchoTestRequest" message="impl:EchoTestRequest"/>
            <wsdl:output name="EchoTestResponse" message="impl:EchoTestResponse"/>
          </wsdl:operation>
        </wsdl:portType>
        <wsdl:binding name="StockWSSoapBinding" type="impl:StockWS">
          <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
          <wsdl:operation name="NonWHStockConfirmation">
            <wsdlsoap:operation/>
            <wsdl:input>
              <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com"/>
            </wsdl:input>
            <wsdl:output>
              <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com"/>
            </wsdl:output>
          </wsdl:operation>
          <wsdl:operation name="PickingConfirmation">
            <wsdlsoap:operation/>
            <wsdl:input>
              <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com"/>
            </wsdl:input>
            <wsdl:output>
              <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com"/>
            </wsdl:output>
          </wsdl:operation>
          <wsdl:operation name="EchoTest">
            <wsdlsoap:operation/>
            <wsdl:input>
              <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com"/>
            </wsdl:input>
            <wsdl:output>
              <wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://ws.stock.XXXXXXXX.enfinity.YYYYY.com"/>
            </wsdl:output>
          </wsdl:operation>
        </wsdl:binding>
        <wsdl:service name="StockWS">
          <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      Implement Web Services for Stock automation  </wsdl:documentation>
          <wsdl:port name="StockWS" binding="impl:StockWSSoapBinding">
            <wsdlsoap:address location="http://www.XXXXXXXXX/StockWS"/>
          </wsdl:port>
        </wsdl:service>
      </wsdl:definitions>




    Your message has been successfully submitted and would be delivered to recipients shortly.