Try this....

      ConfigurationContext ctx =
ConfigurationContextFactory.createConfigurationContextFromFileSystem("C:
/work/AXIS2-Examples/for-client-testing/repository",
"C:/work/AXIS2-Examples/for-client-testing/axis2.xml");
      ServiceClient sc = new ServiceClient(ctx, null);
      Options opt = new Options();
      opt.setTo(new
EndpointReference("http://localhost:8080/axis2/services/XSDJAXBService";)
);
      opt.setTransportInProtocol( Constants.TRANSPORT_HTTP );
      opt.setAction("ServiceMethod");
      sc.engageModule( new QName( Constants.MODULE_ADDRESSING ) );
      sc.setOptions(opt);
      
      OMElement payload = getPayload();
      OMElement ol = sc.sendReceive( payloadRoot ); 


-----Original Message-----
From: footh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 16, 2007 3:07 PM
To: [email protected]
Subject: [Axis2] Simple stand-alone client to invoke web services

I have a separate java web application running under Tomcat 5.5 in which
I want to dynamically invoke web services using Axis2.

I was able to easily do this using Axis1, but I am running into a
problem with Axis2.  I've followed the simple examples in the
documentation with creating a ServiceClient object and then sending a
payload.

However, I am having trouble with the ServiceClient object.  I was
creating it with the default constructor, but that doesn't work without
the default axis2.xml file and repository.

So, I looked into creating my own
ContextConfiguration, but I can't seem to find any way of doing it
dynamically.  Do I have to point to a separate file every time
(axis2.xml) or can I create the configuration in code alone?  Can anyone
point me to examples of how this might be done?


 
________________________________________________________________________
____________
Food fight? Enjoy some healthy debate
in the Yahoo! Answers Food & Drink Q&A.
http://answers.yahoo.com/dir/?link=list&sid=396545367

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

NOTICE: If received in error, please destroy and notify sender. Sender does not 
intend to waive confidentiality or privilege. Use of this email is prohibited 
when received in error.

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

Reply via email to