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

SOAP::Lite namesp1 problem

Expand Messages
  • abhijit_dixit
    Hi, I m having a problem using SOAP::Lite as a client with a Apache SOAP server. I m using the addressbook sample from IBM Alphaworks s WSIF which has a WSDL
    Message 1 of 1 , Jun 4, 2002
    View Source
    • 0 Attachment
      Hi,

      I'm having a problem using SOAP::Lite as a client with a Apache SOAP
      server. I'm using the addressbook sample from IBM Alphaworks's WSIF
      which has a WSDL file already generated. The addEntry function
      takes "xsd:string and a "tns:address" as parameters. Now, when I run
      my client using SOAP::Lite, the SOAP message looks like ...

      ----------------------------------------------------------------------
      ---------
      <namesp1:addEntry
      xmlns:namesp1="http://www.ibm.com/namespace/wsif/samples/ab">
      <name xsi:type="xsd:string">Abhijit</name>
      <address xsi:type="typens:address">
      <state xsi:type="xsd:string">CA</state>
      <phoneNumber xsi:type="namesp2:SOAPStruct">
      <exchange xsi:type="xsd:int">408</exchange>
      <number xsi:type="xsd:int">9638</number>
      <areaCode xsi:type="xsd:int">481</areaCode>
      </phoneNumber>
      <streetName xsi:type="xsd:string">El Camino Real</streetName>
      <zip xsi:type="xsd:int">94087</zip>
      <city xsi:type="xsd:string">Sunnyvale</city>
      <streetNum xsi:type="xsd:int">1229</streetNum>
      </address>
      </namesp1:addEntry>
      ----------------------------------------------------------------------
      ----------

      The namespace is defined as "namesp1" but in the definition for the
      address, it used "typens" as per the WSDL file. So I keep getting
      a "Unable to resolve namespace URI for 'typens'." error from the
      server. If I don't use WSDL and specify the uri and proxy alongwith
      the namespace to use, everything works fine.

      Is there anyway I can change the namesp1 to something else with a
      stubmaker.pl option ? Or is there something else wrong in my code ?
      I'm also attaching the WSDL file.

      Any help would be greatly appreciated.

      Thanks,
      Abhijit

      ----------------------------------------------------------------------
      ---------
      <?xml version="1.0" ?>
      <definitions
      targetNamespace="http://www.ibm.com/namespace/wsif/samples/ab"
      xmlns:tns="http://www.ibm.com/namespace/wsif/samples/ab"
      xmlns:typens="http://www.ibm.com/namespace/wsif/samples/ab/types"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:java="http://schemas.xmlsoap.org/wsdl/java/"
      xmlns="http://schemas.xmlsoap.org/wsdl/">
      <!-- type defs -->
      <types>
      <xsd:schema
      targetNamespace="http://www.ibm.com/namespace/wsif/samples/ab/types"
      xmlns:xsd="http://www.w3.org/1999/XMLSchema">
      <xsd:complexType name="phone">
      <xsd:element name="areaCode" type="xsd:int"/>
      <xsd:element name="exchange" type="xsd:string"/>
      <xsd:element name="number" type="xsd:string"/>
      </xsd:complexType>
      <xsd:complexType name="address">
      <xsd:element name="streetNum" type="xsd:int"/>
      <xsd:element name="streetName" type="xsd:string"/>
      <xsd:element name="city" type="xsd:string"/>
      <xsd:element name="state" type="xsd:string"/>
      <xsd:element name="zip" type="xsd:int"/>
      <xsd:element name="phoneNumber" type="typens:phone"/>
      </xsd:complexType>
      </xsd:schema>
      </types>
      <!-- message declns -->
      <message name="AddEntryRequest">
      <part name="name" type="xsd:string"/>
      <part name="address" type="typens:address"/>
      </message>
      <message name="AddEntryResponse">
      </message>
      <message name="GetAddressFromNameRequest">
      <part name="name" type="xsd:string"/>
      </message>
      <message name="GetAddressFromNameResponse">
      <part name="address" type="typens:address"/>
      </message>
      <!-- port type declns -->
      <portType name="AddressBook">
      <operation name="addEntry">
      <input message="tns:AddEntryRequest"/>
      <output message="tns:AddEntryResponse"/>
      </operation>
      <operation name="getAddressFromName">
      <input message="tns:GetAddressFromNameRequest"/>
      <output message="tns:GetAddressFromNameResponse"/>
      </operation>
      </portType>
      <!-- binding declns -->
      <binding name="SOAPBinding" type="tns:AddressBook">
      <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http"/>
      <operation name="addEntry">
      <soap:operation soapAction=""/>
      <input>
      <soap:body use="encoded"
      namespace="http://www.ibm.com/namespace/wsif/samples/ab"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
      <soap:body use="encoded"
      namespace="http://www.ibm.com/namespace/wsif/samples/ab"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
      </operation>
      <operation name="getAddressFromName">
      <soap:operation soapAction=""/>
      <input>
      <soap:body use="encoded"
      namespace="http://www.ibm.com/namespace/wsif/samples/ab"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </input>
      <output>
      <soap:body use="encoded"
      namespace="http://www.ibm.com/namespace/wsif/samples/ab"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
      </output>
      </operation>
      </binding>
      <binding name="JavaBinding" type="tns:AddressBook">
      <java:binding/>
      </binding>
      <!-- service decln -->
      <service name="AddressBookService">
      <port name="SOAPPort" binding="tns:SOAPBinding">
      <soap:address
      location="http://localhost:7070/soap/servlet/rpcrouter"/>
      </port>
      <port name="JavaPort" binding="tns:JavaBinding">
      <java:address class="services.addressbook.AddressBook"/>
      </port>
      </service>
      </definitions>

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