Hi Deepal,

I used the codegen but also failed.

If the return type is String, no problem but if I return a customer
JavaBean, it raised the following exception:


public class Client {
         public static void main(String[] args) throws Exception {
                EchoserviceStub stub = new EchoserviceStub();
                Echo1 echo1 = (Echo1)Echo1.class.newInstance();
                echo1.setStr("Testing1234");
                Echo1Response resp = stub.echo1(echo1);
                System.out.println(resp.get_return());
                
                Echo echo = (Echo)Echo.class.newInstance();
                User u = (User)User.class.newInstance();
                u.setBirth(Calendar.getInstance());
                u.setName("Eric Chow");
                echo.setU(u);
                
                EchoResponse rep1 = stub.echo(echo);
        }

}


The Echo1 works fine, but Echo failed:

log4j:WARN No appenders could be found for logger
(org.apache.axiom.om.impl.builder.StAXOMBuilder).
log4j:WARN Please initialize the log4j system properly.
Testing1234...
Exception in thread "main" org.apache.axis2.AxisFault:
java.lang.NullPointerException
        at 
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:287)
        at test.gen.EchoserviceStub.echo(EchoserviceStub.java:244)
        at test.client.Client.main(Client.java:39)
Caused by: java.lang.Exception: org.apache.axis2.AxisFault:
java.lang.NullPointerException; nested exception is:
        org.apache.axiom.om.OMException: java.lang.NullPointerException
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:318)
        at 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:136)
        at 
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:37)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454)
        at 
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HTTPTransportUtils.java:284)
        at 
org.apache.axis2.transport.http.HTTPWorker.processRequest(HTTPWorker.java:255)
        at 
org.apache.axis2.transport.http.server.SimpleConnectionThread.run(SimpleConnectionThread.java:92)
        at 
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
        at 
edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
        at java.lang.Thread.run(Thread.java:595)
Caused by: org.apache.axiom.om.OMException: java.lang.NullPointerException
        at 
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:206)
        at org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:298)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.detach(OMElementImpl.java:584)
        at 
org.apache.axiom.om.impl.llom.OMNodeImpl.setParent(OMNodeImpl.java:118)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:240)
        at 
org.apache.axiom.om.impl.llom.OMElementImpl.addChild(OMElementImpl.java:197)
        at 
org.apache.axis2.rpc.receivers.RPCUtil.processResponse(RPCUtil.java:71)
        at 
org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:130)
        ... 8 more
Caused by: java.lang.NullPointerException
        at 
org.apache.axis2.databinding.utils.reader.WrappingXMLStreamReader.getEventType(WrappingXMLStreamReader.java:141)
        at 
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.processProperties(ADBXMLStreamReaderImpl.java:964)
        at 
org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl.next(ADBXMLStreamReaderImpl.java:807)
        at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:68)
        at 
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:123)
        ... 15 more

        at org.apache.axis2.AxisFault.<init>(AxisFault.java:159)
        ... 3 more





Best regards,
Eric


On 8/29/06, Deepal Jayasinghe <[EMAIL PROTECTED]> wrote:
Hi Eric;

Why dont you try to codegen , then that will generate client for you.

Thanks
Deepal

Eric Chow wrote:

> Hello,
>
> How can I write a simple client to the following WSDL with Axis2?
> The parameter for QueryInv must use OMElement. How to construct the
> OMElement with the following WSDL ?
>
>
> =================================
>
> <?xml version="1.0" encoding="UTF-8"?>
> <wsdl:definitions targetNamespace="http://facade.query.pi";
> xmlns:apachesoap="http://xml.apache.org/xml-soap";
> xmlns:impl="http://facade.query.pi";
> xmlns:intf="http://facade.query.pi";
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
> xmlns:tns1="http://inv.query.pi";
> xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
> xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/";
> xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
> <!--WSDL created by Apache Axis version: 1.2.1
> Built on Aug 08, 2005 (11:49:10 PDT)-->
> <wsdl:types>
>  <schema targetNamespace="http://inv.query.pi";
> xmlns="http://www.w3.org/2001/XMLSchema";>
>   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
>   <complexType name="InvWebQueryCriteria">
>    <sequence>
>     <element name="beginDataPedido" nillable="true" type="xsd:dateTime"/>
>     <element name="beginDataPrior" nillable="true" type="xsd:dateTime"/>
>     <element name="classCod" nillable="true" type="xsd:string"/>
>     <element name="endDataPedido" nillable="true" type="xsd:dateTime"/>
>     <element name="endDataPrior" nillable="true" type="xsd:dateTime"/>
>     <element name="inventNomeC" nillable="true" type="xsd:string"/>
>     <element name="inventNomeP" nillable="true" type="xsd:string"/>
>     <element name="portRegisto" nillable="true" type="xsd:string"/>
>     <element name="procNo" nillable="true" type="xsd:int"/>
>     <element name="requerNomeC" nillable="true" type="xsd:string"/>
>     <element name="requerNomeP" nillable="true" type="xsd:string"/>
>     <element name="tituloC" nillable="true" type="xsd:string"/>
>     <element name="tituloP" nillable="true" type="xsd:string"/>
>    </sequence>
>   </complexType>
>  </schema>
> </wsdl:types>
>
>   <wsdl:message name="queryInvRequest">
>
>      <wsdl:part name="in0" type="tns1:InvWebQueryCriteria"/>
>
>   </wsdl:message>
>
>   <wsdl:message name="queryInvResponse">
>
>      <wsdl:part name="queryInvReturn" type="xsd:string"/>
>
>   </wsdl:message>
>
>   <wsdl:portType name="WebQueryFacade">
>
>      <wsdl:operation name="queryInv" parameterOrder="in0">
>
>         <wsdl:input message="impl:queryInvRequest"
> name="queryInvRequest"/>
>
>         <wsdl:output message="impl:queryInvResponse"
> name="queryInvResponse"/>
>
>      </wsdl:operation>
>
>   </wsdl:portType>
>
>   <wsdl:binding name="WebQueryFacadeSoapBinding"
> type="impl:WebQueryFacade">
>
>      <wsdlsoap:binding style="rpc"
> transport="http://schemas.xmlsoap.org/soap/http"/>
>
>      <wsdl:operation name="queryInv">
>
>         <wsdlsoap:operation soapAction=""/>
>
>         <wsdl:input name="queryInvRequest">
>
>            <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
> namespace="http://facade.query.pi"; use="encoded"/>
>
>         </wsdl:input>
>
>         <wsdl:output name="queryInvResponse">
>
>            <wsdlsoap:body
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";
> namespace="http://facade.query.pi"; use="encoded"/>
>
>         </wsdl:output>
>
>      </wsdl:operation>
>
>   </wsdl:binding>
>
>   <wsdl:service name="WebQueryFacadeService">
>
>      <wsdl:port binding="impl:WebQueryFacadeSoapBinding"
> name="WebQueryFacade">
>
>         <wsdlsoap:address
> location="http://10.1.25.64:8080/PiQueryWebModule/services/WebQueryFacade"/>
>
>
>      </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]



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

Reply via email to