You need to sign in to do that
Don't have an account?
Web Services API problem
I am trying to call Salesforce API from my Java application in NetBeans. I imported Partner wsdl into NetBeans and create web service client using appropriate wizard. Login() and logout() operations finished successfully, but when I call describeGlobal() an error occurs (SEVERE: com.sforce.soap.partner.UnexpectedErrorFault: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService). I find in Salesforce documentation that I need to set the session id in the SOAP header and specify the server URL as the target for subsequent service requests, but I do not know how to do it. Does anyone work also in NetBeans and have example/tutorial that shows solution of mentioned problem?
Yours sincerely,
Darko Androcec
You can find whole code related to this in the Email to Case application. Following is the link for the same.
http://wiki.developerforce.com/page/Members:Email_To_Case
Its a open source application, you can download its code.
If you want I can help you with the JAX-WS code also.
All Answers
Does following code helps?
A variable binding is instance of which class? I have found similar code at http://boards.developerforce.com/t5/Java-Development/Problem-Calling-Apex-WebService-from-Java/td-p/206637.
SoapBindingStub does not exist in com.sforce.soap.enterprise.* when I generate Java web client classes from enterprise.wsdl using Netbeans, so I can not solve my problem using this code. Or am I doing something wrong?
Its a instance of "SoapBindingStub".
Let me know if you still find it difficult to understand, I can point you to some more inforamtion.
When I create JAX-WS web service client from enterprise.wsdl in my environment, "SoapBindingStub" class simply does not exist, so please point me to some more information...
You can find whole code related to this in the Email to Case application. Following is the link for the same.
http://wiki.developerforce.com/page/Members:Email_To_Case
Its a open source application, you can download its code.
If you want I can help you with the JAX-WS code also.
This example helped me to solve my problem. I finally managed to connect and call wanted API operations, I give up JAX-WS and instead use The Force.com Web Services Connector (WSC) as in the example. If someone will deal with a similar problem, the following link is also very useful: http://wiki.developerforce.com/page/Introduction_to_the_Force.com_Web_Services_Connector.
Thank you,
Darko