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

SOAP::Lite generating packet with undefined namespace

Expand Messages
  • blakebatsnap
    I am using Axis 1.0 on the server and am trying to get a SOAP::Lite client to work. I m almost there, but I can t seem to get SOAP::Lite to define namespaces
    Message 1 of 1 , Oct 29, 2002
    • 0 Attachment
      I am using Axis 1.0 on the server and am trying to get
      a SOAP::Lite client to work. I'm almost there, but I can't
      seem to get SOAP::Lite to define namespaces properly.

      Relevant pieces of wsdl:

      <?xml version="1.0" encoding="UTF-8"?>
      <wsdl:definitions targetNamespace="MyInfoService"
      xmlns="http://schemas.xmlsoap.org/wsdl/"
      xmlns:apachesoap="http://xml.apache.org/xml-soap"
      xmlns:impl="MyInfoService" xmlns:intf="MyInfoService"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <wsdl:types>
      <schema targetNamespace="MyInfoService"
      xmlns="http://www.w3.org/2001/XMLSchema">
      <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>

      My perl code:

      #!perl -w
      use SOAP::Lite;
      my $service = SOAP::Lite->service
      ('file:../../wsdl/MyInfoService.wsdl')
      -> maptype({
      PartnerType => 'MyInfoService'
      })
      ;

      my $type = bless {
      name => 'TestPartner',
      type => 'Wholesale'
      } => 'PartnerType';

      my $product = 'CanOfWorms';

      my $result = $service->getInfoForProd($product, $product);

      SOAP:Lite generates this SOAP packet:

      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <SOAP-ENV:Body>
      <namesp1:getInfoForProd xmlns:namesp1="MyInfoService">
      <name xsi:type="xsd:string">CanOfWorms</name>
      <whoAmI xsi:type="intf:PartnerType">
      <type xsi:type="xsd:string">Wholesale</type>
      <name xsi:type="xsd:string">TestPartner</name>
      </whoAmI>
      </namesp1:getInfoForProd>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      The server complains with:

      Fault code: Server.SAXException
      Fault string: Deserializing parameter 'whoAmI':
      could not find deserializer for type PartnerType

      If I sniff the traffic, I can capture the call and either change
      intf:PartnerType to namesp1:PartnerType or add
      xmlns:intf="MyInfoService"
      to the SOAP-ENV:Envelope and resend. In both case, the call
      then works just fine.

      Does anyone know how I can get SOAP::Lite to add a definition for
      intf or force it to not use it? I was hoping the maptype would
      work but either I'm not using it properly or it is being ignored.
      What it is generating now leaves intf undefined.

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