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

5425.NET/Axis clients and SOAP::Lite server

Expand Messages
  • Andrew Bayliss
    Jun 9, 2006
    • 0 Attachment
      Hi,

      I'm currently trying to get both .NET and Java (Apache AXIS) clients
      to work with a SOAP::Lite server. I've done what the documentation
      says regarding explicitly setting the namespace on returned values,
      i.e.

      return(
      SOAP::Data->name('output_one' => "one")->uri("urn:Test"),
      SOAP::Data->name('output_two' => "two")->uri("urn:Test"),
      SOAP::Data->name('output_three' => "three")->uri("urn:Test"),
      );

      producing the XML:

      <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soap:Body>
      <TestResponse xmlns="urn:Test">
      <namesp1:output_one xsi:type="xsd:string"
      xmlns:namesp1="urn:Test">one</namesp1:output_one>
      <namesp2:output_two xsi:type="xsd:string"
      xmlns:namesp2="urn:Test">two</namesp2:output_two>
      <namesp3:output_three xsi:type="xsd:string"
      xmlns:namesp3="urn:Test">three</namesp3:output_three>
      </TestResponse>
      </soap:Body>
      </soap:Envelope>

      but, apart from seeming needlessly verbose, this doesn't work. Axis
      receives no returned parameters, and .NET only gets the first one.

      After some fiddling around with the various namespace methods in
      SOAP::Lite (default_ns, register_ns) the only way I've managed to get
      it to work is to call ->serializer()->ns('') on the server before
      handling the SOAP call (with no explicit namespace on each return
      value). This produces the XML:

      <soap:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:namesp2="urn:Test"
      xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
      <soap:Body>
      <namesp2:TestResponse>
      <output_one xsi:type="xsd:string">one</output_one>
      <output_two xsi:type="xsd:string">two</output_two>
      <output_three xsi:type="xsd:string">three</output_three>
      </namesp2:TestResponse>
      </soap:Body>
      </soap:Envelope>

      which seems more correct to me, and indeed works with both .NET and
      Axis, all parameters are received correctly. Obviously I'm happy that
      this works, however I'm confused as to why. I would have thought
      setting a namespace of nothing wouldn't make sense, and certainly
      wouldn't a namespace to the envelope. I assume that the urn:Test
      namespace is being picked up from the request, as in this case I've
      not passed it in anywhere on the server side.

      One possibility I haven't really investigated is that the WSDL i've
      written could be wrong, but I can't see how I can modify it without
      breaking it. Attached is the WSDL and the CGI script i'm testing
      against. Can someone with a bit more knowledge of varying SOAP
      implementations shed any light on what's happening here?

      Thanks,

      Andrew Bayliss
    • Show all 5 messages in this topic