users@jax-rpc.java.net

How to pass XML documents to the web service operations

From: Herman Gábor <g.hermann_at_flexiton.hu>
Date: Wed, 22 Sep 2004 16:29:45 +0200

  Hi,

My name is Gabor and I am quite new to web service development. I use
the JAX-RPC to develop web services. I know Java well but know few about
SOAP and WSDLs.

I would like to create a web service where all operations
have two parameters. An XML document which describe the required
operation and another one which contains the response and is returned by
the operation. I don't want that the data in the XMLs appear as separate
parameters because there are lot of them and they may change. I would
like a sollution that is interoperable that is if I give the WSDL to a
partner who use another development tool he or she can use it too. The
client of the service will be a module which runs on a WebMethods
integration server and that module is developed by a third party vendor.

As far as I know, I have two ways to implement the web service:

1. I read an article about attachent support in the SUN WSDP. This
article says the standard way of passing XML documents to the operations
is using attachments. My problem with this approach is that WSDP does
not support generating WSDL from the service interface if attachments
are used so I have to code the WSDL myself. I have no time to be an
expert in WSDLs. Therefore I would like to follow this way only if I had to.

2. An easier way could be to code the service interface in Java so that
all operations have a String or javax.xml.transform.Source parameter and
return type and than let wscompile to generate the wsdl.

The SEI could look like this:

public interface CustomerService extends Remote {

    public String create(String xml);

    //...
}

or:

import javax.transform.source;

public interface CustomerService extends Remote {

    public Source create(Source xml);
    //...

}

The question is how interoperable this solution is. Is this an
acceptable way of passing XML documents as parameters? Can another
development tools handle the wsdl which was generated this way? Or do I
have to use attachments?

Thank in advance for your response.

Regards,
Gabor Herman
Software Developer
FelxiTon Kft.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jax-rpc.dev.java.net
For additional commands, e-mail: users-help_at_jax-rpc.dev.java.net