Hi Kedar; Can you please post me your client code then I can have a look at that.
Thanks Deepal > Hi Deepal, > > Your solution solved my first problem, but not the second one. This > means that after the change I still got the following error: > > Two services can not have same name, a service with ItemsGroupService > already exists in the system. > > To solve this problem I'm using a HashMap to store any ServiceClient I > create for a certain AxisService. Is there a more elegant solution? > > Thanks, > > Shahar Kedar > > -----Original Message----- > From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] > Sent: Thursday, November 16, 2006 12:21 PM > To: [email protected] > Subject: Re: FW: [Axis2] Transport out return null > > Try to use the following; > > ServiceClient client = *new* ServiceClient(null,*new* > > URL(procedure.getExternalWsServiceWsdlUrl()),*new* > > QName(procedure.getExternalWebServiceNamespace(), > > procedure.getExternalWsServiceName()), > > procedure.getExternalWsServicePortName()); > > Thanks > > Deepal > > Kedar, Shahar wrote: > >> 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(_ServiceClient.java:130_) > >> > >> at org.apache.axis2.client.ServiceClient.<init>(_ServiceClient.java:174_) > >> > >> at > >> com.sabratec.applinx.server.core.extws.GXProcedureExternalWS.execute(_GXProcedureExternalWS.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(_ApplicationFilterChain.java:252_) > >> > >> at > >> org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFilterChain.java:173_) > >> > >> at > >> org.apache.catalina.core.StandardWrapperValve.invoke(_StandardWrapperValve.java:213_) > >> > >> at > >> org.apache.catalina.core.StandardContextValve.invoke(_StandardContextValve.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:148_) > >> > >> at > >> org.apache.coyote.http11.Http11Processor.process(_Http11Processor.java:869_) > >> > >> at > >> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(_Http11BaseProtocol.java:664_) > >> > >> at > >> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(_PoolTcpEndpoint.java:527_) > >> > >> at > >> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(_LeaderFollowerWorkerThread.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./createEmptyConfigurationContext/(),*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 > >> > > -- > > Thanks, > > Deepal > > ................................................................ > > "The highest tower is built one brick at a time" > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > -- Thanks, Deepal ................................................................ "The highest tower is built one brick at a time" --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
