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

Re: complexTypes to a .NET client

Expand Messages
  • perlmedian
    ... Thanks for the reference but it only helps me with understanding what is expected from .NET not how to implement it in SOAP::Lite. I have read through most
    Message 1 of 3 , Jun 23, 2003
    View Source
    • 0 Attachment
      See inline:

      --- In soaplite@yahoogroups.com, "jpeyser" <jpeyser@p...> wrote:
      > Nik,
      >
      > First, the MS SOAP Toolkit comes with a User Guide that contains
      > explanations and sample code for handling complex data types.

      Thanks for the reference but it only helps me with understanding what
      is expected from .NET not how to implement it in SOAP::Lite. I have
      read through most examples of SOAP::Lite but data on complexTypes is
      scarce.

      >
      > Second, the response from the server contains too many namespaces.
      > The response should be simpler, as such.

      I fixed that. You are right I went a bit crazy with the namespaces,
      but the types are required because of the interoperability issues
      with .NET all data needs the types explicitly defined, (it doesn't
      like it any other way).

      [SNIP]
      >
      > Third, as found in the aforementioned user's guide, the WSDL type
      > definition can be simpler.
      >
      > <types>
      > <schema
      > xmlns="http://www.w3.org/2001/XMLSchema"
      > targetNamespace="getFileRevision/ns2.xsd"
      > 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="getFileRevision/ns2.xsd"
      > xmlns:ns="getFileRevision">
      >
      > <complexType name="groupsArray">
      > <sequence>
      > <element name="file" type="xsd:string"/>
      > <element name="revision" type="xsd:string"/>
      > </sequence>
      > </complexType>
      >
      > <complexType name="getFileRevisionResponse">
      > <all>
      > <element name="Files" type="ns2:groupsArray" minOccurs="0"
      > maxOccurs="0"/>
      > </all>
      > </complexType>
      >
      > </schema>
      > </types>
      >

      Thanks for the info. The WSDL works fine as is for me now. I don't
      want to change it until I get further with the server. The WSDL I
      used came straight from the 'Web Services With Perl' OReilly book. (I
      didn't know WSDL prior to that).


      > Last, not being a vb programmer, I haven't figured out how to load
      > the results into an array. The best I can do is to put the results
      > into a string.

      I am not to worried about the .NET end. The WSDL is what works and
      how I want to the server's data to be. Plus it's going into C# really
      and he has a grasp on the work.

      > [SNIP]

      Here's where I have come to, thanx to a e-mail from another member
      who sent me some of his code, I am stuck on what to put in
      the 'whatgoeshere???' part of my server return.

      Please any help is appreciated.

      Here's what I am returning from my SOAP::Lite server:
      return ('string')->uri('urn:FileInfo'),
      SOAP::Data->name('Files')->type
      ('whatgoeshere???:ArrayOfFileRevPairs' =>
      [ map SOAP::Data->type( 'whatgoeshere???:FileRevPairs' =>
      { file =>
      SOAP::Data->value($_)->type('string'),
      revision =>
      SOAP::Data->value($data{$_})->type('string'),
      }), @{$files} ]
      )->uri('urn:FileInfo');

      some of the WSDL:
      <types>
      <xsd:schema>
      <xsd:complexType name="FileRevPair">
      <xsd:sequence>
      <xsd:element name="file" type="xsd:string"/>
      <xsd:element name="revision" type="xsd:string"/>
      </xsd:sequence>
      </xsd:complexType>

      <xsd:complexType name="ArrayOfFileRevPairs">
      <xsd:complexContent>
      <xsd:restriction base="enc:Array">
      <xsd:attribute ref="enc:arrayType"
      wsdl:arrayType="tns:FileRevPair[]" />
      </xsd:restriction>
      </xsd:complexContent>
      </xsd:complexType>

      </xsd:schema>
      </types>

      <message name="getFileRevisionResponse">
      <part name="Files" type="tns:ArrayOfFileRevPairs" />
      </message>

      Thx,
      Nik
    Your message has been successfully submitted and would be delivered to recipients shortly.