Hi team, Im using ESB Salesforce REST connector to performce some operations in SF.
<api xmlns="http://ws.apache.org/ns/synapse" name="sendOrder" context="/sendOrder"> <resource methods="POST" url-mapping="/"> <inSequence> <salesforcerest.init> <apiUrl>https://ap5.salesforce.com/</apiUrl> <clientId>XXXXXXX</clientId> <clientSecret>XXXXXXX</clientSecret> <hostName>https://login.salesforce.com</hostName> <apiVersion>XXXXXXX</apiVersion> <username>XXXXX</username> <password>XXXXXX</password> </salesforcerest.init> <log level="full"/> <salesforcerest.recentlyViewedItem> <limit>5</limit> </salesforcerest.recentlyViewedItem> <log level="full"/> <respond/> </inSequence> <outSequence> <send/> </outSequence> </resource> </api> Init get succeeded but the subsequent API calls get failed saying that the session is invalid. { "message": "Session expired or invalid", "errorCode": "INVALID_SESSION_ID" } I tried to revoke the access token and generating a new one but still I face the same issue. highly appreciate your suggestions on this. 7-12-01 00:14:47,172] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:076481b3-c1f0-4663-a19f-511f2ecd0eee, Direction: request, Payload: {"access_token":"XXX!XXXXXX","instance_url":" https://cs58.salesforce.com","id":" https://test.salesforce.com/id/00D0l00000340CrhxEAC/005546F000005kaBGQAY ","token_type":"Bearer","issued_at":"XXX","signature":"XXXXX+z6HbpWvod+4DUI="} [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "GET //services/data/v40.0/theme HTTP/1.1[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Authorization: Bearer XXXX!XXXXXX[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Strict-Transport-Security: max-age=31536000; includeSubDomains[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "X-ReadOnlyMode: false[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "X-Content-Type-Options: nosniff[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Content-Security-Policy: upgrade-insecure-requests[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Set-Cookie: BrowserId=9efBu0mDTIWX7as_4T0ihA;Path=/;Domain=.salesforce.com;Expires=Mon, 29-Jan-2018 18:44:46 GMT;Max-Age=5184000[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Vary: Accept-Encoding[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Expires: Thu, 01 Jan 1970 00:00:00 GMT[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "X-XSS-Protection: 1; mode=block[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Content-Type: application/json;charset=UTF-8[\r][\n]" [2017-12-01 00:14:47,174] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Host: ap5.salesforce.com[\r][\n]" [2017-12-01 00:14:47,175] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "Connection: Keep-Alive[\r][\n]" [2017-12-01 00:14:47,175] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "User-Agent: Synapse-PT-HttpComponents-NIO[\r][\n]" [2017-12-01 00:14:47,175] DEBUG - wire HTTPS-Sender I/O dispatcher-2 << "[\r][\n]" [2017-12-01 00:14:47,560] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "HTTP/1.1 401 Unauthorized[\r][\n]" [2017-12-01 00:14:47,561] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "Date: Thu, 30 Nov 2017 18:44:47 GMT[\r][\n]" [2017-12-01 00:14:47,561] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "Strict-Transport-Security: max-age=31536000; includeSubDomains[\r][\n]" [2017-12-01 00:14:47,561] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "X-Content-Type-Options: nosniff[\r][\n]" [2017-12-01 00:14:47,561] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "X-XSS-Protection: 1; mode=block[\r][\n]" [2017-12-01 00:14:47,561] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "Content-Security-Policy: upgrade-insecure-requests [\r][\n]" [2017-12-01 00:14:47,561] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private[\r][\n]" [2017-12-01 00:14:47,562] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "Set-Cookie: BrowserId=nrfXAmi3RPidZl2vKAAAiA;Path=/;Domain=.salesforce.com;Expires=Mon, 29-Jan-2018 18:44:47 GMT;Max-Age=5184000[\r][\n]" [2017-12-01 00:14:47,562] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "Expires: Thu, 01 Jan 1970 00:00:00 GMT[\r][\n]" [2017-12-01 00:14:47,562] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "WWW-Authenticate: Token[\r][\n]" [2017-12-01 00:14:47,562] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "Content-Type: application/json;charset=UTF-8[\r][\n]" [2017-12-01 00:14:47,562] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "Transfer-Encoding: chunked[\r][\n]" [2017-12-01 00:14:47,562] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "[\r][\n]" [2017-12-01 00:14:47,562] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "4B[\r][\n]" [2017-12-01 00:14:47,563] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}][\r][\n]" [2017-12-01 00:14:47,563] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "0[\r][\n]" [2017-12-01 00:14:47,563] DEBUG - wire HTTPS-Sender I/O dispatcher-2 >> "[\r][\n]" [2017-12-01 00:14:47,566] INFO - LogMediator To: http://www.w3.org/2005/08/addressing/anonymous, WSAction: , SOAPAction: , MessageID: urn:uuid:853c8354-a633-4d91-a124-050ada7e7595, Direction: request, Payload: [{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}] [2017-12-01 00:14:47,569] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "HTTP/1.1 401 Unauthorized[\r][\n]" [2017-12-01 00:14:47,570] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Strict-Transport-Security: max-age=31536000; includeSubDomains[\r][\n]" [2017-12-01 00:14:47,570] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Cache-Control: no-cache,must-revalidate,max-age=0,no-store,private[\r][\n]" [2017-12-01 00:14:47,570] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "X-Content-Type-Options: nosniff[\r][\n]" [2017-12-01 00:14:47,571] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Content-Security-Policy: upgrade-insecure-requests[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "WWW-Authenticate: Token[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Set-Cookie: BrowserId=nrfXAmi3RPidZl2vKAAAiA;Path=/;Domain=.salesforce.com;Expires=Mon, 29-Jan-2018 18:44:47 GMT;Max-Age=5184000[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Expires: Thu, 01 Jan 1970 00:00:00 GMT[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "X-XSS-Protection: 1; mode=block[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Content-Type: application/json;charset=UTF-8[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Date: Thu, 30 Nov 2017 18:44:47 GMT[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Transfer-Encoding: chunked[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "Connection: keep-alive[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "4b[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}][\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "0[\r][\n]" [2017-12-01 00:14:47,572] DEBUG - wire HTTP-Listener I/O dispatcher-2 << "[\r][\n]"
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev