You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Maicon Stihler <st...@gmail.com> on 2007/11/30 17:22:49 UTC

[Axis2] Calling a service from another service

Hi,

I'm trying to create a service that calls another service, I followed
the tutorial on
http://ws.apache.org/axis2/1_3/userguide-buildingservices.html#createscratch
but it doesn't work. Everything works fine if I'm calling the service
form a client application, but when I try to make a service to act
like a client I got some errors.

The code is as follows (try/catch ommited):

    private OMElement publish(OMElement msg) throws Exception {
            EndpointReference EventBoxEPR =
                new EndpointReference(
                    "http://localhost:8080/axis2/services/EventBox");

            Options options = new Options();
            options.setTo(EventBoxEPR);
            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
            ServiceClient sender = new ServiceClient();
            sender.setOptions(options);
            OMElement rq = makeRequest(msg);
            sender.sendReceive(rq); // here it fails
            return msg;
   ------------

The error says something about WS-Addressing. If I call the service
(http://localhost:8080/axis2/services/EventBox) from a command line
client, it works fine.

So how is the right way to call a service from another service?

Best regards,
Maicon

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org