You need to sign in to do that
Don't have an account?
Webservice from java newbie questions
Hello,
I am new to Webservices and soap. I have been trying to call a webservice from java but everything I try does not seem to work. This is the class I am trying to call from java.
global class DNAForceWS { webservice static Boolean test() { return true; } }
1) When I want to update Objects such as the Account object, I create a WSDL for the enterprise API, then I use WSC for api to generate the class. But, it seems the the webservice class is not present at all in this WSDL. I need to click on the link next to the class to generate a WSDL specific for this class. Then I can use any of multiple tools to build the classes from it, AXIS1.4, AXIS2, JAX-WS, WSC. Is this correct? Can I use the WSC to generate the class?
2) I have used the WSC connector to create two jar files. The first file was created by consuming the enterprise wsdl. The second jar file was created by consuming the webservice wsdl file. Upon inspecting the objects I get an entepriseconnection object and a soapconenction object. The EnterpriseConnection object is able to log into salesforce, update, insert, query and delete objects, but cannot call a webservice. However, the SoapConnection object does have a method to call the webservice. I cannot connect a soapconnection object. Here is the code I have:
How can I initialize the SoapConnection so that it is ready for business?
To initialize the SoapConnection, I have tried
However, I get this error:
Well, that was more painfull than it should have been but I finaly got it working. In case anyone is interested and for future reference, this is the code that works.
The key was to use the connector object present in the class definition of the webservice, not the connector produced by the enterprise wsdl.
==Also it seems it will only work if I set the headers to a previously connection enterprisewsdl connection. So WTF...?