axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julien Wajsberg (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Commented: (AXIS-1793) wsdl2java gives NullPointerException when using unqualified "part" attribute in soap:header
Date Fri, 28 Jan 2005 13:24:17 GMT
     [ http://issues.apache.org/jira/browse/AXIS-1793?page=comments#action_58221 ]
     
Julien Wajsberg commented on AXIS-1793:
---------------------------------------

I think the priority should be set to "minor", sorry...

> wsdl2java gives NullPointerException when using unqualified "part" attribute in soap:header
> -------------------------------------------------------------------------------------------
>
>          Key: AXIS-1793
>          URL: http://issues.apache.org/jira/browse/AXIS-1793
>      Project: Axis
>         Type: Bug
>   Components: WSDL processing
>     Versions: 1.2RC2
>  Environment: Linux 2.6, using the ANT task wsdl2java
>     Reporter: Julien Wajsberg

>
> When using the following wsdl, I get a NullPointerException. I traced the bug to be cause
by an unqualified "part" attribute on the soap:header line.
> WSDL :
> ----
> <?xml version="1.0"?>
> <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns:wsdl_target="http://localhost/myMethod" name="myMethod" targetNamespace="http://localhost/myMethod">
>   <wsdl:types>
>     <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://localhost/myMethod">
>       <xsd:element name="myMethod">
> 		  <xsd:complexType>
> 			  <xsd:sequence>
> 				  <xsd:element type="xsd:string" name="str1"/>
> 			  </xsd:sequence>
> 		  </xsd:complexType>
> 	  </xsd:element>
>       <xsd:element name="MyHeader">
>         <xsd:complexType>
>           <xsd:sequence>
>             <xsd:element name="Username" type="xsd:string" maxOccurs="1" minOccurs="1"/>
>             <xsd:element name="Password" type="xsd:string" maxOccurs="1" minOccurs="1"/>
>           </xsd:sequence>
>         </xsd:complexType>
>       </xsd:element>
>     </xsd:schema>
>   </wsdl:types>
>   <wsdl:message name="MyMessage">
>     <wsdl:part name="parameters" element="wsdl_target:myMethod"/>
>   </wsdl:message>
>   <wsdl:message name="MyHeaderMessage">
>     <wsdl:part name="parameters" element="wsdl_target:MyHeader"/>
>   </wsdl:message>
>   <wsdl:portType name="MyPortType">
>     <wsdl:operation name="myMethod">
>       <wsdl:input message="wsdl_target:MyMessage"/>
>     </wsdl:operation>
>   </wsdl:portType>
>   <wsdl:binding name="MyBinding" type="wsdl_target:MyPortType">
>     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
>     <wsdl:operation name="myMethod">
>       <soap:operation style="document" soapAction=""/>
>       <wsdl:input>
>         <soap:body use="literal"/>
>         <soap:header use="literal" part="parameters" message="wsdl_target:MyHeaderMessage"/>
>       </wsdl:input>
>       <wsdl:output>
>         <soap:body use="literal"/>
>       </wsdl:output>
>     </wsdl:operation>
>   </wsdl:binding>
>   <wsdl:service name="MyService">
>     <wsdl:port name="Service" binding="wsdl_target:MyBinding">
>       <soap:address location="http://whatever/web/service"/>
>     </wsdl:port>
>   </wsdl:service>
> </wsdl:definitions>
> ----
> If I remove 'part="parameters", or if I add replace it by 'part="wsdl_target:parameters"',
it works fine.
> I get the following exception :
> ----
> [axis-wsdl2java] java.lang.NullPointerException
> [axis-wsdl2java] at org.apache.axis.wsdl.toJava.Utils.getNewQNameWithLastLocalPart(Utils.java:933)
> [axis-wsdl2java] at org.apache.axis.wsdl.toJava.JavaStubWriter.writeOperationMap(JavaStubWriter.java:590)
> [axis-wsdl2java] at org.apache.axis.wsdl.toJava.JavaStubWriter.writeFileBody(JavaStubWriter.java:169)
> [axis-wsdl2java] at org.apache.axis.wsdl.toJava.JavaWriter.generate(JavaWriter.java:130)
> [axis-wsdl2java] at org.apache.axis.wsdl.toJava.JavaBindingWriter.generate(JavaBindingWriter.java:147)
> [axis-wsdl2java] at org.apache.axis.wsdl.toJava.JavaGeneratorFactory$Writers.generate(JavaGeneratorFactory.java:424)
> [axis-wsdl2java] at org.apache.axis.wsdl.gen.Parser.generate(Parser.java:471)
> [axis-wsdl2java] at org.apache.axis.wsdl.gen.Parser.access$000(Parser.java:44)
> [axis-wsdl2java] at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:357)
> [axis-wsdl2java] at java.lang.Thread.run(Thread.java:534)
> ---
> I don't know how the correct implementation should behave, but it should at least throw
a checked Exception for the user to know where the actual error is.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message