+ Start a Discussion
stephen_m_woodstephen_m_wood 

GetInfoResult licenseType error

Hi guys,

For some reason I'm getting a
Invalid element in com.sforce.soap.partner.GetUserInfoResult - licenseType

stack trace:
INFO   | jvm 1    | 2007/08/30 12:55:10 | org.xml.sax.SAXException: Invalid element in com.sforce.soap.partner.GetUserInfoResult - licenseType
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.encoding.ser.BeanDeserializer.onStartChild(BeanDeserializer.java:258)
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.client.Call.invoke(Call.java:2467)
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.client.Call.invoke(Call.java:2366)
INFO | jvm 1 | 2007/08/30 12:55:10 | at org.apache.axis.client.Call.invoke(Call.java:1812)
INFO | jvm 1 | 2007/08/30 12:55:10 | at com.sforce.soap.partner.SoapBindingStub.getUserInfo(SoapBindingStub.java:3143)
When I try to login to salesforce through the API.

I'm using Axis 1.4, I've regenerated the Partner WSDL code using WSDL2Java and I'm logging in as follows:

try
{
    binding = (SoapBindingStub)new SforceServiceLocator().getSoap();
}
catch (ServiceException ex1)
{
    System.out.println(ex1.getMessage());
    ex1.printStackTrace();
    return null;
}

try
{
    binding = (SoapBindingStub)new SforceServiceLocator().getSoap(new URL(url));
    binding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, url);
}
catch (MalformedURLException ex)
{
    System.out.println(ex.getMessage() + "\n\n");
    ex.printStackTrace();
    return null;
}
catch (ServiceException ex)
{
    System.out.println(ex.getMessage() + "\n\n");
    ex.printStackTrace();
    return null;
}

//create a session head object
SessionHeader sh = new SessionHeader();

sh.setSessionId(sessionID);
           
MruHeader mru = new MruHeader();
mru.setUpdateMru(true);
           
binding.setHeader("urn:enterprise.soap.sforce.com", "MruHeader", mru);
binding.setHeader("SforceService", "SessionHeader", sh);
           
try
{
    userInfo = binding.getUserInfo();
}
catch (Exception e)
{
    e.printStackTrace();
}

return userInfo;


It used to work, so not sure what's happened.

Any help is greatly appreciated.

Cheers,

Steve
stephen_m_woodstephen_m_wood
Sorry - should have said.  The error happens when I call the userInfo = binding.getUserInfo();

I'm not really sure where to go with this.  I can't change the WSDL or the response and I think this is pretty standard code for accessing the service.

Cheers,

Steve
SuperfellSuperfell
The version of the API you're calling doesn't match the version of the WSDL you built the stubs from.
stephen_m_woodstephen_m_wood
OK - that would make sense.  The outbound message seems to be specifying v8 and we generated using v6
then regenerated using v10 (trying to sort this error).  So the question is: How do I generate using v8 partner WSDL?

Not sure how I can get the WSDL basically?  Also, why is the outbound message specifying v8?

Thanks for the help.

Cheers,

Steve
stephen_m_woodstephen_m_wood
OK - had a deeper look and I think we have a problem.

  1. We are using the outbound messages - this uses v8.0 (we can't change this)
  2. The outbound message sends the session info and call-back URL
  3. We take this info to do the callback to SF (using our rules engine)
  4. We generated our callback service using the v10 WSDL (we can't change this)
  5. The v10 WSDL does not support the licenseType parameter

However, this leaves us a bit stuffed!

From the documentation, the v8 WSDL is no longer available.

So my question is: salesforce is transmitting using v8 and receiveing using v10, but v10 is not compatible
with v8 - therefore not allowing us to share session state with salesforce!

Housten, we have a BIG BIG problem.

Am I wrong or what?

Steve
SuperfellSuperfell
just use the serverUrl in the OM as the base URL, and substitute in the path for the 10.0 api.
patel2013patel2013

Hi,

 

we are facing the same issue,

 

when we create partner jar from the command

 

java -classpath wsc-23.jar com.sforce.ws.tools.wsdlc partner.wsdl.xml partner.jar

 

we dont get SforceServiceLocator, GetUserInfoResult, SoapBindingStub & SessionHeader in the jar and when we downloaded partner.jar from internet we got the reqruied classes but there we get the same error.

 

we are new to Salesforce platform can you please expalin the steps mentioned.

 

 

Thanks in advance