Now I’ve changed my code turning it similar to the Tungsten SimpleTrader client.

 

The code now is:

 

--------------------------------

 

      ConfigurationContext configurationContext = null;

      EndpointReference targetEPR = new EndpointReference(

          "http://localhost:9762/axis2/services/calculator2");

      String repo =

          "C:\\tungsten-1.0-beta\\tungsten-1.0-beta\\repository\\services";

      String axis2_xml =

          "C:\\tungsten-1.0-beta\\tungsten-1.0-beta\\conf\\axis2.xml";

 

      configurationContext = ConfigurationContextFactory.

          createConfigurationContextFromFileSystem(repo, axis2_xml);

 

      ServiceClient sender = new ServiceClient(configurationContext,new AxisService("calculator2"));

 

      sender.getOptions().setTo(targetEPR);

 

      sender.engageModule(new QName("sandesha2"));

      Options options = new Options();

      options.setTo(targetEPR);

      options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

 

      sender.setOptions(options);

     

      OMElement payload = ClientUtil.getCalculator2OMElement();

      OMElement result = sender.sendReceive(payload);

 

      StringWriter writer = new StringWriter();

      result.serialize(XMLOutputFactory.newInstance()

                       .createXMLStreamWriter(writer));

      writer.flush();

 

      System.out.println(writer.toString());

 

--------------------------------

 

And I always get:

 

org.apache.axis2.AxisFault: Module not found

            at org.apache.axis2.description.AxisService.engageModule(AxisService.java:295)

            at org.apache.axis2.client.ServiceClient.engageModule(ServiceClient.java:284)

            at calculator2.EchoBlockingClient.main(EchoBlockingClient.java:61)

 

The error is when he is engaging the modules but I really don’t know what’s happening here since I have sandesha2.mar in \repository\modules.

 

This is really strange and I’m getting out of ideas :(

 

Cheers,

Nuno

 

 


From: Paul Fremantle [mailto:[EMAIL PROTECTED]
Sent: quinta-feira, 13 de Abril de 2006 20:02
To: confusionvalley
Cc: [email protected]
Subject: Re: Sandesha2 Client

 

Hi

If your Axis2 client is working (without RM) then you should simply need to add:

serviceClient.engageModule("Sandesha2");

I *think* you can now have the Sandesha2.mar file just in the classpath. If that doesn't work then you need to have a repository and set AXIS2_REPOSITORY there.

Paul

PS you could also look at the samples in the Tungsten package which does this.

On 4/13/06, confusionvalley < [EMAIL PROTECTED]> wrote:


Hello all,

I'm developing a client to use with Axis 2 and Sandesha 2.
In the server side the Sandesha 2 module is engaged and running.
To test the service i'm creating a very simple client but your "user guide" seems to be very poor to develop a client.
Can you give me a better guide to develop sandesha clients?
Do I need an Axis2.xml for the client? I need to do a repo for the client with the sandesha modules? Where the .class files will be then?
I can't understand very well how we can use Sandesha 2. I worked with Sandesha 1 and it was very simple to use...


This is the code i'm using just to use axis2 *without* sandesha:

---------------------------------------------------------

            OMElement payload = ClientUtil.getCalculator2OMElement();
            Options options = new Options();
            options.setTo(targetEPR);
            options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

            //Blocking invocation


            ServiceClient sender = new ServiceClient();

            sender.setOptions(options);

            OMElement result = sender.sendReceive(payload);

            StringWriter writer = new StringWriter();

            result.serialize(XMLOutputFactory.newInstance ()
                    .createXMLStreamWriter(writer));
            writer.flush();


            System.out.println(writer.toString());

---------------------------------------------------------

Can you give me some help with this code and the module engaging in the client?

Best regards,
Nuno

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
Paul Fremantle
VP/Technology, WSO2 and OASIS WS-RX TC Co-chair

http://bloglines.com/blog/paulfremantle
[EMAIL PROTECTED]

"Oxygenating the Web Service Platform", www.wso2.com

Reply via email to