Deepal,

I have attached the Java interface and the generated WSDL file.

The value of variables at the point of invoking the generator were:

javaInterfaceName= "testexamples.IWWPointsCalculator"
fileName= "WWPointsCalculator.wsdl"
wsdlFile= 
"c:/Java/projects2/axis2-std-1.0testbed/build/wsdl/WWPointsCalculator.wsdl"
outputStream= FileOutputStream  (id=33)
classLoader= Launcher$AppClassLoader  (id=40)
java2WsdlBuilder= Java2WSDLBuilder  (id=46)
style= "document"
use= "literal"

The code to invoke the Java2WSDLBuilder is as follows:

TaskRunner.run("mkdir dir=${1}", wsdlDir);
String wsdlFile = getProject().getWsdlDir()+dirSep+fileName;
OutputStream outputStream = new FileOutputStream(wsdlFile);
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
                
try {
       classLoader.loadClass(javaInterfaceName);
} catch (Exception ex){
        System.out.println("Java interface not found");
        ex.printStackTrace();
        throw new Exception("Java interface not found", ex);
}
                
Java2WSDLBuilder java2WsdlBuilder = new Java2WSDLBuilder(outputStream,
           javaInterfaceName, classLoader);
String style = Java2WSDLConstants.DOCUMENT;
String use = Java2WSDLConstants.LITERAL;
java2WsdlBuilder.setLocationUri(project.getWsdlDir());
java2WsdlBuilder.setServiceName(project.getServiceName());
java2WsdlBuilder.setStyle(style);
                
java2WsdlBuilder.setTargetNamespace("http://PointsCalculator.ve.recursionsw.com/types";);
java2WsdlBuilder.setTargetNamespacePrefix("ns");
java2WsdlBuilder.setUse(use);
java2WsdlBuilder.setWsdlPrefix("ve");
java2WsdlBuilder.setServiceName(project.getServiceName());
                
java2WsdlBuilder.generateWSDL();
outputStream.close();

As I mentioned, I am using Axis2 Std 1.0 daily build for Friday 23 June 2006

I attached the IWWPointsCalculator interface, the FoodDescription
class (the parameter for the operation), and the generated WSDL file.

Let me know if anything else would be helpful.
It would also be a good outcome if you can suggest a way to generate a
valid WSDL file using different parameters.

Thank you,

Jim


On 6/26/06, Jim Bender <[EMAIL PROTECTED]> wrote:
Deepal,

The example works with Axis2 0.93, if the interface provided to the
generator is in the default package (otherwise, uncompilable code is
produced). The problem still occurred with the Axis2 Std 1.0 release
and daily builds up to Friday 23 June 2006.

This is the problem that I had previously written a JIRA issue about.
To that, I attached the Java interface. I also can provide the command
line args to the Java2WSDL that I used, so you can try it yourself.
I will have to do that once I get to my desk in about three hours.

Regards,

Jim

On 6/25/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
> Hi Jim
>  Two things
>     - is this happen in current code base or Axis2 1.0
>     - any possibility of helping me to regenerate the problem
>          ( I mean can you give me the source file so that I can test.)
>
> Jim Bender wrote:
>
> > Deepal,
> >
> > The main problem is that when I run Java2WSDL on the interface that
> > has an import of a class with variables and use that as the argument
> > to the method, the generated WSDL is rejected by WSDL2Java, unless I
> > edit the file and remove the duplicate complex type definition. After
> > that, I am am able to use the file, but it is undesirable from the
> > perspective that we want to be able to automatically generate a web
> > service, without human intervention, as we do with Axis2 0.93. The
> > issue is that the generated WSDL produced by Java2WSDL is incorrect
> > for what your WSDL2Java can process. I am sure that Anne is correct in
> > what she says, as she knows a great deal more than I do about WSDL,
> > but the duplicate complex type is what I wrote the JIRA issue about.
> >
> > Regards,
> >
> > Jim
> >
> > On 6/21/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
> >
> >> Hi Jim
> >> pls see my comments below;
> >>
> >> Jim Bender wrote:
> >>
> >> > It appears that the Axis2 Std 1.0 WSDL file generation from a Java
> >> > interface is hard-wired to set the elementFormDefault to
> >> > "unqualified".
> >> >
> >> > By not setting
> >> >
> >> > // java2WsdlBuilder.setSchemaTargetNamespace("");
> >> > // java2WsdlBuilder.setSchemaTargetNamespacePrefix("");
> >> >
> >> > in the Java2WSDLBuilder, I was able to get rid of several problems in
> >> > the generated
> >> > WSDL file.
> >> >
> >> > In the example file, edited by Anne, she had set the
> >> > "elementFormDefault" to
> >> > "qualified", and I looked and there is code in the
> >> > WSDL11ToAxisServiceBuilder
> >> > that is hard-coded to set the elementFormDefault to "unqualified"
> >> > (on line 830). This is the only class that seemed to write the
> >> > "elementFormDefault".
> >>
> >> My knowledge on WSDL is not that rich ,so is Axis2 default behaviors
> >> buggy ? I mean setting elementFormDefault="unqualified" is a bug ?
> >> If so I like to fix that
> >>
> >> > This is in the daily build for last Friday, June 9th.
> >> > As suggested, I am trying the daily build from Friday, to get the
> >> > latest fixes,
> >> > although that is probably not what we need to be using (we want to use
> >> > the
> >> > Axis2 Std 1.0 release).
> >> >
> >> > BTW, there still seems to be some gratuitous namespace references in
> >> > the generated
> >> > SOAP body, which Anne says should not be there.
> >>
> >> I just checked now and it does not generate any namespace element in
> >> SOAP body , its only has <soap:body use="literal"/>
> >>
> >> >
> >> > At least, I realized that I had a way to format the WSDL file so that
> >> > it is not
> >> > quite so unreadable. I attached the formatted file that I just
> >> > generated, to see
> >> > if anyone has any ideas. I will test this against the WSDL2Java
> >> generator
> >> > to see if it will work, as is.
> >> >
> >> > Regards,
> >> >
> >> >------------------------------------------------------------------------
> >>
> >> >
> >> ><wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> >> xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/";
> >> xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
> >> xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
> >> xmlns:ns1="http://testexamples/xsd";
> >> xmlns:ns="http://PointsCalculator.ve.recursionsw.com/types";
> >> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
> >> targetNamespace="http://PointsCalculator.ve.recursionsw.com/types";>
> >> >       <wsdl:types>
> >> >               <xs:schema
> >> xmlns:xs="http://www.w3.org/2001/XMLSchema";
> >> xmlns:ns="http://testexamples/xsd";
> >> targetNamespace="http://testexamples/xsd";
> >> elementFormDefault="unqualified" attributeFormDefault="unqualified">
> >> >                       <xs:element type="ns:FoodDescription"
> >> name="FoodDescription"/>
> >> >                       <xs:complexType name="FoodDescription">
> >> >                               <xs:sequence>
> >> >                                       <xs:element type="xs:int"
> >> name="calories"/>
> >> >                                       <xs:element type="xs:int"
> >> name="fatGrams"/>
> >> >                                       <xs:element type="xs:int"
> >> name="fiberGrams"/>
> >> >                                       <xs:element type="xs:int"
> >> name="points"/>
> >> >                               </xs:sequence>
> >> >                       </xs:complexType>
> >> >                       <xs:element name="calculatePoints">
> >> >                               <xs:complexType>
> >> >                                       <xs:sequence>
> >> >                                               <xs:element
> >> type="ns:FoodDescription" name="param0"/>
> >> >                                       </xs:sequence>
> >> >                               </xs:complexType>
> >> >                       </xs:element>
> >> >                       <xs:element name="calculatePointsResponse">
> >> >                               <xs:complexType>
> >> >                                       <xs:sequence>
> >> >                                               <xs:element
> >> type="xs:int" name="return"/>
> >> >                                       </xs:sequence>
> >> >                               </xs:complexType>
> >> >                       </xs:element>
> >> >                       <xs:complexType name="FoodDescription">
> >> >                               <xs:sequence>
> >> >                                       <xs:element type="xs:int"
> >> name="calories"/>
> >> >                                       <xs:element type="xs:int"
> >> name="fatGrams"/>
> >> >                                       <xs:element type="xs:int"
> >> name="fiberGrams"/>
> >> >                                       <xs:element type="xs:int"
> >> name="points"/>
> >> >                               </xs:sequence>
> >> >                       </xs:complexType>
> >> >               </xs:schema>
> >> >       </wsdl:types>
> >> >       <wsdl:message name="calculatePointsMessage">
> >> >               <wsdl:part element="ns1:calculatePoints" name="part1"/>
> >> >       </wsdl:message>
> >> >       <wsdl:message name="calculatePointsResponseMessage">
> >> >               <wsdl:part element="ns1:calculatePointsResponse"
> >> name="part1"/>
> >> >       </wsdl:message>
> >> >       <wsdl:portType name="PointsCalculatorPortType">
> >> >               <wsdl:operation name="calculatePoints">
> >> >                       <wsdl:input
> >> message="ns:calculatePointsMessage"/>
> >> >                       <wsdl:output
> >> message="ns:calculatePointsResponseMessage"/>
> >> >               </wsdl:operation>
> >> >       </wsdl:portType>
> >> >       <wsdl:binding type="ns:PointsCalculatorPortType"
> >> name="PointsCalculatorSOAP11Binding">
> >> >               <soap:binding style="document"
> >> transport="http://schemas.xmlsoap.org/soap/http"/>
> >> >               <wsdl:operation name="calculatePoints">
> >> >                       <soap:operation style="document"
> >> soapAction="urn:calculatePoints"/>
> >> >                       <wsdl:input>
> >> >                               <soap:body
> >> namespace="http://PointsCalculator.ve.recursionsw.com/types";
> >> use="literal"/>
> >> >                       </wsdl:input>
> >> >                       <wsdl:output>
> >> >                               <soap:body
> >> namespace="http://PointsCalculator.ve.recursionsw.com/types";
> >> use="literal"/>
> >> >                       </wsdl:output>
> >> >               </wsdl:operation>
> >> >       </wsdl:binding>
> >> >       <wsdl:binding type="ns:PointsCalculatorPortType"
> >> name="PointsCalculatorSOAP12Binding">
> >> >               <soap12:binding style="document"
> >> transport="http://schemas.xmlsoap.org/soap/http"/>
> >> >               <wsdl:operation name="calculatePoints">
> >> >                       <soap12:operation style="document"
> >> soapAction="urn:calculatePoints"/>
> >> >                       <wsdl:input>
> >> >                               <soap12:body
> >> namespace="http://PointsCalculator.ve.recursionsw.com/types";
> >> use="literal"/>
> >> >                       </wsdl:input>
> >> >                       <wsdl:output>
> >> >                               <soap12:body
> >> namespace="http://PointsCalculator.ve.recursionsw.com/types";
> >> use="literal"/>
> >> >                       </wsdl:output>
> >> >               </wsdl:operation>
> >> >       </wsdl:binding>
> >> >       <wsdl:service name="PointsCalculator">
> >> >               <wsdl:port binding="ns:PointsCalculatorSOAP11Binding"
> >> name="PointsCalculatorSOAP11port">
> >> >                       <soap:address
> >> 
location="c:/Java/projects2/axis2-std-1.0testbed\build\wsdlPointsCalculator"/>
> >>
> >> >               </wsdl:port>
> >> >               <wsdl:port binding="ns:PointsCalculatorSOAP12Binding"
> >> name="PointsCalculatorSOAP12port">
> >> >                       <soap12:address
> >> 
location="c:/Java/projects2/axis2-std-1.0testbed\build\wsdlPointsCalculator"/>
> >>
> >> >               </wsdl:port>
> >> >       </wsdl:service>
> >> ></wsdl:definitions>
> >> >
> >> >
> >> >------------------------------------------------------------------------
> >>
> >> >
> >> >---------------------------------------------------------------------
> >> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> >For additional commands, e-mail: [EMAIL PROTECTED]
> >> >
> >>
> >> --
> >> Thanks,
> >> Deepal
> >> ................................................................
> >> ~Future is Open~
> >>
> >>
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
>
> --
> Thanks,
> Deepal
> ................................................................
> ~Future is Open~
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Jim



--
Jim
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"; xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"; xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"; xmlns:ns1="http://testexamples/xsd"; xmlns:ns="http://PointsCalculator.ve.recursionsw.com/types"; xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"; targetNamespace="http://PointsCalculator.ve.recursionsw.com/types";><wsdl:types><xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:ns="http://testexamples/xsd"; targetNamespace="http://testexamples/xsd"; elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:element type="ns:FoodDescription" name="FoodDescription" />
<xs:complexType name="FoodDescription">
<xs:sequence>
<xs:element type="xs:int" name="calories" />
<xs:element type="xs:int" name="fatGrams" />
<xs:element type="xs:int" name="fiberGrams" />
<xs:element type="xs:int" name="points" />
</xs:sequence>
</xs:complexType>
<xs:element name="calculatePoints">
<xs:complexType>
<xs:sequence>
<xs:element type="ns:FoodDescription" name="param0" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="calculatePointsResponse">
<xs:complexType>
<xs:sequence>
<xs:element type="xs:int" name="return" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType name="FoodDescription">
<xs:sequence>
<xs:element type="xs:int" name="calories" />
<xs:element type="xs:int" name="fatGrams" />
<xs:element type="xs:int" name="fiberGrams" />
<xs:element type="xs:int" name="points" />
</xs:sequence>
</xs:complexType>
</xs:schema></wsdl:types><wsdl:message name="calculatePointsMessage"><wsdl:part element="ns1:calculatePoints" name="part1" /></wsdl:message><wsdl:message name="calculatePointsResponseMessage"><wsdl:part element="ns1:calculatePointsResponse" name="part1" /></wsdl:message><wsdl:portType name="PointsCalculatorPortType"><wsdl:operation name="calculatePoints"><wsdl:input message="ns:calculatePointsMessage" /><wsdl:output message="ns:calculatePointsResponseMessage" /></wsdl:operation></wsdl:portType><wsdl:binding type="ns:PointsCalculatorPortType" name="PointsCalculatorSOAP11Binding"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"; /><wsdl:operation name="calculatePoints"><soap:operation style="document" soapAction="urn:calculatePoints" /><wsdl:input><soap:body namespace="http://PointsCalculator.ve.recursionsw.com/types"; use="literal" /></wsdl:input><wsdl:output><soap:body namespace="http://PointsCalculator.ve.recursionsw.com/types"; use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:binding type="ns:PointsCalculatorPortType" name="PointsCalculatorSOAP12Binding"><soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"; /><wsdl:operation name="calculatePoints"><soap12:operation style="document" soapAction="urn:calculatePoints" /><wsdl:input><soap12:body namespace="http://PointsCalculator.ve.recursionsw.com/types"; use="literal" /></wsdl:input><wsdl:output><soap12:body namespace="http://PointsCalculator.ve.recursionsw.com/types"; use="literal" /></wsdl:output></wsdl:operation></wsdl:binding><wsdl:service name="PointsCalculator"><wsdl:port binding="ns:PointsCalculatorSOAP11Binding" name="PointsCalculatorSOAP11port"><soap:address location="c:/Java/projects2/axis2-std-1.0testbed/build/wsdlPointsCalculator" /></wsdl:port><wsdl:port binding="ns:PointsCalculatorSOAP12Binding" name="PointsCalculatorSOAP12port"><soap12:address location="c:/Java/projects2/axis2-std-1.0testbed/build/wsdlPointsCalculator" /></wsdl:port></wsdl:service></wsdl:definitions>

Attachment: IWWPointsCalculator.java
Description: Binary data

Attachment: FoodDescription.java
Description: Binary data

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to