You need to sign in to do that
Don't have an account?
Need Help on the URL
folks
I created an developer account, then generated WSDL file and placed this WSDL file in my local environment and generated stubs based on this , Now I wrote an client which takes in the username and password , the same which i use to log in to the developer edition, Here is the code
try{
binding = (SoapBindingStub)
new SforceServiceLocator().getSoap();
}catch(Exception ex){
System.out.println("exception occurred" + ex.toString());
}
System.out.println("binding :" + binding);
binding.setTimeout(60000);
loginResult = binding.login(uName,pwd);
System.out.println("loginResult =" + loginResult.getServerUrl());
when i try to get the Server URL i am getting
https://na1-api.salesforce.com/services/Soap/c/4.0 which is correct by the standards then,
binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY,
loginResult.getServerUrl());
_SessionHeader sh = new _SessionHeader();
sh.setSessionId(loginResult.getSessionId());
// now i am trying to get the objects ..
DescribeGlobalResult globalObjects = binding.describeGlobal();
if (! (globalObjects == null)) {
// Get the array of object names from the result
String[] types = globalObjects.getTypes();
if (!(types == null)){
for (int i = 0; i < types.length; i++) {
System.out.println("Objects supported ::" + (types[i]));
}
}
but i am not able to print the objects,
I appreciate if any one knows how to get the objects that would be really greatful...
thanks & regards
gnanesh
_SessionHeader sh = new _SessionHeader();
sh.setSessionId(loginResult.getSessionId());
binding.setHeader(new SforceServiceLocator().getServiceName().getNamespaceURI(), "SessionHeader", sh);
see http://www.sforce.com/us/docs/sforce40/sforce_API_calls_login.html#wp1442825 for an exmaple.
Sorry i missed out that code while posting my question..Yes i do have the below code to set to the header.
binding.setHeader(new
SforceServiceLocator().getServiceName().getNamespaceURI(),
"SessionHeader", sh);
Let me know about it,
Regards
Gnanesh
Hi gowda,
So, what are you getting? Can you set a breakpoint and inspect the DescribeGlobalResult? Can you capture your soap messages?