• Praf
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 7
    Replies

Hi,

 

We have a custom integration that was built using version 10 of the API and it works fine. I am testing out adding some new functionality to the application which will retrieve some data for me and keep getting the error message

 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

 

The application uses a partner WSDL, lets call this code A. There is a button on our SFDC org that launches another application, code B, which recieves certain params when invoked like server url, session id, username etc etc. Code B passes these params to code A who then tries to login to SFDC org to validate the session id and user settings etc.

The above works on one of our dev and prod instances but returns an error on our sandboxes.

 

Below is the session header that code A uses to make an API call to SFDC, could someone look it over and let me know if I am missing something here, maybe the namespaces or something else?

 

<ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/
next" soapenv:mustUnderstand="0" xmlns:ns1="urn:partner.soap.sforce.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><sessionId xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">00DR00000007B0K%21ARcAQCypTASFnKDgtd.HE7mZosNWT6tNu_7g7tYJopQbqr7MLsn0wutY1ancvS_OT.U6Y6p4P_Z4cJ53G1ZajLEU3B9YgPdO</sessionId></ns1:SessionHeader>

 

 The session id is coming from Code B, here is the server url being passed onto code B:

https://cs2.salesforce.com/services/Soap/u/16.0/00DR00000007B0K

 

Here is snippet of code A:

public boolean validateSessionId(String sesID, String url, String username) {
	String sessionId = sesID;
	String serverURL = url;
	  
	URL uri = new URL(serverURL);
	        // binding
       SforceServiceLocator sserviceLocator = new SforceServiceLocator();
	SoapBindingStub sbinding = new SoapBindingStub();
	SessionHeader ssh = new SessionHeader();
	ssh.setSessionId(sessionId);
	String ns = sserviceLocator.getServiceName().getNamespaceURI();
	sbinding.setHeader(ns, "SessionHeader", ssh);
	sbinding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, uri.toString());
        com.sforce.soap.partner.GetUserInfoResult userInfoResult = sbinding.getUserInfo();
        String userid = userInfoResult.getUserName();
        if (userid.equals(username))
        	return true;
}	     

 I can't use login on the binding since I don't have the password of the user account coming in.

 

Any thoughts?

 

Thanks

Praful 

  • October 05, 2010
  • Like
  • 0

Hello, I am trying to link to an external Access DB via a custom page detail link or a button in SFDC. However, SFDC support suggested to use some javascript to do this:

 


<script type="text/javascript">
function foo(){
window.open(file:\\servername\database.accdb);
}
</script>

 However, the above code does not work in most browsers. Is there any other way to open the external DB via pop up or a new window? I tried using the above code but it gives me an error in Firefox. 

 

Thanks

Praf

 

 

 

  • December 10, 2009
  • Like
  • 0
Hello ... Can we send an attachment via the Outbound Msg Notification mechanism? If so I need some help in getting attachment from the related list section to be added to the outbound msg call. Thanks
  • June 21, 2009
  • Like
  • 0

Hey Guys ... we have a custom object with a bunch of fields and use an Outbound Msg Notification to send the payload to our internal servers. However, there is a new requirement which I am unsure how to implement. Here is the use case:

1) User checks a checkbox, say named, Attach a File

2) We have an Outbound Msg triggered via a Workflow rule to send the payload out

3) If the checkbox value = true then before submitting/triggering the outbound msg, the page should direct the user to attach a document.

 

There is a related list on the page layout for notes and attachments. How can I verify or validate if the user has made an attachment before triggering the Workflow rule actions?

 

Another option is to display a pop up or warning window to the user that they need to make an attachment. But even then the attachment needs to come with the payload.

 

Any ideas or thoughts on how to go about doing this or researching this?

Thanks 

  • June 19, 2009
  • Like
  • 0

i was reading up on another thread from last year that you couldnt package approval processes, is that still the case of has this been available?

 

Thanks  

  • February 26, 2009
  • Like
  • 0

Hello ... I recently set up an outbound msg notification on our org and set up an end point, which is basically a listener as outlined in the APIs. However, I need to pass this payload onto another internal web service which is expecting a string rather than a SOAP msg. I have tried researching this online and in the forums but couldnt find any ones that detail how to do that. Almost everyone is going old school and extracting the payload and generating your own SOAP msg be it on PHP or .Net. Is there any built in stubs or methods that will spit out a String representation or XML representation of the incoming request? I have tried to access the request and casting it to a String but it didnt seem to like it.

 

Here is what I am doing:

 

 

public com.sforce.soap.x2005.x09.outbound.NotificationsResponse notifications( com.sforce.soap.x2005.x09.outbound.Notifications request) { NotificationsResponse response = new NotificationsResponse(); String myCompany = request.getNotification()[0].getSObject().getCompany_Name__C(); System.out.println("Company Name: " + myCompany);

 

 Also, is there a sample of the SOAP msg coming in so that I can atleast create my own msg and massage the data if needed.

Any help would be appreciated.

 

  • February 18, 2009
  • Like
  • 0
Hello ... I have been trying to load some data into my developer org using the Apex data loader app but run into errors everytime I try to do that. The connection URLs I tried using are: https://www.salesforce.com; https://www.salesforce.com; https://login.salesforce.com

Has anyone faced any issues doing this using V14 of the data loader?
  • November 04, 2008
  • Like
  • 0
Hello ... we have a design situation where we have multiple s-controls which will load a flex GUI and we dont want to create multiple GUIs for each of them. We want to create and share a single GUI between the different s-controls and simply control the data loaded depending on which s-control loads the GUI. Has anyone run into such a situation? Any ideas of working with this situation? Could using the 'Shared Resources' feature be useful, if so how? Thanks
  • November 04, 2008
  • Like
  • 0
Hello ... I am in the Dev 501 training class and we had an excercise which included using VisualForce controllers and deploying the code to our sandbox org, we created a controller and a Visual Force page but the Visual Force page fails stating

Save error: Expression Error: Named Object: core.apexpages.components.cdk.ApexComponentRefHandler not found.

Upong researching the issue on the web, one of the community discussion boards stated this is an error while using <PageMessages> in the Visual Force page. I tried commenting out the line and it compiles fine. However I did wanna bring this up and see if any one else is having issues as well or if anyone knows when can this be fixed? Or if there is another area to post such requests?

Thanks
Praf
  • September 12, 2008
  • Like
  • 0

Hi,

 

We have a custom integration that was built using version 10 of the API and it works fine. I am testing out adding some new functionality to the application which will retrieve some data for me and keep getting the error message

 

INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session

 

The application uses a partner WSDL, lets call this code A. There is a button on our SFDC org that launches another application, code B, which recieves certain params when invoked like server url, session id, username etc etc. Code B passes these params to code A who then tries to login to SFDC org to validate the session id and user settings etc.

The above works on one of our dev and prod instances but returns an error on our sandboxes.

 

Below is the session header that code A uses to make an API call to SFDC, could someone look it over and let me know if I am missing something here, maybe the namespaces or something else?

 

<ns1:SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/
next" soapenv:mustUnderstand="0" xmlns:ns1="urn:partner.soap.sforce.com" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><sessionId xsi:type="xsd:string" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">00DR00000007B0K%21ARcAQCypTASFnKDgtd.HE7mZosNWT6tNu_7g7tYJopQbqr7MLsn0wutY1ancvS_OT.U6Y6p4P_Z4cJ53G1ZajLEU3B9YgPdO</sessionId></ns1:SessionHeader>

 

 The session id is coming from Code B, here is the server url being passed onto code B:

https://cs2.salesforce.com/services/Soap/u/16.0/00DR00000007B0K

 

Here is snippet of code A:

public boolean validateSessionId(String sesID, String url, String username) {
	String sessionId = sesID;
	String serverURL = url;
	  
	URL uri = new URL(serverURL);
	        // binding
       SforceServiceLocator sserviceLocator = new SforceServiceLocator();
	SoapBindingStub sbinding = new SoapBindingStub();
	SessionHeader ssh = new SessionHeader();
	ssh.setSessionId(sessionId);
	String ns = sserviceLocator.getServiceName().getNamespaceURI();
	sbinding.setHeader(ns, "SessionHeader", ssh);
	sbinding._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, uri.toString());
        com.sforce.soap.partner.GetUserInfoResult userInfoResult = sbinding.getUserInfo();
        String userid = userInfoResult.getUserName();
        if (userid.equals(username))
        	return true;
}	     

 I can't use login on the binding since I don't have the password of the user account coming in.

 

Any thoughts?

 

Thanks

Praful 

  • October 05, 2010
  • Like
  • 0

Hey Guys ... we have a custom object with a bunch of fields and use an Outbound Msg Notification to send the payload to our internal servers. However, there is a new requirement which I am unsure how to implement. Here is the use case:

1) User checks a checkbox, say named, Attach a File

2) We have an Outbound Msg triggered via a Workflow rule to send the payload out

3) If the checkbox value = true then before submitting/triggering the outbound msg, the page should direct the user to attach a document.

 

There is a related list on the page layout for notes and attachments. How can I verify or validate if the user has made an attachment before triggering the Workflow rule actions?

 

Another option is to display a pop up or warning window to the user that they need to make an attachment. But even then the attachment needs to come with the payload.

 

Any ideas or thoughts on how to go about doing this or researching this?

Thanks 

  • June 19, 2009
  • Like
  • 0
Hello ... I have been trying to load some data into my developer org using the Apex data loader app but run into errors everytime I try to do that. The connection URLs I tried using are: https://www.salesforce.com; https://www.salesforce.com; https://login.salesforce.com

Has anyone faced any issues doing this using V14 of the data loader?
  • November 04, 2008
  • Like
  • 0
Hello ... I am in the Dev 501 training class and we had an excercise which included using VisualForce controllers and deploying the code to our sandbox org, we created a controller and a Visual Force page but the Visual Force page fails stating

Save error: Expression Error: Named Object: core.apexpages.components.cdk.ApexComponentRefHandler not found.

Upong researching the issue on the web, one of the community discussion boards stated this is an error while using <PageMessages> in the Visual Force page. I tried commenting out the line and it compiles fine. However I did wanna bring this up and see if any one else is having issues as well or if anyone knows when can this be fixed? Or if there is another area to post such requests?

Thanks
Praf
  • September 12, 2008
  • Like
  • 0