You need to sign in to do that
Don't have an account?
EclipseTalk
Sample client implementation for Axis 2
Hello,
i'm surprised to see that there is no sample client implementation based on AXis2. Has someone already ported the login sample to axis2 ? Thank you for sharing
Add Java and Axis home to your environment path, for example:
then, create a directory to place your datas. In this directory I make a subdirectory to put my WSDL. Then you can launch this command:
where:
- "wsdl/enterprise.wsdl" is the relative path to my wsdl
- "com.salesforce.webservice" is the package you want to assign to you generated classes
- "generated/Salesforce" is the relative subdirectory of my generated classes
In my example, a Salesforce subdirectory is created in the "generated" directory. This subdirectory contains:
- [src] that contains your generated classes
- [resources] that contains ressources to connect to salesforce
- [test] that contains test classes, but not important in our case
zip the content of resources (not the directory itself) into a resources.jar file.
Compile the classes contained in src in a directory, and zip the content of this directory in a file named salesforce.jar (for example).
Then, you have to integrate resources.jar, salesforce.jar and Axis2 librairies to your classpath. For that, everyone has his method, for my part I use Eclipse (to generated salesforce.jar too).
And there is my implementation:
This is the constructor of my Salesforece Session object:
and my query method
same for insert:
update:
Delete:
As you can see, each method is quite the same. Hope it helped you.
All Answers
I'm not aware of any axis2 sample code out there. Axis 1 is really really old, and I couldn't figure out how to get Axis 2 to do what I needed, so I chose to use JAX-WS instead. That's worked out fine for me. I have a tutorial showing how to use JAX-WS: http://eng.genius.com/blog/2009/05/23/salesforcecom-partner-soap-api-jax-ws-tutorial-part-1/
If you're in a position to change your soap toolkit, give JAX-WS a try.
Thanks, yes I'm aware of this tutorial this is a great help.
However there must be somewhere a sample based on Axis 2. I can't believe the sample client hasn't been ported to Axis 2. Can anyone comment on that?
Thanks in advance
I did a sample a while back, but the programming model for axis2 kept changing, so its unlikely that it still works
http://www.pocketsoap.com/weblog/2006/05/1623.html
Add Java and Axis home to your environment path, for example:
then, create a directory to place your datas. In this directory I make a subdirectory to put my WSDL. Then you can launch this command:
where:
- "wsdl/enterprise.wsdl" is the relative path to my wsdl
- "com.salesforce.webservice" is the package you want to assign to you generated classes
- "generated/Salesforce" is the relative subdirectory of my generated classes
In my example, a Salesforce subdirectory is created in the "generated" directory. This subdirectory contains:
- [src] that contains your generated classes
- [resources] that contains ressources to connect to salesforce
- [test] that contains test classes, but not important in our case
zip the content of resources (not the directory itself) into a resources.jar file.
Compile the classes contained in src in a directory, and zip the content of this directory in a file named salesforce.jar (for example).
Then, you have to integrate resources.jar, salesforce.jar and Axis2 librairies to your classpath. For that, everyone has his method, for my part I use Eclipse (to generated salesforce.jar too).
And there is my implementation:
This is the constructor of my Salesforece Session object:
and my query method
same for insert:
update:
Delete:
As you can see, each method is quite the same. Hope it helped you.
Thanks Climbatize, great post!!! it was very helpful getting me started.
I think it's important to note that the default databinding in ecplise for Axis2 is ADB, which produces very succinct code but does not provide interfaces for the Objects (Account, Contact, etc) the only object you get is SObject.
Which might be why you used the xmlbeams databinding???