*
The moose likes Web Services and the fly likes Creating Custom wsdl definition Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Creating Custom wsdl definition" Watch "Creating Custom wsdl definition" New topic
Author

Creating Custom wsdl definition

Jaz Chana
Ranch Hand

Joined: Feb 19, 2008
Posts: 34
Hi guys,

My work has come to a bit of a stand still because I am trying to define a complex data type that I cannot seem to describe in a wsdl. I'm new to web services so I bear with me if this doesn't come out right.

I'm using axis2 to build my web services, which adheres to the SOAP specification. Now, I want my SOAP service to be as simple to use as possible. If I understand correctly, SOAP is just transfer of xml data between two services. Axis2 uses many different implementations to achieve this transfer both on client and server side, e.g, ADB, XMLBeans, AXIOM. The last implementation, AXIOM, parses the XML directly. The other implementations encapsulate the processing of this XML and this allows you to create a web service without the need to directly parse the xml message for data.

I am trying to build a service with a simple request but a more complicated response. For example; I want to send the parameters; accountNumber, name. And I want my service to response with the following parameters; product1{name,price},product2{name,price}....In addition, I want to be able to send a response code so that every time I send a service call I am giving some indication as to whether or not the call was successful. For example if the call was successful than the response code is 0, if something went wrong the response code is 1. If I try to represent that using SOAP, I'm assuming the xml messages will look like this;

request;


Follow so far?

I have created the service using AXIOM, by adding these nodes directly to the SOAP body content. I have all also created a client to deal with this service using AXIOM. The service has one method that accepts the SOAP message and parses it to get the data and the client does something similar.

Now the problem I have is that I don't want my client to be dependent on any implementation. In other words I want the client to be able to use ADB or XML Beans or whatever, regardless of whether or not I use AXIOM. So I thought I would create a custom WSDL, with custom complex datatypes so that anyone generating code from the wsdl will be able send the correct parameters. Confused? Okay lets look at a simple request-response;





This service will take two numbers as its argument and add them together. Now i'm guessing here, but i think the wsdl will look something like this;



Given the above, assuming its all correct, my question is; how do I create the wsdl for the more complex example above?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Creating Custom wsdl definition
 
Similar Threads
The AXIS engine could not find a target service to invoke
how to call web services.
"rpc" not supported even though actually calling document style webservice.
Help Neeed to write a Client Application from WSDL
Use the simpliest web server ever