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(_ServiceCli
ent.java:130_)

> 

> at
org.apache.axis2.client.ServiceClient.<init>(_ServiceClient.java:174_)

> 

> at

>
com.sabratec.applinx.server.core.extws.GXProcedureExternalWS.execute(_GX
ProcedureExternalWS.java:212_)

> 

> at

>
com.sabratec.applinx.server.core.GXProcedure.execute(_GXProcedure.java:8
3_)

> 

> 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(_Applic
ationFilterChain.java:252_)

> 

> at

>
org.apache.catalina.core.ApplicationFilterChain.doFilter(_ApplicationFil
terChain.java:173_)

> 

> at

>
org.apache.catalina.core.StandardWrapperValve.invoke(_StandardWrapperVal
ve.java:213_)

> 

> at

>
org.apache.catalina.core.StandardContextValve.invoke(_StandardContextVal
ve.java:178_)

> 

> at

>
org.apache.catalina.core.StandardHostValve.invoke(_StandardHostValve.jav
a:126_)

> 

> at

>
org.apache.catalina.valves.ErrorReportValve.invoke(_ErrorReportValve.jav
a: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:8
69_)

> 

> at

>
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proc
essConnection(_Http11BaseProtocol.java:664_)

> 

> at

>
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(_PoolTcpEndpoin
t.java:527_)

> 

> at

>
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(_LeaderFollo
werWorkerThread.java:80_)

> 

> at

>
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(_ThreadPoo
l.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./createEmptyConfigurationConte
xt/(),*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]

 

Reply via email to