Re: [Axis2] Simple stand-alone client to invoke web services
Paul, thanks for the reply. You are correct. I was actually missing libraries and I mistakenly assummed it had to do with the axis configuration files. I was able to just instantiate a ServiceClient and invoke a service without a problem. Best regards, JF --- Paul Fremantle <[EMAIL PROTECTED]> wrote: > Footh > > Can you please give more details when you say the > default constructor > doesn't work? > > ServiceClient sc = new ServiceClient(); > > should work fine without an external repository or > axis2.xml. Also if > you need modules like addressing in a simple client > like this you can > just put the .mar file in the classpath. > > Paul > > On 1/16/07, footh <[EMAIL PROTECTED]> wrote: > > Thanks for the reply. > > > > I already have something very similar to that. I > was > > hoping, however, to avoid having to use external > files > > to create the configuration. > > > > But, I can concede on that if it is absolutely > > necessary. However, do I need to use the > axis2.xml > > file that comes with Axis2? It seems to have a > bunch > > of parameters that I am not interested in. In > fact, > > I'm not even sure what parameters I need if I want > to > > simply invoke and request-response service over > HTTP. > > > > Additionally, do I need to have the repository > > directory? I notice that the addressing module is > in > > there, but can I just stick that with the rest of > the > > .jar files? > > --- "Yadav, Yogendra (IT)" > > <[EMAIL PROTECTED]> wrote: > > > > > 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: axis-user@ws.apache.org > > > 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] > > > > > > > > > > > > > > > > > > > Sucker-punch spam with award-winning protection. > > Try the free Yahoo! Mail Beta. > > > http://advision.webevents.yahoo.com/mailbeta/features_spam.html > > > > > - > > To unsubscribe, e-mail: > [EMAIL PROTECTED] > > For additional commands, e-mail: > [
Re: [Axis2] Simple stand-alone client to invoke web services
Footh Can you please give more details when you say the default constructor doesn't work? ServiceClient sc = new ServiceClient(); should work fine without an external repository or axis2.xml. Also if you need modules like addressing in a simple client like this you can just put the .mar file in the classpath. Paul On 1/16/07, footh <[EMAIL PROTECTED]> wrote: Thanks for the reply. I already have something very similar to that. I was hoping, however, to avoid having to use external files to create the configuration. But, I can concede on that if it is absolutely necessary. However, do I need to use the axis2.xml file that comes with Axis2? It seems to have a bunch of parameters that I am not interested in. In fact, I'm not even sure what parameters I need if I want to simply invoke and request-response service over HTTP. Additionally, do I need to have the repository directory? I notice that the addressing module is in there, but can I just stick that with the rest of the .jar files? --- "Yadav, Yogendra (IT)" <[EMAIL PROTECTED]> wrote: > 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: axis-user@ws.apache.org > 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] > > Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html - 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 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Axis2] Simple stand-alone client to invoke web services
Thanks for the reply. I already have something very similar to that. I was hoping, however, to avoid having to use external files to create the configuration. But, I can concede on that if it is absolutely necessary. However, do I need to use the axis2.xml file that comes with Axis2? It seems to have a bunch of parameters that I am not interested in. In fact, I'm not even sure what parameters I need if I want to simply invoke and request-response service over HTTP. Additionally, do I need to have the repository directory? I notice that the addressing module is in there, but can I just stick that with the rest of the .jar files? --- "Yadav, Yogendra (IT)" <[EMAIL PROTECTED]> wrote: > 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: axis-user@ws.apache.org > 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] > > Sucker-punch spam with award-winning protection. Try the free Yahoo! Mail Beta. http://advision.webevents.yahoo.com/mailbeta/features_spam.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: [Axis2] Simple stand-alone client to invoke web services
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: axis-user@ws.apache.org 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]