Hi All

say service Calculator has 

multiply(III) mean int,int,int as usual


if u send a reqest for multiply(III) it gives null pointer exception.
this seems not acceptable  for me. it should say "no such method
multiply"

actually if u Calculator has multiply(III) and u call multiply(II) it
says right thing.

I actually found this testing a patch to send I think it is ok to
proceed with patch

Shall I open a bug??? and try to fix it if I can.

thanks for your time

Srinath




************* Here is the result on which my notice based on ****

When you run it with both multiply(II) multiply(III)
test multiply(II)
SUCSESS Got result : 18

test multiply(III)
SUCSESS Got result : 90

----------------------------------------------------------------------------------------------
**********************************************************************************
*** when I run it with only multiply(II) is avalible
************************************************************************************
test multiply(II)
SUCSESS Got result : 18

test multiply(III)
FAILEURENo such operation 'multiply'AxisFault
 faultCode: Server.userException
 faultSubcode: 
 faultString: No such operation 'multiply'
 faultActor: 
 faultNode: 
 faultDetail: 
        {http://xml.apache.org/axis/}stackTrace:AxisFault
 faultCode:
Server.userException
 faultSubcode: 
 faultString: No such
operation 'multiply'
 faultActor: 
 faultNode: 

faultDetail: 

No such operation 'multiply'
	at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:301)
	at 
org.apache.axis.message.RPCElement.getParams(RPCElement.java:347)
	at 
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:184)
	at
 org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:334)
	at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
	at
 org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
	at 
org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
	at 
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:485)
	at 
org.apache.axis.server.AxisServer.invoke(AxisServer.java:324)
	at 
org.apache.axis.transport.http.SimpleAxisWorker.execute(SimpleAxisWorker.java:435)
	at
 
org.apache.axis.transport.http.SimpleAxisWorker.run(SimpleAxisWorker.java:190)
	at
 java.lang.Thread.run(Thread.java:536)


No such operation 'multiply'
        at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
        at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
        at
org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1083)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:252)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:553)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:378)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
        at org.apache.axis.client.Call.invoke(Call.java:2553)
        at org.apache.axis.client.Call.invoke(Call.java:2248)
        at org.apache.axis.client.Call.invoke(Call.java:2171)
        at org.apache.axis.client.Call.invoke(Call.java:1691)
        at
test.deployment.OverloadedMethodRestrictionTest.testSpecifiedSimpleMethod(OverloadedMethodRestrictionTest.java:178)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)
------------------------------------------------------- quite acceptable
-------------------------------------------------------
*****************************************************************************************************
***     when I test it with service have multiply(III) only
*******************************************************************************************************
test multiply(II)
FAILEUR Ejava.lang.NullPointerExceptionAxisFault
 faultCode:
{http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode: 
 faultString: java.lang.NullPointerException
 faultActor: 
 faultNode: 
 faultDetail: 
        
{http://xml.apache.org/axis/}stackTrace:java.lang.NullPointerException
	at 
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at
 java.lang.reflect.Method.invoke(Method.java:324)
	at 
org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:402)
	at
 
org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:309)
	at
 org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:334)
	at 
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)
	at
 org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)
	at 
org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)
	at 
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:485)
	at 
org.apache.axis.server.AxisServer.invoke(AxisServer.java:324)
	at 
org.apache.axis.transport.http.SimpleAxisWorker.execute(SimpleAxisWorker.java:435)
	at
 
org.apache.axis.transport.http.SimpleAxisWorker.run(SimpleAxisWorker.java:190)
	at
 java.lang.Thread.run(Thread.java:536)

        {http://xml.apache.org/axis/}isRuntimeException:true

java.lang.NullPointerException
        at
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
        at
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
        at
org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationContextImpl.java:1083)
        at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown
Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
 Source)
        at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
        at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
        at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
        at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
        at
org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContextImpl.java:252)
        at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:553)
        at org.apache.axis.Message.getSOAPEnvelope(Message.java:378)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
        at org.apache.axis.client.Call.invoke(Call.java:2553)
        at org.apache.axis.client.Call.invoke(Call.java:2248)
        at org.apache.axis.client.Call.invoke(Call.java:2171)
        at org.apache.axis.client.Call.invoke(Call.java:1691)
        at
test.deployment.OverloadedMethodRestrictionTest.testSpecifiedSimpleMethod(OverloadedMethodRestrictionTest.java:155)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:392)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:276)
        at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:167)

test multiply(III)
SUCSESS Got result : 90

this does not seem to acceptable for me . It should say say ***No such
operation 'multiply' *** null pointer exception 
misleads you
 


**************** here is the test case I used  ********************

public void testSpecifiedSimpleMethod() throws Exception {
String port = "3333";
String endpoint ="http://10.8.101.131:"; + port +
                        "/axis/services/Calculator";

String value1 = "9";
String value2 = "2";
String value3 = "5";
Integer i1 = new Integer(value1);
Integer i2 = new Integer(value2);
Integer i3 = new Integer(value3);

Service service = new Service();
Call call1 = (Call) service.createCall();
call1.setTargetEndpointAddress(new java.net.URL(endpoint));
call1.setOperationName("multiply");
call1.addParameter("op1", XMLType.XSD_INT, ParameterMode.IN);
call1.addParameter("op2", XMLType.XSD_INT, ParameterMode.IN);
                call1.setReturnType(XMLType.XSD_INT);

Integer ret;
try {
        w.write("\ntest multiply(II)\n");
        System.out.println("\ntest add(II)");
        ret = (Integer) call1.invoke(new Object[] { i1, i2 });
        w.write("SUCSESS Got result : " + ret+"\n");
        System.out.println("SUCSESS Got result : " + ret);
        w.flush();
}catch(Exception e){
        w.write("FAILEURE" + e);
        System.out.println("FAILEURE" + e);
        e.printStackTrace(w);
        w.flush();
}
                
Call call2 = (Call) service.createCall();
call2.setTargetEndpointAddress(new java.net.URL(endpoint));
call2.setOperationName("multiply");
call2.addParameter("op1", XMLType.XSD_INT, ParameterMode.IN);
call2.addParameter("op2", XMLType.XSD_INT, ParameterMode.IN);
call2.addParameter("op3", XMLType.XSD_INT, ParameterMode.IN);
call2.setReturnType(XMLType.XSD_INT);
        
try{
w.write("\ntest multiply(III)\n");
System.out.println("\ntest add(III)");  
ret = (Integer) call2.invoke(new Object[] { i1, i2, i3 });
                                
w.write("SUCSESS Got result : " + ret+"\n");
System.out.println("SUCSESS Got result : " + ret);
w.flush();
}catch(Exception e){
        w.write("FAILEURE" + e);
        System.out.println("FAILEURE" + e);
        e.printStackTrace(w);
        w.flush();
        }
        w.close();
}


Reply via email to