axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Davanum Srinivas <dava...@gmail.com>
Subject Re: [axis2] WSDL2Code throws NPE on complex type
Date Wed, 23 Nov 2005 21:03:02 GMT
try --wrapArrays when running WSDL2Java.

On 11/23/05, iksrazal <iksrazal@gmail.com> wrote:
> Hi Anne, thanks for the tips. I'm using the editor you recommended - runs on
> linux even ;-) .
>
> I'm getting one error still. I moved to WSDL2Java from axis v1.3 for better
> error messages. I'm sure the error has something to do with 'extension
> base' . I just resolved a jira issue on this:
>
> http://issues.apache.org/jira/browse/AXIS-2165
>
> I'm getting:
>
> /home/iksrazal/white3/build.xml:154: WSDL processing error
> for /home/iksrazal/white3/resources/axis-jira-doclit.wsdl :
>  Type {http://com/callcentreweb/types}elementReturnWeb_Base is referenced but
> not defined.
>
> I'm not quite sure how to do this with doc lit. Any ideas ? Thanks!
>
> <?xml version="1.0" encoding="UTF-8"?>
>
> <definitions name="CallCentreWebService"
> targetNamespace="http://com/callcentreweb"
> xmlns:tns="http://com/callcentreweb" xmlns="http://schemas.xmlsoap.org/wsdl/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> xmlns:ns2="http://com/callcentreweb/types">
>   <types>
>     <schema targetNamespace="http://com/callcentreweb/types"
> xmlns:tns="http://com/callcentreweb/types"
> xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> xmlns="http://www.w3.org/2001/XMLSchema">
>       <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>       <element name="elementReturnWeb_Base">
>         <complexType>
>           <sequence>
>             <element name="tns:errorMessage" type="string"/>
>             <element name="tns:successErrorCode" type="int"/>
>           </sequence>
>         </complexType>
>       </element>
>       <element name="elementReturnWeb_Login">
>         <complexType>
>           <complexContent>
>             <extension base="tns:elementReturnWeb_Base">
>               <sequence>
>                 <element name="tns:SOAP_Session_id" type="string"/>
>                 <element name="tns:web_user_name" type="string"/>
>               </sequence>
>             </extension>
>           </complexContent>
>         </complexType>
>       </element>
>       <element name="web_Login_Type">
>         <complexType>
>           <sequence>
>             <element ref="tns:user_nameElement"/>
>             <element ref="tns:user_passwordElement"/>
>           </sequence>
>         </complexType>
>       </element>
>       <element name="user_nameElement" type="xsd:string"/>
>       <element name="user_passwordElement" type="xsd:string"/>
> </schema></types>
>   <message name="CallCentreWebEndpoint_web_Login">
>      <part name="parameters" element="ns2:web_Login_Type"/>
>   </message>
>   <message name="CallCentreWebEndpoint_web_LoginResponse">
>     <part name="result" element="ns2:elementReturnWeb_Login"/>
>   </message>
>   <portType name="CallCentreWebEndpoint">
>     <operation name="web_Login">
>       <input message="tns:CallCentreWebEndpoint_web_Login"/>
>       <output message="tns:CallCentreWebEndpoint_web_LoginResponse"/>
>     </operation>
>   </portType>
>   <binding name="CallCentreWebEndpointBinding"
> type="tns:CallCentreWebEndpoint">
>     <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> style="document"/>
>     <operation name="web_Login">
>       <soap:operation soapAction=""/>
>       <input>
>         <soap:body use="literal"/>
>       </input>
>       <output>
>         <soap:body use="literal"/>
>       </output>
>     </operation>
>   </binding>
>   <service name="CallCentreWebService">
>     <port name="CallCentreWebEndpointPort"
> binding="tns:CallCentreWebEndpointBinding">
>       <soap:address
> location="http://127.0.0.1"/></port></service></definitions>
>
>
>
> Em Quarta 23 Novembro 2005 12:08, o Anne Thomas Manes escreveu:
> > I agree that the NPE isn't particularly informative, but you do have a
> > number of errors in your WSDL. I suggest you get a WSDL editor with a
> > validation function.
> > The Cape Clear SOA Editor is free and works pretty well.
> >
> > First error:
> > You have two elements defined in your schema named "elementReturnWeb_Base"
> >
> > Second set of errors:
> > You need to be more careful with your namespace qualifications. In your
> > message parts, you don't qualify the referenced elements, so it defaults to
> > the wsdl namespace. e.g.,
> >
> > This:
> >   <part name="user_name" element="user_nameElement"/>
> >
> > should be this:
> >   <part name="user_name" element="tns:user_nameElement"/>
> >
> > And finally:
> > When using document style, a message must contain at most one body part.
> > You have two body parts in your login request. You must create a wrapper
> > element (preferably with the same name as the operation) and use that as
> > your input element. e.g.,
> >
> >  <x:element name="web_Login">
> >   <x:complexType>
> >    <x:sequence>
> >      <x:element ref="tns:user_nameElement"/>
> >      <x:element ref="tns:user_passwordElement"/>
> >     </x:sequence>
> >    </x:complexType>
> >  </x:element>
> >
> >  <w:message name="CallCentreWebEndpoint_web_Login">
> >   <w:part name="parameters" element="tns:web_Login"/>
> >  </message>
> >
> > Anne
> >
> > On 11/23/05, iksrazal <iksrazal@gmail.com> wrote:
> > > Hi all,
> > >
> > > I'm trying to convert a simple wsdl from rpc encoded to doc lit and wsdl
> > > 2.0.
> > > Please excuse if I'm making a simple error here. However, the wsdl is
> > > valid
> > > xml. I'm getting:
> > >
> > > ./WSDL2Java.sh -uri wout/axis-jira-doclit.wsdl -o wout/
> > > ...
> > >
> > > Exception in thread "main" java.lang.NullPointerException
> > >   at
> > > org.apache.axis2.wsdl.builder.wsdl4j.WSDLPump.generateWrapperSchema(
> > > WSDLPump.java:633)
> > >   at
> > > org.apache.axis2.wsdl.builder.wsdl4j.WSDLPump.populateDefinition(
> > > WSDLPump.java:153)
> > >   at
> > > org.apache.axis2.wsdl.builder.wsdl4j.WSDLPump.pump(WSDLPump.java:100)
> > >   at
> > > org.apache.axis2.wsdl.builder.wsdl4j.WSDL1ToWOMBuilder.build(
> > > WSDL1ToWOMBuilder.java:126)
> > >   at
> > > org.apache.axis2.wsdl.builder.wsdl4j.WSDL1ToWOMBuilder.build(
> > > WSDL1ToWOMBuilder.java:95)
> > >   at
> > > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.getWOM(
> > > CodeGenerationEngine.java:117)
> > >   at
> > > org.apache.axis2.wsdl.codegen.CodeGenerationEngine.<init>(
> > > CodeGenerationEngine.java:47)
> > >   at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:30)
> > >   at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:21)
> > >
> > > The line throwing is:
> > >
> > > if (XMLSCHEMA_NAMESPACE_URI.equals(schemaTypeName.getNamespaceURI())){
> > >
> > > Here's my wsdl, once again please excuse if there is an error, but even
> > > still
> > > perhaps the the error should'nt be NPE.
> > >
> > > <?xml version="1.0" encoding="UTF-8"?>
> > >
> > > <definitions name="CallCentreWebService"
> > > targetNamespace="http://com/callcentreweb"
> > > xmlns:tns="http://com/callcentreweb" xmlns="
> > > http://schemas.xmlsoap.org/wsdl/"
> > > xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
> > > xmlns:ns2="http://com/callcentreweb/types">
> > > <types>
> > >   <schema targetNamespace="http://com/callcentreweb/types"
> > > xmlns:tns="http://com/callcentreweb/types"
> > > xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
> > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> > > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
> > > xmlns="http://www.w3.org/2001/XMLSchema">
> > >   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
> > >   <element name="elementReturnWeb_Base">
> > >   <complexType name="ReturnWeb_Base">
> > >   <sequence>
> > >   <element name="errorMessage" type="string"/>
> > >   <element name="successErrorCode" type="int"/>
> > >   </sequence>
> > >   </complexType>
> > >   </element>
> > >   <element name="elementReturnWeb_Base">
> > >   <complexType name="ReturnWeb_Login">
> > >   <complexContent>
> > >   <extension base="tns:ReturnWeb_Base">
> > >   <sequence>
> > >   <element name="SOAP_Session_id" type="string"/>
> > >   <element name="web_user_name" type="string"/>
> > >   </sequence>
> > >   </extension>
> > >   </complexContent>
> > >   </complexType>
> > >   </element>
> > >   <element name="user_nameElement" type="xsd:string"/>
> > >   <element name="user_passwordElement" type="xsd:string"/>
> > > </schema></types>
> > > <message name="CallCentreWebEndpoint_web_Login">
> > >   <part name="user_name" element="user_nameElement"/>
> > >   <part name="user_password" element="user_passwordElement"/>
> > > </message>
> > > <message name="CallCentreWebEndpoint_web_LoginResponse">
> > >   <part name="result" element="elementReturnWeb_Login"/>
> > > </message>
> > > <portType name="CallCentreWebEndpoint">
> > >   <operation name="web_Login" parameterOrder="user_name user_password">
> > >   <input message="tns:CallCentreWebEndpoint_web_Login"/>
> > >   <output message="tns:CallCentreWebEndpoint_web_LoginResponse"/>
> > >   </operation>
> > > </portType>
> > > <binding name="CallCentreWebEndpointBinding"
> > > type="tns:CallCentreWebEndpoint">
> > >   <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
> > > style="document"/>
> > >   <operation name="web_Login">
> > >   <soap:operation soapAction=""/>
> > >   <input>
> > >   <soap:body use="literal"/>
> > >   </input>
> > >   <output>
> > >   <soap:body use="literal"/>
> > >   </output>
> > >   </operation>
> > > </binding>
> > > <service name="CallCentreWebService">
> > >   <port name="CallCentreWebEndpointPort"
> > > binding="tns:CallCentreWebEndpointBinding">
> > >   <soap:address
> > > location="http://127.0.0.1"/></port></service></definitions>
> > >
> > > --
> > > Faster, better, cheaper - choose two of the above.   - Old engineering
> > > proverb
> > >
> > > It's easier to ask for forgiveness than permission.   - Another old
> > > engineering proverb
>


--
Davanum Srinivas : http://wso2.com/blogs/

Mime
View raw message