Expand my Community achievements bar.

Guidelines for the Responsible Use of Generative AI in the Experience Cloud Community.

How to change SOAP Messages to include headers in Designer???

Avatar

Former Community Member
Hi, I am trying to design a form to connect to Salesforce.com, they provide a Web service.<br />So I connected the WSDL file to the form and I get the objects correct, but I need to login to execute any function like queries, search, update etc..<br />So they provide a login call which works, it returns a sessionId and a URL,the problem is I need to send the sessionId to execute the other functions, the Salesforce documentation says that I need to set that sessionId in the Soap header, and that is where I have the problem:<br /><br />This is the login, which works correctly<br />Request Message login Call<br /><br /><?xml version="1.0" encoding="utf-8"?> <br /> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" <br />xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://<br />www.w3.org/2001/XMLSchema"> <br /> <soap:Body> <br /> <login xmlns="urn:partner.soap.sforce.com"> <br /> <username>user@domain.com</username> <br /> <password>secret</password> <br /> </login> <br /> </soap:Body> <br /> </soap:Envelope> <br /><br />Response Message login Call<br /> <br /><?xml version="1.0" encoding="UTF-8"?> <br /><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" <br />xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/<br />XMLSchema-instance"> <br /> <soapenv:Body> <br /> <loginResponse xmlns="urn:partner.soap.sforce.com"> <br /> <result> <br /> <passwordExpired>false</passwordExpired> <br /> <serverUrl>https://blitzna1.eng.salesforce.com/services/Soap/u/5.0</<br />serverUrl> <br /> <sessionId>c0l4g2lI.slq0uexTI3HIIuTTc9.wnYd0_jXlNKOSU</sessionId> <br /> <userId>00530000000cJzKAAU</userId> <br /> </result> <br /> </loginResponse> <br /> </soapenv:Body> <br /></soapenv:Envelope> <br /><br />Now I want to use that sessionId in the next calls:<br /><br />This is an example of how the client has to send a Search request call: <br /><br /><?xml version="1.0" encoding="utf-8"?> <br /><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" <br />xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://<br />www.w3.org/2001/XMLSchema"> <br /> <soap:Header> <br /> <SessionHeader xmlns="urn:partner.soap.sforce.com"> <br /> <sessionId>4I1yNabX_5FyOGOnuFO64VpRP0_jXlNKOSU</sessionId> <br /> </SessionHeader> <br /> </soap:Header> <br /> <soap:Body> <br /> <search xmlns="urn:partner.soap.sforce.com"> <br /> <searchString>find {4159017000} in phone fields returning <br />contact(id, phone, firstname, lastname), lead(id, phone, firstname, lastname), <br />account(id, phone, name)</searchString> <br /> </search> <br /> </soap:Body> <br /> </soap:Envelope> <br /><br />But in the form I have this:<br /> <DataConnection3><br /> <soap:Body xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"><br /> <tns:search xmlns:tns="urn:partner.soap.sforce.com"><br /> <tns:searchString/><br /> </tns:search><br /> </soap:Body><br /> </DataConnection3><br /><br />So Salesforce does not accept the call, I have tried changin it to the sample above, but it does not appear to work<br /><br />Please help!!
3 Replies

Avatar

Former Community Member
Roberto, Did you ever get this to work? I am having the same issue currently. Any help or direction would be greatly appreciated.

Avatar

Former Community Member
I tried using the soap object and i could include headers but I didnt finish, we dont need to do that anymore, because we are going to change the CRM,

but the best you can do is try the Acrobat JavaScript Scripting Guide and try the SOAP and WebServices Section where they describe how to use the SOAP Object

Avatar

Former Community Member
Did anyone get the Web Services to work with Salesforce. Have similar need.