cancel
Showing results for 
Search instead for 
Did you mean: 

How do I set SOAP Headers when calling Client Proxies?

Former Member
0 Kudos

Hi all,

I'm trying to call a SalesForce Web Service from ABAP.

I've generated an Enterprise WSDL in salesforce and created my client proxy in SAP.

Salesforce requires you to login which passes a sessionId back and you then use the sessionId in subsequent calls (e.g. to create an Asset).

The login is working fine.

However I can't work out how to set the session id.

The Payload needs to look similar to the sample payload I have included below

What I'm ideally after is some sample abap to populate the soapenv:Header with the Session Id.

Or if there is a way of configuring this in the proxy or soamanager.

Regards,

John

Sample Payload

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

xmlns:urn="urn:enterprise.soap.sforce.com"

xmlns:urn1="urn:sobject.enterprise.soap.sforce.com"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soapenv:Header>

<urn:SessionHeader>

<urn:sessionId>00DA0000000Ja5a!ARsAQHn8yif2c.T31jd3.c.5wCQbPWU1QNoJgClqbPEhm5EEQHn1Iu9NcxTYOXE6ojAP_Y.svsy_Ai14DCubjmupD7CTQfjw</urn:sessionId>

</urn:SessionHeader>

</soapenv:Header>

<soapenv:Body>

<urn:create>

<!Zero or more repetitions:>

<urn:sObjects xsi:type="urn:Asset"

xmlns:ns3="urn:sobject.enterprise.soap.sforce.com">

<urn:Account xsi:type="urn:Account">

<urn:Id xsi:nil="true"/>

<urn:SAP_Sold_To_Bill_To_Account__c>Xerox Corporation</urn:SAP_Sold_To_Bill_To_Account__c>

</urn:Account>

<urn:Name>JWSOAPTEST Asset2</urn:Name>

<urn:IsCompetitorProduct>0</urn:IsCompetitorProduct>

<urn:Description>Asset Description</urn:Description>

<urn:InstallDate>2010-07-29</urn:InstallDate>

<urn:Price>1.00</urn:Price>

<urn:Product2 xsi:type="urn:Product2">

<urn:Id xsi:nil="true"/>

<urn:Name>GenWatt Diesel 1000kW</urn:Name>

</urn:Product2>

<urn:ProductCode></urn:ProductCode>

<urn:ProductDescription></urn:ProductDescription>

<urn:ProductFamily></urn:ProductFamily>

<urn:Quantity>1</urn:Quantity>

<urn:SerialNumber>JWSOAPSER2</urn:SerialNumber>

<urn:Status>Shipped</urn:Status>

<urn:UsageEndDate>2010-07-29</urn:UsageEndDate>

</urn:sObjects>

</urn:create>

</soapenv:Body>

</soapenv:Envelope>

View Entire Topic
Former Member
0 Kudos

Hi,

You need to use WS_HEADER to access parameters.

you can see source code exmple here:

SAP help documentation here: http://help.sap.com/saphelp_nwpi71/helpdata/en/51/d5cd16235e4643ae8ec92395c4ad97/frameset.htm

Regards,

Gourav