You need to sign in to do that
Don't have an account?
Venkatesh S
System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session
Hello All,
I am trying to integrate two instance via metadata api. I have used oauth to get access token and passed it to metadata api session. When i called the method then this error came out. Can anyone please suggest some workaround to use another salesforce instance session in seperate salesforce instance metadata api codings.
Thanks.
I am trying to integrate two instance via metadata api. I have used oauth to get access token and passed it to metadata api session. When i called the method then this error came out. Can anyone please suggest some workaround to use another salesforce instance session in seperate salesforce instance metadata api codings.
MetadataService.MetadataPort service1 = new MetadataService.MetadataPort(); service1.SessionHeader = new MetadataService.SessionHeader_element(); service1.SessionHeader.sessionId = access_token;
Thanks.
It looks like you are using Apex to call the Metadata API. In that case it will be something like:
Thanks for your response,
I have hardcoded the instance url that came from the session id response. It works, but there is another issue
Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found 'http://www.w3.org/1999/xhtml:html'
Thanks.
What method are you calling on the MetadataAPI to get that error?
Also, avoid hardcoding the endpoint_x if you can. The instance_url can change with things like pod migrations.
This code is working for the instance which i currently logged in instance session, but if i use another instance only those errors are coming.
Were you able to find a workaround for this?