Hi all,

I ran into a bug in Axis 1.1 where if you have a combination of in, out and inout parameters, Axis gets confused and screws up the array of parameters delivered to the xxxImpl.java code. As a result, there's a Java exception because the parameters don't match the method call signature.

It looks like this bug is fixed in 1.3, so I'm trying to move to that version. But now with 1.3 I'm running into code generation problems.

First, when I use the Axis 1.3 WSDL2Java to generate the server side classes, I get the following error:

- Unable to find required classes (javax.activation.DataHandler and javax.mail.internet.MimeMultipart). Attachment support is disabled.
Parsing XML file:  axisprob.wsdl
java.io.IOException: Type specialAttrs is referenced but not defined.
at org.apache.axis.wsdl.symbolTable.SymbolTable.checkForUndefined(SymbolTable.java:665) at org.apache.axis.wsdl.symbolTable.SymbolTable.add(SymbolTable.java:545) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:518) at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:495)
       at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
       at java.lang.Thread.run(Thread.java:552)

The issue that that WSDL2Java's got a problem with specialAttrs, which is an attribute group defined by the w3c. I'm importing the xml.xsd schema where specialAttrs is defined. I assume that the DataHandler and MimeMultipart warnings are just noise since I don't need attachment support.

When I previously generated code with Axis 1.1, this error did not happen. Further, other validation tools think that the wsdl is fine.

Rather than post my whole schema and wsdl, I've reproduced the problem in a simple sample wsdl (appended below).

As a test I removed line 30 of my wsdl (where I reference xml:specialAttrs), then the code generates. That's not a valid work around though because in the real world, this problem appears in an external schema file. In any case, even when I hack the wsdl, the generated code doesn't build, which is my second problem.

It looks like when you're using document wrapped style and have more than one out or inout parameters, Axis wants to wrap any outputted class in a "holder" class. That makes sense.

But in this case of my sample wsdl, the code generated passes a org.apache.axis.holders.NMTokenHolder to the AxisprobSOAPBindingImpl.problemMessage method. This causes build errors because there is no NMTokenHolder class. There is only a TokenHolder class.

I suppose that I can manually edit the generated code to change the undefined NMTokenHolder to TokenHolder classes. But it's bothersome that Axis is generating code for classes that don't exist.

Again, the problem wsdl can be found below. Also, I've posted a zip of the wsdl and code generated here:

http://homepage.mac.com/WebObjects/FileSharing.woa/wa/axis_1_3_problem.zip.zip?a=downloadFile&user=paceap&path=Sites/axis_1_3_problem.zip

Any suggestions for solving these problems would be welcome.

Best regards,
--
Allen Cronce

---------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<definitions targetNamespace="axisprob.wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/";
   xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/";
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
   xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
xmlns="http://schemas.xmlsoap.org/wsdl/"; xmlns:xs="http://www.w3.org/2001/XMLSchema"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xmlns:wsdlns="axisprob.wsdl"
   xmlns:xsdns="axisprob.xsd">
   <!-- Imports -->
   <xs:import namespace="http://www.w3.org/XML/1998/namespace";
       schemaLocation="http://www.w3.org/2001/xml.xsd"/>
   <types>
       <xs:schema targetNamespace="axisprob.xsd" xmlns:xsdns="axisprob.xsd"
           xmlns:xs="http://www.w3.org/2001/XMLSchema";
           xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
           xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";>
           <!-- Types -->
           <!-- TextType -->
           <xs:complexType name="TextType" mixed="true">
               <xs:annotation>
<xs:documentation xml:lang="en"> This is a type definition for generic text in XML. For maintenance reasons, it is preferable to use something like this rather than the built-in datatype string, unless you have an absolute requirement to use a simple datatype. </xs:documentation>
               </xs:annotation>
               <xs:sequence>
<xs:any namespace="##any" minOccurs="0" maxOccurs="unbounded"
                       processContents="lax"/>
               </xs:sequence>
               <xs:attributeGroup ref="xml:specialAttrs"/>
               <xs:anyAttribute namespace="##any" processContents="lax"/>
           </xs:complexType>
           <!-- GUIDType -->
           <xs:simpleType name="GUIDType">
               <xs:annotation>
<xs:documentation xml:lang="en"> This is a type definition for globally unique
                       identifiers. </xs:documentation>
               </xs:annotation>
               <xs:restriction base="xs:NMTOKEN">
                   <xs:pattern
value="[0-9,A-F,a-f]{8}-[0-9,A-F,a-f]{4}-[0-9,A-F,a-f]{4}-[0-9,A-F,a-f]{4}-[0-9,A-F,a-f]{12}"
                   />
               </xs:restriction>
           </xs:simpleType>
           <!-- RecordReferenceType -->
           <xs:simpleType name="RecordReferenceType">
               <xs:annotation>
<xs:documentation xml:lang="en"> This is a type definition for globally unique
                       identifiers. </xs:documentation>
               </xs:annotation>
               <xs:restriction base="xs:NMTOKEN"> </xs:restriction>
           </xs:simpleType>
           <!-- Methods signatures -->
           <!-- problemMessage -->
           <xs:element name="problemMessage">
               <xs:annotation>
<xs:documentation xml:lang="en"> NEEDS COMMENT </xs:documentation>
               </xs:annotation>
               <xs:complexType>
                   <xs:sequence>
<xs:element name="customerGUID" type="xsdns:GUIDType"/> <xs:element name="customerReference" type="xsdns:TextType" minOccurs="0"
                           maxOccurs="1"/>
                   </xs:sequence>
               </xs:complexType>
           </xs:element>
           <!-- problemMessageResponse -->
           <xs:element name="problemMessageResponse">
               <xs:annotation>
<xs:documentation xml:lang="en"> NEEDS COMMENT </xs:documentation>
               </xs:annotation>
               <xs:complexType>
                   <xs:sequence>
                       <xs:element name="transactionRecordReference"
                           type="xsdns:RecordReferenceType"/>
<xs:element name="customerReference" type="xsdns:TextType" minOccurs="0"
                           maxOccurs="1"/>
                       <xs:element name="guid" type="xsdns:GUIDType"/>
                   </xs:sequence>
               </xs:complexType>
           </xs:element>
       </xs:schema>
   </types>
   <!-- Messages -->
   <!-- problemMessage message -->
   <message name="problemMessage">
       <part name="parameters" element="xsdns:problemMessage"/>
   </message>
   <message name="problemMessageResponse">
       <part name="parameters" element="xsdns:problemMessageResponse"/>
   </message>
   <!-- Port type -->
   <portType name="axisprobPortType">
       <!-- problemMessage -->
       <operation name="problemMessage">
           <input message="wsdlns:problemMessage"/>
           <output message="wsdlns:problemMessageResponse"/>
       </operation>
   </portType>
   <!-- Binding for axisprob Web APIs - Document style, SOAP over HTTP -->
   <binding name="axisprobSOAPBinding" type="wsdlns:axisprobPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
       <!-- problemMessage -->
       <operation name="problemMessage">
           <soap:operation soapAction="urn:axisprob2Action"/>
           <input>
               <soap:body use="literal" namespace="axisprob.wsdl"/>
           </input>
           <output>
               <soap:body use="literal" namespace="axisprob.wsdl"/>
           </output>
       </operation>
   </binding>
   <!-- Endpoint for axisprob Web APIs -->
   <service name="axisprob2">
       <port name="axisprobPortType" binding="wsdlns:axisprobSOAPBinding">
<soap:address location="http://localhost:4310/WebObjects/axisprob2.woa/wa/axisprob2"/>
       </port>
   </service>
</definitions>

Reply via email to