Good basic rules. 

I'm gonna take that flame bait.

 <atm_says>
You should always start with WSDL -- not from Java.
</atm_says>

in principle, this is a good idea, but in practice it is hard for most
people.  Bootstrapping a WSDL with Java code (or C# code) is a practical
step.  This is what I typically do: 
  1- write a prototype in Java (or C#, or whatever)
  2- Generate the WSDL, using the approriate xxxToWsdl tool (AXIS'
Java2WSDL per ejemplo) 
  3- modify that generated WSDL, and add comments 
  4- generate server-skeleton from the modified WSDL
  5- iterate on 3 and 4 until you're happy.  
  6- promote the modified WSDL to "source", stuff it into source
control, and discard the Java prototype interface.  

For simpler projects, I just start with a blank WSDL template, something
like what I have in step 2.  But for more complex interfaces, it helps
to prototype it in source code, first.  

-D

-----Original Message-----
From: Anne Thomas Manes [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 04, 2005 9:28 AM
To: [email protected]
Subject: Re: Newbie question for Doc/literal web service using Axis

<flameOn>
The documentation in the user guide is terrible. You should always start
with WSDL -- not from Java.
</flameOn>

Here are some basic rules: 

If you want to generate a web service from your Java interface, then you
should always use wrapped/literal. Wrapped/literal supports multiple
parameters, whereas document/literal does not.

If you want to generate document/literal from your Java interface, then
you need to design your interface such that it accepts a single object
as input and returns a single object.

Better yet, write your WSDL first, and generate your Java code from it.

Anne  


On Fri, 04 Mar 2005 13:17:30 +0900, Bill Keese
<[EMAIL PROTECTED]> wrote:
> Do you really want document/literal rather than wrapped/literal?  Most

> people send messages like
> 
> <concatentate>
>   <in0>hello</in0>
>   <in0>world</in0>
> </concatenate>
> 
> ...which is wrapped literal (since the top tag is the name of the
function).
> 
> Ketan Deshpande wrote:
> 
> >Hi all!
> >
> >I am a newbie at this, so please be gentle...
> >
> >I am trying to write a web service that is document-literal. I am 
> >following the example give in the Axis guide:
> >(I am using axis-1_2RC2)
> >
> >1. Create an interface & Compile it to .class public interface 
> >MyWebService {
> >  public String concatenate(String str1, String str2); } 2. Generate 
> >WSDL from it:
> >java -classpath %MY_CLASSPATH% org.apache.axis.wsdl.Java2WSDL -o 
> >myws.doc.wsdl -u LITERAL --style DOCUMENT -l%MY_LOCATION% -n 
> >"urn:MyWebServiceNS"
> >MyWebService
> >
> >3. Now generate server code from it:
> >java -classpath %MY_CLASSPATH% org.apache.axis.wsdl.WSDL2Java -W -s 
> >-S true -o server.doc.generated myws.doc.wsdl
> >
> >When I run this, I get a NullPointerException on the Server side, in 
> >Axis code.
> >
> >
> >SOAPMonitor shows the client sending this message in the envelope:
> ><soapEnv:Body>
> >       <in0 xmlns="urn:MyWebServiceNS">A</in0>
> >       <in1 xmlns="urn:MyWebServiceNS">B</in1>
> ></soapEnv:Body>
> >
> >When I looked into the server code, I saw that the server skeleton 
> >was more like RPC or Wrapped:
> >    public java.lang.String concatenate(java.lang.String in0, 
> >java.lang.String
> >in1) throws java.rmi.RemoteException
> >    {
> >        java.lang.String ret = impl.concatenate(in0, in1);
> >        return ret;
> >    }
> >
> >
> >What am I doing wrong? Any pointers you can provide will be most 
> >gratefully appreciated.
> >
> >Thanks much!
> >
> >-Ketan
> >
> >=====
> >Ketan Deshpande
> >[EMAIL PROTECTED]
> >
> >__________________________________________________
> >Do You Yahoo!?
> >Tired of spam?  Yahoo! Mail has the best spam protection around 
> >http://mail.yahoo.com
> >
> >
> >
> >
>

Reply via email to