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

Name space problem

Expand Messages
  • ankurb1
    Hi, I am writing perl clients using wsdl to access web service. The server uses gSOAP and is written in C++. I am facing some problem in associating namespaces
    Message 1 of 1 , Nov 19, 2004
    • 0 Attachment
      Hi,

      I am writing perl clients using wsdl to access web service. The server
      uses gSOAP and is written in C++. I am facing some problem in
      associating namespaces with classes on server side. In one case, the
      response from the server for a method call contains an array of
      objects. If the class has no namespace associated with it, then the
      soaplite parser on the client side raises exception about the absence
      of namespace.

      Here is the wsdl file and xml file without name space added.

      wsdl
      -----------------------------------------------------------------
      <complexType name="ArrayOfPLField">
      <complexContent>
      <restriction base="SOAP-ENC:Array">
      <sequence>
      <element name="item" type="PL:PLField" minOccurs="0"
      maxOccurs="unbounded"/>
      </sequence>
      <attribute ref="SOAP-ENC:arrayType" WSDL:arrayType="PL:PLField[]"/>
      </restriction>
      </complexContent>
      </complexType>
      <complexType name="PLField">
      <sequence>
      <element name="name" type="xsd:string" minOccurs="1" maxOccurs="1"
      nillable="true"/>
      <element name="description" type="xsd:string" minOccurs="1"
      maxOccurs="1" nillable="true"/>
      <element name="uid" type="xsd:int" minOccurs="1" maxOccurs="1"/>
      <element name="type" type="PL:dataType" minOccurs="1" maxOccurs="1"/>
      <element name="count" type="xsd:int" minOccurs="1" maxOccurs="1"/>
      <element name="start" type="xsd:int" minOccurs="1" maxOccurs="1"/>
      <element name="length" type="xsd:int" minOccurs="1" maxOccurs="1"/>
      <element name="indexed" type="xsd:int" minOccurs="1" maxOccurs="1"/>
      <element name="endian" type="PL:endian" minOccurs="1" maxOccurs="1"/>
      </sequence>
      </complexType>

      --------------------------------------------------------------------

      response.xml file
      -------------------------------------------------------------------
      <fields xsi:type="SOAP-ENC:Array" SOAP-ENC:arrayType="PLField[1]">
      <item>
      <name></name>
      <description></description>
      <uid>0</uid>
      <type xsi:type="PL:dataType">DT-int</type>
      <count>0</count>
      <start>0</start>
      <length>0</length>
      <indexed>0</indexed>
      <endian xsi:type="PL:endian">PL-little</endian>
      </item>
      </fields>
      --------------------------------------------------------------------

      If however I associate the namespace with the class by writing
      PL__PLField and also with a class that contains the PL_PLField class
      and the number of such objects (PL__PLFieldVector),
      class PL_PLFieldVector {
      PLField* fv;
      size a;
      }
      the structure of my wsdl file as well as the xml response changes on
      compilation. The wsdl file now defines the classnamevector to be of a
      non-array type, i.e. just containing one object.

      wsdl file
      ---------------------------------------------------------------------
      <complexType name="PLFieldVector">
      <sequence>
      <element name="item" type="PL:PLField" minOccurs="0"
      maxOccurs="unbounded" nillable="true"/>
      </sequence>
      </complexType>

      ---------------------------------------------------------------------

      response xml file
      ---------------------------------------------------------------------
      <fields xsi:type="PL:PLFieldVector">
      <item xsi:type="PL:PLField">
      <name></name>
      <description></description>
      <uid>0</uid>
      <type xsi:type="PL:dataType">DT-int</type>
      <count>0</count>
      <start>0</start>
      <length>0</length>
      <indexed>0</indexed>
      <endian xsi:type="PL:endian">PL-little</endian>
      </item>
      </fields>
      <returnCols xsi:type="PL:PLFieldVector">
      <item xsi:type="PL:PLField">
      <name></name>
      <description></description>
      <uid>0</uid>
      <type xsi:type="PL:dataType">DT-int</type>
      <count>0</count>
      <start>0</start>
      <length>0</length>
      <indexed>0</indexed>
      <endian xsi:type="PL:endian">PL-little</endian>
      </item>
      </returnCols>

      --------------------------------------------------------------

      Any help on this is appreciated.

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