The WS-I Basic Profile does not permit use of xsd:any or xsd:anyType. It also does not recommend any other mechanism for exchanging arbitrary XML. I think you should assume that the general rule is not to exchange arbitrary XML if your goal is to achieve interoperability.

I can think of three ways to exchange arbitrary XML:
1. encode it as a string
2. send it as an attachment
3. use xsd:any/xsd:anyType

I don't much care for the first option. Encoding it as a string makes it completely opaque to the web services infrastructure. This might not be an awful option, but it limits what types of things you can do -- for example, you can't sign the document and expect the signature to validate later after it's been decoded.

The second option would be reasonable if attachments were interoperable, but they aren't. And neither SwA/MIME nor WS-Attachments/DIME can be protected by WS-Security. (MTOM can be, but that's a future thing. And MTOM is designed for binary attachments, not XML attachments.)

Therefore, my preference is xsd:any/xsd:anyType. But recognize that you won't be WS-I compliant, and you will have to communicate out of band with your consumers what constraints may exist on the arbitrary XML and any rules regarding processing.

Anne

On 11/18/05, Shantanu Sen <[EMAIL PROTECTED]> wrote:
But if the general rule is not to use xsd:any or xsd:anyType, what is the
preferred mode of exchanging an arbitrary xml document using doc/lit mode?

If I do not want to use axis message style, how should I construct my WSDL
so that I can accept and return an arbitrary xml document?

Shantanu

> ________________________________
>
> From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] ]
> Sent: Monday, November 14, 2005 4:27 AM
> To: axis-user@ws.apache.org
> Subject: Re: How to handle xsd:anyType with Message Style web services ?
>
>
> As I said, the .NET client can construct the XML document and stuff it
> into a SOAP envelope using DOM with the System.XML API. But is it really
> necessary? How is the .NET client supposed to know what to send you?
>
> Is the document truly of xsd:anyType? Do you really not know in advance
> what the type of "in0" should be? If there is a predefined structure,
> then your WSDL should define that structure -- regardless of how you've
> elected to process it on the server side (message style vs document or
> wrapped).
>
> If you choose to use the message style, then you should edit the
> generated WSDL and add the appropriate schema definitions so that
> clients can more easily communicate with you.
>
> As a general rule, you shouldn't use <xsd:any>, <xsd:anyType>, or
> <xsd:anyAttribute> in your WSDL.
>
> Anne
>
>
> On 11/13/05, Kr <[EMAIL PROTECTED]> wrote:
>
>       Thank you Anne.
>
>       For my AXIS message style web service, the AXIS generated WSDL
> has
>       <element name="in0" type="xsd:anyType"/> and can .NET consumer
> support
>       this xsd:anyType and pass in an xml document using the generated
> stubs
>       out of such WSDL's ?
>
>
>
>


Reply via email to