axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "dumdum 420" <>
Subject RE: document style web services
Date Tue, 29 Apr 2003 18:22:32 GMT
Hi Rajal'
I have a huge XML file to pass to my client and was planning to implement 
Document/Literal type of webservice,but with what you are saying it seems 
that attachments are a better choice to send over the wire.

Comments will really help.


From: "Rajal Shah" <>
To: <>
Subject: RE: document style web services
Date: Tue, 29 Apr 2003 10:57:41 -0700


(argument to choose Attachment over Doc-style)

Do realize that during Document Style, Axis returns the entire XML to you in
a DOM structure.. For very large XMLs this could be a huge issue and you
might have to revert to Attachments.. (though not supported as well by all
web services engines).

I've seen an application, where they put their entire XML inside one body
element as CDATA. That way they get the entire XML as a string and then run
it through the SAX parser instead and save on huge memory requirements.. So
this is a viable alternative to Attachments..

I'm learning along with you do regarding these topics.

-----Original Message-----
From: Mitch Gitman []
Sent: Tuesday, April 29, 2003 9:54 AM
Subject: Re: document style web services

Not that this answer helps you directly.

"What else one can buy with using Doc/literal type service" (as opposed to
RPC/encoded or RPC/literal):
* Arguably a more comprehensible, transparent Web service description. Same
for the SOAP messages. (Of course, ideally with a Web services toolkit, you
might not be poring over the XML at all.)
* The ability to piggyback on the use of XML Schema elsewhere. For instance,
the XSD definitions of objects you're passing via SOAP could just as well be
used in a non-SOAP context. Likewise, document/literal lets you readily
perform XML Schema validation on the contents of the <soap:Body>. Also, if
you're going to be poring over the XML and you already need to know XML
Schema, then SOAP 1.1 Section 5 encoding is just one fewer thing you need to
be well-versed in. (Goes back to "more comprehensible.")
* Greater interoperability with Web service engines that only fully and
reliably support document/literal. (Yes, this is very much a political
Just stating facts, not necessarily applauding those facts.)

While you may certainly have valid reasons for wanting to deal with DOM/SAX
representations of your objects rather than the objects themselves, it is a
misconception to think that document/literal is necessarily associated with
XML representations. wrote:

Hi Davinder
I am going to try out what you suggested - but before that I would ask one
question - this Add and AddResponse which are the parameters [input and
return] of the services "add" method - can you invoke the add method from
the client just by passing XML and not dealing with the Add object? Because
I am not getting what else one can buy with using Doc/literal type service
if they are not able to pass XML and are forced to deal with Objects.

                       Davinder Singh

                       <        To:
"''" <>

                       >                        cc:

                                                Subject:  RE: document style
web services
                       04/29/2003 01:17


                       Please respond to


Hi Anamitra,
i have set up a doc/lit webservice using axis. i started with a wsdl file
and created the java impl using WSDL2java tool.

WSDL2java command: java org.apache.axis.wsdl.WSDL2Java -W -o . -d
Application -s -S false  -Nurn:CalculateNS packageName filename.wsdl

***************** WSDL **********************
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http=""
xmlns:soap="" xmlns:s="" xmlns:s0="urn:CalculateNS"
xmlns:soapenc="" xmlns:tm="" xmlns:mime="" targetNamespace="urn:CalculateNS"

     <s:schema elementFormDefault="qualified"

       <s:element name="Add">
             <s:element minOccurs="0" maxOccurs="1" name="arg1" type="s:int"
             <s:element minOccurs="0" maxOccurs="1" name="arg2" type="s:int"

       <s:element name="AddResponse">
             <s:element minOccurs="0" maxOccurs="1" name="addResult"
type="s:int" />


   <message name="AddSoapIn">
     <part name="parameters" element="s0:Add" />
   <message name="AddSoapOut">
     <part name="parameters" element="s0:AddResponse" />

   <portType name="CalculateSoap">
     <operation name="Add">
       <input message="s0:AddSoapIn" />
       <output message="s0:AddSoapOut" />

   <portType name="CalculateHttpGet" />

   <portType name="CalculateHttpPost" />

   <binding name="CalculateSoap" type="s0:CalculateSoap">
     <soap:binding transport=""
style="document" />
     <operation name="Add">
       <soap:operation soapAction="" style="document" />
         <soap:body use="literal" />
         <soap:body use="literal" />

   <binding name="CalculateHttpGet" type="s0:CalculateHttpGet">
     <http:binding verb="GET" />

   <binding name="CalculateHttpPost" type="s0:CalculateHttpPost">
     <http:binding verb="POST" />

   <service name="Calculate">
     <port name="CalculateSoap" binding="s0:CalculateSoap">
       <soap:address location="http://axismachine/axis/services/Calculate"
     <port name="CalculateHttpGet" binding="s0:CalculateHttpGet">
       <http:address location="http://axismachine/axis/services/Calculate"
     <port name="CalculateHttpPost" binding="s0:CalculateHttpPost">
       <http:address location="http://axismachine/axis/services/Calculate"

********************** WSDL *************************

After u run the command, it will generate,
classes among others.
The method exposed is "public packageName.AddResponse add(packageName.Add
This takes an Object as input param and gives an object as return value. U
will have to modify and as following:

U can see that in the type definition of these ser/deser classes, there is
an extra char (">") Search for '>AddResponse' and '>Add' and remove '>'
symbol. Similary for 'deploy.wsdd'. (I dont know why this character is
inserted , may be some bug in Axis)

Now u can insert ur code in and compile. After
compilation u can deploy the service using deploy command: java
-lhttp://axismachine/axis/services/AdminService deploy.wsdd

Regarding ur second query, yes it is possible if u use wrapped/literal
option given by axis. u can use it by using following command: java
org.apache.axis.wsdl.WSDL2Java -o . -d Application -s -S false
-Nurn:CalculateNS packageName filename.wsdl

Notice that only -W is removed. This turns off Wrapped feature.


-----Original Message-----
Sent: Monday, April 28, 2003 6:09 PM
Subject: document style web services

Hi All
I need some pointers as to how to set up a document style web service using

apache axis. What I am trying to attempt is simple. I have a method like

public void processPo(POBean poBean)
in a class and I do have the schema representation of the POBean. I want
the client program to invoke the web service using XML and does not have to

bother abt the POBean. As per the Axix documentation goes - this is
possible. But ot doesnot explain how to generate the web service. Does
anyone has any sample document style web service? Any sample would be of
great help.

Also is it possible to have the method like

public void processPo(String poXML)

and still in the WSDL generated the user sees the schema for the poxml and
has a schema validation?


The new MSN 8: smart spam protection and 2 months FREE*

View raw message