users@jax-rpc.java.net

Sending arbitrary XML documents

From: Sen, Puny <Punyanjan.Sen_at_SOFTWAREAGUSA.COM>
Date: Sun, 27 Oct 2002 14:54:18 -0700

Hi everyone,

I've been experimenting with different ways of sending arbitrary XML
documents as parameters of a Web Service method, using JAX-RPC.

1) Using document/literal, with a schema element of type <any/>. This maps
to a SOAPElement which is difficult to manipulate / transform to DOM nodes
(any tips appreciated :)

Also SOAP faults don't seem to be supported with document/literal.

2) Use a Java parameter type of javax.xml.transform.Source. This works quite
nicely (easy to set and create from a DOM Node), and the SOAP message is
sent using the MIME format.

However, the WSDL type that is generated seems to be proprietary to JAX-RPC
RI:

<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="http://java.sun.com/jax-rpc-ri/internal"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/"
targetNamespace="http://java.sun.com/jax-rpc-ri/internal">
  <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
  <simpleType name="text_xml">
   <restriction base="string" />
  </simpleType>
</schema>

In addition, the WSDL doesn't mention anything about MIME being used as the
protocol for sending the SOAP message.

Will this work with other implementations such as .NET?

Any pointers as to the best way to transmit arbitraty XML documents, using
rpc/encoding?

Thanks,
Puny Sen