Hello Thushantha,

use ServiceClient instead of the deprecated
MessageSender the following way:

EndpointReference endpoint = new
EndpointReference("http://...";);
Options ops = new Options();
op.setTo(endpoint);
op.setTransportInProtocol(org.apache.axis2.Constants.TRANSPORT_HTTP);
op.setUseSeparateListener(false);
ServiceClient sc = new ServiceClient();
sc.setOptions(ops);


--
Ted



--- Thushantha De Alwis <[EMAIL PROTECTED]> schrieb:

> Hi All
> 
> I have successfully deployed a WebService called
> "Echo"
> 
> So I want to invoke that web service. For that I
> tried to write a client.
> When writing it I used the following code
> sample got from 0.93 release.
> 
> try{
>  EndpointReference targetEPR =3D new
> EndpointReference(
>     
>
"http://localhost:8080/axis2/services/StockQuoteService";);
> 
>  // Make the request message
>  OMFactory fac =3D OMAbstractFactory.getOMFactory();
>  OMNamespace omNs =3D fac.createOMNamespace(
>      "http://www.developerworks.com/example";,
> "example");
>  OMElement payload =3D
> fac.createOMElement("subscribe", omNs);
>  payload.setText("IBM");
> 
>  // Send the request
>  MessageSender msgSender =3D new MessageSender();
>  msgSender.setTo(targetEPR);
> 
>
msgSender.setSenderTransport(Constants.TRANSPORT_HTTP);
>  msgSender.send("subscribe", payload);
>  }catch (AxisFault axisFault) {
>      axisFault.printStackTrace();
>  }
> 
> 
> 
> But Messagesender was depricated.
> 
> Is there any other way to write a client to invike
> the service. I went
> through 0.94 release document also. If some
> one have very simple code for cient to invike a
> service please send me.
> 
> Best Regards
> Thushantha
> 
> 



        

        
                
___________________________________________________________ 
Telefonate ohne weitere Kosten vom PC zum PC: http://messenger.yahoo.de

Reply via email to