Update: I now understand the problem. Instead of passing an empty
configuration context, I should have passed null.
Now I am facing a different problem. I'm receiving the following error
when trying to invoke a web service more than once:
org.apache.axis2.AxisFault: Two services can not have same name, a
service with ItemsGroupService already exists in the system
at
org.apache.axis2.client.ServiceClient.configureServiceClient(ServiceClie
nt.java:130)
at
org.apache.axis2.client.ServiceClient.<init>(ServiceClient.java:174)
at
com.sabratec.applinx.server.core.extws.GXProcedureExternalWS.execute(GXP
rocedureExternalWS.java:212)
at
com.sabratec.applinx.server.core.GXProcedure.execute(GXProcedure.java:83
)
at
com.sabratec.applinx.server.runtime.servlet.GXAbstractExecuteWebService.
service(GXAbstractExecuteWebService.java:170)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applica
tionFilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilt
erChain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValv
e.java:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValv
e.java:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java
:126)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java
:105)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.
java:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:1
48)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:86
9)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint
.java:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollow
erWorkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool
.java:684)
at java.lang.Thread.run(Thread.java:534)
Any ideas?
Thanks,
Shahar Kedar
________________________________
From: Kedar, Shahar [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 16, 2006 11:58 AM
To: [email protected]
Subject: [Axis2] Transport out return null
Hi,
I tried to invoke a web service using my Axis2 ServiceClient API, and I
kept getting a null pointer.
So I decided to debug the source code and I found out that the
transportsOut HashMap in the AxisConfiguration class is empty. This
means that Axis2 could not really infer the transport out from the URL.
This is the client side code I've written:
String inputXml = serializeElement(input, procedure);
OMElement payload = createPayload(inputXml);
Options options = new Options();
options.setExceptionToBeThrownOnSOAPFault(true);
options.setTo(new
EndpointReference(procedure.getExternalWsServiceUrl()));
try {
ServiceClient client = new
ServiceClient(ConfigurationContextFactory.createEmptyConfigurationContex
t(),new URL(procedure.getExternalWsServiceWsdlUrl()),new
QName(procedure.getExternalWebServiceNamespace(),
procedure.getExternalWsServiceName()),
procedure.getExternalWsServicePortName());
client.setOptions(options);
OMElement response = client.sendReceive(new
QName(procedure.getExternalWebServiceNamespace(), procedure.getName()),
payload);
} catch (Exception ex) {
ex.printStackTrace();
}
I'm not sure if this is a bug or simply a misusage of the API.
Thanks,
Shahar Kedar