• jingzhi
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 7
    Replies
Salesforce SessionId is very tricky:
1. Different pages may have different SessionId ({!$Api.Session_ID});
2. Logout and then Login again may get the same SessionId as last Login;

Then, how to identify that a user has login again or logout Salesforce in our App?
The page contains a file form, and the form will upload a file to a server using https.
Actually, the js code is quite simple.

But any time when you using ie (ie6/ie7) to do the form submit, a warning box pops up,
"...the page includes both secure and unsecure code",
if you neglect it and continue,
it will go to the 'ie cannot display the webpage' error page.

if you try do debug the page, the debugger will stop at
<body style="overflow:hidden;overflow-y:hidden">
        <div id="topPane" style="width: 100%; height: 100%">
            <iframe frameBorder="0" id="contentPane" name="contentPane" onload="if (this.contentWindow.location.pathname != '/blank.html') { if (true) { initContentPane('https://emc-dctm-v1.na5.visual.force.com/apex/ContentUpload?retURL=%2F0067000000B2yvv&amp;CF00N70000001yZyA_lkid=0067000000B2yvv&amp;CF00N70000001yZyA=Starbucks&amp;scontrolCaching=1&amp;core.apexpages.devmode.url=1') } }" src="/blank.html" style="width: 100%; height: 100%"></iframe>
        </div>


The problem is quite interesting,
it will disappear in ie if you first open another page and then return to this page again.
What changed between the operation?

The page works fine in firefox. And the error happens before the server side action invoked,
so it must be an error of client side.


possible reasons:
1. file upload using https
2. form enctype="multipart/form-data"
3. bad js code
4. ie problem


Who can give me some tips?

lots of thanks
I used enterprise.wsdl (13.0) to generate the Web service stub, then
call the Salesforce Web service in java using loginBySessionId(String sid, String sURL),
while both the sessionId and serviceUrl is sent by virtual force page.

It works fine before the soap service endpoint has changed to 14.0:
https://www.salesforce.com/services/Soap/c/14.0
But it doesn't work now.

I didn't change my java code and page code.
I thought it should work well using the old version soap service, but things not.
Because of the exception, I also tried to update the wsdl file to 14.0, and rebuild my application.
But it doesn't work too.

NOW, my application cannot be used because of this exception.
Do there any one faced the same headache problem?

The following is the exceptions:

AxisFault
faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_SESSION_ID
faultSubcode:
faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}UnexpectedErrorFault:<ns1:exceptionCode>INVALID_SESSION_ID</ns1:exceptionCode><ns1:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session</ns1:exceptionMessage>

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

....

Kunpeng Yang - 13/Oct/08 07:45 PM AxisFault faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_SESSION_ID faultSubcode: faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultActor: faultNode: faultDetail: {urn:fault.enterprise.soap.sforce.com}UnexpectedErrorFault:<ns1:exceptionCode>INVALID_SESSION_ID</ns1:exceptionCode><ns1:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session</ns1:exceptionMessage> INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
Salesforce SessionId is very tricky:
1. Different pages may have different SessionId ({!$Api.Session_ID});
2. Logout and then Login again may get the same SessionId as last Login;

Then, how to identify that a user has login again or logout Salesforce in our App?
Recently I shift to platform 9 and API 14

Firstly I login the Salesforce through web and after I got API.SessionId and API.ServerUrl on VF page,  I invoke web service method "loginBySessionID" to login Salesforce  on the JAVA side.
But now it doesn't work.

Any Idea about it?

Thanks,
Kunpeng
I used enterprise.wsdl (13.0) to generate the Web service stub, then
call the Salesforce Web service in java using loginBySessionId(String sid, String sURL),
while both the sessionId and serviceUrl is sent by virtual force page.

It works fine before the soap service endpoint has changed to 14.0:
https://www.salesforce.com/services/Soap/c/14.0
But it doesn't work now.

I didn't change my java code and page code.
I thought it should work well using the old version soap service, but things not.
Because of the exception, I also tried to update the wsdl file to 14.0, and rebuild my application.
But it doesn't work too.

NOW, my application cannot be used because of this exception.
Do there any one faced the same headache problem?

The following is the exceptions:

AxisFault
faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_SESSION_ID
faultSubcode:
faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
faultActor:
faultNode:
faultDetail:
{urn:fault.enterprise.soap.sforce.com}UnexpectedErrorFault:<ns1:exceptionCode>INVALID_SESSION_ID</ns1:exceptionCode><ns1:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session</ns1:exceptionMessage>

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

....

Kunpeng Yang - 13/Oct/08 07:45 PM AxisFault faultCode: {urn:fault.enterprise.soap.sforce.com}INVALID_SESSION_ID faultSubcode: faultString: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session faultActor: faultNode: faultDetail: {urn:fault.enterprise.soap.sforce.com}UnexpectedErrorFault:<ns1:exceptionCode>INVALID_SESSION_ID</ns1:exceptionCode><ns1:exceptionMessage>Invalid Session ID found in SessionHeader: Illegal Session</ns1:exceptionMessage> INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session