Hi,
I am trying to write some unit tests using local transport but I get the
following error:
Couldnt find an appropriate operation for XML QName {0}
at
org.apache.axis.providers.java.MsgProvider.processMessage(MsgProvider.java:1
08)
at
org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:276)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:126)
at
org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:437)
at org.apache.axis.server.AxisServer.invoke(AxisServer.java:316)
at
org.apache.axis.transport.local.LocalSender.invoke(LocalSender.java:161)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:
71)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:156)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:126)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:182)
at org.apache.axis.client.Call.invokeEngine(Call.java:2113)
at org.apache.axis.client.Call.invoke(Call.java:2102)
at org.apache.axis.client.Call.invoke(Call.java:1373)
at
si.hermes.bc.ota4j.service.MessageDispatcherAxisSOAPTest.testSessionCreateRQ
(MessageDispa
tcherAxisSOAPTest.java:203)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at
si.hermes.bc.ota4j.service.MessageDispatcherAxisSOAPTest.main(MessageDispatc
herAxisSOAPTe
st.java:278)
This is my code. I have no problems if I start my service in Tomcat and
use HTTPTransport. The problem seems to be that when MessageContext
arrives to MSGProvider, the operation is not defined:
OperationDesc operation = msgContext.getOperation();
if (operation == null) {
throw new AxisFault(Messages.getMessage("noOperationForQName",
reqEnv.getFirstBody().
getQName().toString()));
}
so it seems that the handler that should resolve the operation name (my
service
just has exposes one method) does not do it. Could somebody throw some light
over
this issue? Where is the operation to be called resolved?
This is my code:
//SERVER SIDE
SOAPService service = new SOAPService(new MsgProvider());
service.setOption("className", SERVICE_CLASS_NAME);
service.setOption("allowedMethods", "entryPoint");
SimpleProvider provider = new SimpleProvider();
provider.deployService(new QName(null, SERVICE_NAME),
service);
engine = new AxisServer(provider);
transport = new LocalTransport(engine);
transport.setRemoteService(SERVICE_NAME);
//CLIENT SIDE
//I create the whole envelope
SOAPEnvelope rqEnvelope = ......
Call call = new Call(new Service());
call.setTransport(transport);
call.setOperationName(MAIN_METHOD_NAME);
call.setOperationStyle(Style.DOCUMENT_STR);
call.invoke(rqEnvelope);
Thanks for any help.