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

4873Newbie Question - I am desparate

Expand Messages
  • dcraul1970
    Aug 30, 2005
    • 0 Attachment
      Hi folks,

      I am wondering if anybody could help with this. I am trying to write a
      SOAP server according to a WSDL I received and I have some questions:

      - How do I set the namespaces?
      - How do I set the array type properly
      - Is there a syntax available which is more readable than that one I
      wrote (I am also a Perl newbie, so please forgive me any stupidity)

      - If anyone could point me to a more complex code example I would
      really appreciate it.

      Thanks in advance
      Dietmar

      One part of the response XML should be like the sample below:


      <?xml version="1.0" encoding="UTF-8"?>
      <SOAP-ENV:Envelope
      xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:ns2="urn:util.common.ip"
      xmlns:ns3="urn:ds.common.ws.ip"
      xmlns:ns4="urn:exceptions.common.ws.ip"
      xmlns:ns5="urn:server.ws.ip/ns5.xsd"
      xmlns:ns1="urn:server.ws.ip">
      <SOAP-ENV:Body
      SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <ns1:getUserDatastoreDescriptionsResponse>
      <getUserDatastoreDescriptionsReturn
      SOAP-ENC:arrayType="ns3:DatastoreDesc[1]">
      <item>
      <ns3:name></ns3:name>
      <ns3:description></ns3:description>
      <ns3:dataUID></ns3:dataUID>
      <ns3:SOCs SOAP-ENC:arrayType="ns3:SOCDesc[1]">
      <ns3:item>
      <ns3:name></ns3:name>
      <ns3:description></ns3:description>
      <ns3:dataUID></ns3:dataUID>
      </ns3:item>
      </item>
      </getUserDatastoreDescriptionsReturn>
      </ns1:getUserDatastoreDescriptionsResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>

      My Perl code looks like this:
      return SOAP::Data->name("getUserDatastoreDescriptionsReturn" =>
      [ SOAP::Data->value(SOAP::Data->name("item" =>
      \SOAP::Data->value(SOAP::Data->name("name" => "TestName"),
      SOAP::Data->name("description" => "TestDscription"),
      SOAP::Data->name("dataUID" => "TestUID")))) ]);

      And the generated XML-Code is this:

      <?xml version="1.0" encoding="UTF-8" ?>
      <soap:Envelope 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:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
      <soap:Body>
      <namesp1:getUserDatastoreDescriptionsResponse
      xmlns:namesp1="urn:server.ws.ip">
      <getUserDatastoreDescriptionsReturn
      soapenc:arrayType="xsd:anyType[1]" xsi:type="soapenc:Array">
      <item>
      <name xsi:type="xsd:string">TestName</name>
      <description xsi:type="xsd:string">TestDscription</description>
      <dataUID xsi:type="xsd:string">TestUID</dataUID>
      </item>
      </getUserDatastoreDescriptionsReturn>
      </namesp1:getUserDatastoreDescriptionsResponse>
      </soap:Body>
      </soap:Envelope>