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 Gross Julia <ju...@kapsch.net> on 2006/05/04 15:25:57 UTC

WS invocation over java transport issue

Hi all,

I'm trying to understand how java transport works.
Till now I couldn't quite figure it out. Does anybody know if this
transport is supported, how to use it,
and if there are any samples/documentation concerning this issue?

I'm trying to invoke the stock service that runs on axis 1.3, tomcat
5.x. But I get a NullPointerException...
Could anybody please help me to understand where is the problem? 

Here is my client-config.wsdd

<deployment xmlns="http://xml.apache.org/axis/wsdd"
            xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"
         <transport name="java"
pivot="java:org.apache.axis.transport.java.JavaSender"/>
</deployment>

Here is my java client code:
String symbol = "XXX";
		Service  service = new Service(new
XMLStringProvider(wsdd));
		
        Call     call    = (Call) service.createCall();
        Call.setTransportForProtocol("java", JavaTransport.class);
        
 
call.setTargetEndpointAddress("java:///urn:xmltoday-delayed-quotes");
        call.setOperationName( new QName("urn:xmltoday-delayed-quotes",
"getQuote") );
        call.addParameter( "symbol", XMLType.XSD_STRING,
ParameterMode.IN );
        call.setReturnType( XMLType.XSD_FLOAT );
        call.setTransport( new JavaTransport() );
        
        Float res = new Float(0.0F);
        res = (Float) call.invoke( new Object[] {symbol} );

And here is the exception I get:

java.lang.NullPointerException
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:216)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at
kcc.axis.test.client.JavaStockClient.main(JavaStockClient.java:41)
Caused by: java.lang.NullPointerException
        at
org.apache.axis.transport.java.JavaSender.invoke(JavaSender.java:46)
        at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrateg
y.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        ... 6 more

I guess, the service url is of wrong format. I use:
java:///urn:xmltoday-delayed-quotes
Does anybody know what URL format is expected to address a web service
over java transport?

Thanks a lot in advance!

Julia


The information contained in this e-mail message is privileged and
confidential and is for the exclusive use of the addressee. The person
who receives this message and who is not the addressee, one of his
employees or an agent entitled to hand it over to the addressee, is
informed that he may not use, disclose or reproduce the contents thereof.