Matt,
    I had similar problems and solved it using the following approach
1.  Create a base wsdl 'base.wsdl' file with just the complex types defined like your document.  These would be the complex types that java2wsdl cannot generate correctly so you would have to write them.
2. When using java2wsdl use the '-I base.wsdl' option.  This way the definitions in the base.wsdl are automatically reused.
 
Sekhar Mallipeddi
-----Original Message-----
From: Matthew Sgarlata [mailto:[EMAIL PROTECTED]
Sent: Monday, February 16, 2004 1:27 PM
To: [EMAIL PROTECTED]
Subject: Re: [repost] Java2WSDL serialization problem

Thanks Tony!
 
I tried adding the noOp method, and using the -e option, but the WSDL still doesn't look right.  Here is the command I used:
 
java org.apache.axis.wsdl.Java2WSDL
    -o document.wsdl
    -lhttp://localhost/jrocservice/services/DocumentService
    -ecom.bah.jroc.vo.DocumentVo
    com.bah.jroc.document.IDocumentService
 
I have this from Java2WSDL:
 
   <complexType name="DocumentVo">
    <sequence/>
   </complexType>
 
when I should have
 
<complexType name="Document">
  <sequence>
    <element name="description" nillable="true" type="tns2:string" />
    <element name="title" nillable="true" type="tns2:string" />
    <element name="id" nillable="true" type="tns2:decimal" />
  </sequence>
</complexType>
 
Is there some way to tell Java2WSDL to use my WSDD file that I used to deploy my service?  It would be nice to generate fresh WSDL as part of my build process.  I understand your argument regarding WSDL being easy to write, but I would rather automate the process if possible.
 
Would you consider these problems with Java2WSDL bugs, or am I totally off-base here?  If this problem is a bug, any idea if it might be in the issue tracking system used by Axis?
 
Thanks again,
 
Matt
----- Original Message -----
From: Tony Blair
Sent: Sunday, February 15, 2004 1:02 PM
Subject: Re: [repost] Java2WSDL serialization problem

Matthew,
 
We have discovered that java2WSDL ant task has problem with nested complex types. It does not create proper WSDL.If the generated WSDL still doesn't have proper definition for your nested complex type, then you can create a dummy operation in your service interface as follow:
 
MyNestedComplexType noOp(MyNestedComplexType data). This will force it to pick all the nested types.
 
Also during the binding step you must use the -e option to pick up all the complext type java files.
 
WSDL2java ant task also have problem generating proper client java classes when faced with nested complex type. It skips to genereate encoder, ser and deser for the next types. There you must edit the file and add the code manually. In case if you are wondering what I mean by the nested complex type, here is an example:
 
Class Request{
   private Parameter p; // Parameter is a complex type that is nested within the Request class.
}
 
These ant tasks have suttle bugs. They work well with interfaces that deal with simple or primitive types. The advantage of using them is to get a deploy.wsdd and Client code. However IMHO writing a wsdd and client code is simple enough that is not worth using these ant tasks.
 
Hope this helps.

Matthew Sgarlata <[EMAIL PROTECTED]> wrote:
Hello,

I apologize for the repost, but my original post never received a response.
Here's my question:

I am having some trouble using the Java2WSDL emitter with Axis 1.2 alpha,
and I am hoping someone could offer me some help. I am new to web services,
and to Apache Axis as well.

I deployed my web service using the AdminClient, and looked at its WSDL
using ?WSDL. I can see that the BeanSerializer I defined in my deploy.wsdd
file is being picked up by ?WSDL, because I see the proper
definition in the WSDL in my web browser. However, when I try to run the
Java2WSDL task, I don't get a complex type (I just get my object specified
in the WSDL as an xsd:anyType). How come ?WSDL picks up my complex type and
Java2WSDL does not? Here is the command I am using to run Java2WSDL:

java org.apache.axis.wsdl.Java2WSDL
-o document.wsdl
-lhttp://localhost/jrocservice/services/DocumentService
com.bah.jroc.document.IDocumentService

I also tried this, but I run into the same problem

java org.apache.axis.wsdl.Java2WSDL
-o document.wsdl
-lhttp://localhost/jrocservice/services/DocumentService
-nsomeNamespace
-pcom.bah.jroc.document=someNamespace
com.bah.jroc.document.IDocumentService

Thanks!

Matt




Matthew Sgarlata
Senior Consultant
Booz Allen Hamilton Inc.
Work: 703-377-0871


Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Reply via email to