You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Domingos Antonio Pereira Creado Júnior <cr...@cpqd.com.br> on 2006/06/26 21:24:13 UTC

[Axis2 tutorial] Nullpointer in Stub

Hi There,

I´m following the Axis2 user tutorial, and I´m stuck in WS client from the WSDL service.
I´m getting the following error:

java.lang.RuntimeException: java.lang.NullPointerException
	at org.apache.axis2.Axis2SampleDocLitServiceStub.fromOM(Axis2SampleDocLitServiceStub.java:2224)
	at org.apache.axis2.Axis2SampleDocLitServiceStub.echoString(Axis2SampleDocLitServiceStub.java:489)
	at userguide.clients.EchoNonBlockingClient.main(EchoNonBlockingClient.java:39)
Caused by: java.lang.NullPointerException
	at org.apache.axis2.Axis2SampleDocLitServiceStub.fromOM(Axis2SampleDocLitServiceStub.java:2216)
	... 2 more

I´ve debugged and found that the method getElement(_returnEnv,"rpc") is returning null, at the following method code


    public org.apache.axis2.Axis2SampleDocLitServiceStub.EchoStringReturn echoString(
                    org.apache.axis2.Axis2SampleDocLitServiceStub.EchoStringParam param10)
                    throws java.rmi.RemoteException                
    {
    .....
    _operationClient.execute(true);
    org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(
                                       org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
    java.lang.Object object = fromOM(getElement(_returnEnv,"rpc"),
                                     org.apache.axis2.Axis2SampleDocLitServiceStub.EchoStringReturn.class,
                                     getEnvelopeNamespaces(_returnEnv));
    _messageContext.getTransportOut().getSender().cleanup(_messageContext);
    return (org.apache.axis2.Axis2SampleDocLitServiceStub.EchoStringReturn)object;


The SOAP message from server is like (_returnEnv value):
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header /><soapenv:Body><echoStringReturn xmlns="http://userguide.axis2.apache.org/xsd">teste</echoStringReturn></soapenv:Body></soapenv:Envelope>

Thanks in advance


Msc. Domingos Creado 
DSB - Diretoria de Soluções em Billing 
CPqD Telecom & IT Solutions 
Tel.: +55 19 3705-6423 / Fax: +55 19 3705-7268 
Cel.: +55 19 9605-2382 
creado@cpqd.com.br 
www.cpqd.com.br 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


Re: [Axis2 tutorial] Nullpointer in Stub

Posted by Ali Sadik Kumlali <as...@yahoo.com>.
Hi Domingos,
 
Dims made some changes[1] on the WSDL of Axis2SampleDocLitService 2 days ago. That might fix your issue.  
 
Regards,
 
Ali Sadik Kumlali
 
[1] http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/samples/wsdl/Axis2SampleDocLit.wsdl?view=log ?

----- Original Message ----
From: Domingos Antonio Pereira Creado Júnior <cr...@cpqd.com.br>
To: axis-user@ws.apache.org
Sent: Monday, June 26, 2006 10:24:13 PM
Subject: [Axis2 tutorial] Nullpointer in Stub


Hi There,

I´m following the Axis2 user tutorial, and I´m stuck in WS client from the WSDL service.
I´m getting the following error:

java.lang.RuntimeException: java.lang.NullPointerException
    at org.apache.axis2.Axis2SampleDocLitServiceStub.fromOM(Axis2SampleDocLitServiceStub.java:2224)
    at org.apache.axis2.Axis2SampleDocLitServiceStub.echoString(Axis2SampleDocLitServiceStub.java:489)
    at userguide.clients.EchoNonBlockingClient.main(EchoNonBlockingClient.java:39)
Caused by: java.lang.NullPointerException
    at org.apache.axis2.Axis2SampleDocLitServiceStub.fromOM(Axis2SampleDocLitServiceStub.java:2216)
    ... 2 more

I´ve debugged and found that the method getElement(_returnEnv,"rpc") is returning null, at the following method code


    public org.apache.axis2.Axis2SampleDocLitServiceStub.EchoStringReturn echoString(
                    org.apache.axis2.Axis2SampleDocLitServiceStub.EchoStringParam param10)
                    throws java.rmi.RemoteException                
    {
    .....
    _operationClient.execute(true);
    org.apache.axis2.context.MessageContext _returnMessageContext = _operationClient.getMessageContext(
                                       org.apache.axis2.wsdl.WSDLConstants.MESSAGE_LABEL_IN_VALUE);
    org.apache.axiom.soap.SOAPEnvelope _returnEnv = _returnMessageContext.getEnvelope();
    java.lang.Object object = fromOM(getElement(_returnEnv,"rpc"),
                                     org.apache.axis2.Axis2SampleDocLitServiceStub.EchoStringReturn.class,
                                     getEnvelopeNamespaces(_returnEnv));
    _messageContext.getTransportOut().getSender().cleanup(_messageContext);
    return (org.apache.axis2.Axis2SampleDocLitServiceStub.EchoStringReturn)object;


The SOAP message from server is like (_returnEnv value):
<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header /><soapenv:Body><echoStringReturn xmlns="http://userguide.axis2.apache.org/xsd">teste</echoStringReturn></soapenv:Body></soapenv:Envelope>

Thanks in advance


Msc. Domingos Creado 
DSB - Diretoria de Soluções em Billing 
CPqD Telecom & IT Solutions 
Tel.: +55 19 3705-6423 / Fax: +55 19 3705-7268 
Cel.: +55 19 9605-2382 
creado@cpqd.com.br 
www.cpqd.com.br 


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org