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

How do you embed a complex member using MS .NET?

Expand Messages
  • Stephen Gryphon
    Question: Can .NET serialize complex members as single-reference, embedding them (rather than as multi-reference independent values), using RPC encoding? The
    Message 1 of 1 , Jun 3, 2004
    • 0 Attachment
      Question: Can .NET serialize complex members as single-reference,
      embedding them (rather than as multi-reference independent values),
      using RPC encoding?


      The SOAP 1.1 specification contains the example below, showing how
      to reference a complex member within a SOAP Encoded message.

      The base example shows how complex members are encoded as
      independent elements at the top level of serialization, using href
      and id attributes to link together.

      (Its clear this, or similar, must be used for certain multi-
      reference values, for example closed loops.)

      The second example shows how to embed complex members, such that
      they are inline with parent elements. This is used for single-
      reference values.


      We are using Microsoft .NET (1.0) and trying to build a client for
      an Apache SOAP 2.3.1 service. The documentation examples are all
      using embedded complex values (using RPC). There is no WSDL
      available.

      Using .NET, however, our client always wants to serialize the
      parameters as independent elements (like example 1 below, never like
      example 2; we want it like example 2).

      We can find no attributes or way to tell .NET that they should be
      serialized as single-refence elements and embedded?

      Has anyone else come across this problem, and know a way around it?

      (P.S. We have looked through a few months of archives, trying to
      search for an answer, and can't find one previously.)


      Thanks,


      - Stephen Gryphon
      START Corporation



      ===========================================================
      Example from SOAP 1.1:


      Below is an example of a type with both simple and complex members.
      It shows two levels of referencing. Note that the "href" attribute
      of the "Author" accessor element is a reference to the value
      whose "id" attribute matches. A similar construction appears for
      the "Address".

      <e:Book>
      <title>My Life and Work</title>
      <author href="#Person-1"/>
      </e:Book>
      <e:Person id="Person-1">
      <name>Henry Ford</name>
      <address href="#Address-2"/>
      </e:Person>
      <e:Address id="Address-2">
      <email>mailto:henryford@...</email>
      <web>http://www.henryford.com</web>
      </e:Address>

      The form above is appropriate when the "Person" value and
      the "Address" value are multi-reference. If these were instead both
      single-reference, they SHOULD be embedded, as follows:

      <e:Book>
      <title>My Life and Work</title>
      <author>
      <name>Henry Ford</name>
      <address>
      <email>mailto:henryford@...</email>
      <web>http://www.henryford.com</web>
      </address>
      </author>
      </e:Book>
    Your message has been successfully submitted and would be delivered to recipients shortly.