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

5604.Net Complex Types

Expand Messages
  • Peter
    Sep 14, 2006
    • 0 Attachment
      I've been spending ages struggling to get a C# .Net client to talk to
      my SOAP::Lite server. Visual Studio doesn't seem to give any errors,
      it just always returns null for the values without complaining.

      I have looked at what the C# client is recieving and it appears to be
      valid SOAP (I think). There are two things I need to know, what I
      should be returning, and how I get SOAP::Lite to return it. I have
      tried loads, and this the current code that I have been trying to get
      working.

      btw, SOAP::Lite is version 0.69 on Linux, and C# is on Windows
      (Visual Studio 2005/.Net 2). I have only included the procedure, and
      not the whole module, and the WSDL seemed to be parsed OK by Visual
      Studio. I hope the indentation isn't too messed up.


      Perl Implementation
      *******************

      sub strOp
      {
      SOAP::Data->name("twoStr")->value(
      \SOAP::Data->value(SOAP::Data->name("elem1")->value("abcd"),
      SOAP::Data->name("elem2")->value("efgh")))

      ->type('tns:twoStr')
      ->attr({"xmlns:tns" => "urn:SmgWebService",
      "xsi:type" => "tns:twoStr"});
      }

      C# Request
      **********

      <?xml version="1.0" encoding="utf-16"?>
      <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
      xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns:tns="urn:MyUri"
      xmlns:types="urn:MyUri/encodedTypes"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:xsd="http://www.w3.org/2001/XMLSchema">
      <soap:Body
      soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
      <tns:strOp>
      <result href="#id1" />
      </tns:strOp>
      <tns:twoStr id="id1" xsi:type="tns:twoStr">
      <elem1 xsi:type="xsd:string">abcd</elem1>
      <elem2 xsi:type="xsd:string">efgh</elem2>
      </tns:twoStr>
      </soap:Body>
      </soap:Envelope>

      SOAP::Lite Response
      *******************

      ResponseCode: 200 (OK)

      SOAPServer:SOAP::Lite/Perl/0.69
      Keep-Alive:timeout=15, max=100
      Connection:Keep-Alive
      Content-Length:575
      Content-Type:text/xml; charset=utf-8
      Date:Thu, 14 Sep 2006 12:36:02 GMT
      Server:Apache/2.0.53 (Linux/SUSE)

      <?xml version="1.0" encoding="utf-16"?>
      <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>
      <strOpResponse xmlns="urn:MyUri">
      <twoStr xsi:type="tns:twoStr" xmlns:tns="urn:MyUri">
      <elem1 xsi:type="xsd:string">abcd</elem1>
      <elem2 xsi:type="xsd:string">efgh</elem2>
      </twoStr>
      </strOpResponse>