cancel
Showing results for 
Search instead for 
Did you mean: 

Interface between SAP PI and Successfactor SOAP API.

Former Member
0 Kudos

So I am briefing you my scenario.

After reading below all this do tell me ...Guru's is it achievable or not??

 

My Scenario is from Third-Party to to web service of SAP Success factor API ( Synchronous ).

WSDL URL : https://salesdemo4.successfactors.com/sfapi/v1/soap?wsdl

Now Let me brief you about Success factor API .

First Process is to get Authentication from SAP Success factor.

Authentication is established through the Login Operation of SF API.

A successful login will return a session ID as an HTTP Cookie.

Then this cookie must be passed back to all subsequent HTTP Requests that invoke SF API operations in order to authenticate.

So when later we call Query and QueryMore Operation it requires this Session ID to come in HTTP header with each call .

1.      Request Message => Login Operation => Response Message ( Session ID).

2.     Set this Session ID in Parameter Cookie for Next API Call.

3.     | Cookie | JSESSIONID = xxxx.xxxx.xxxx.xxxxxx.xxxx |

4.     Now Send actual Data Request Message => Query operation => Response Message Data ( Limited to 800 record at a time, so there is a one more operation to fetch rest/left record.)

5.     Request Message  => QueryMore Opeartion = > Response Message Data ( balance record , again limited to 800 , so for left out record we need to call this QueryMore Operation in Loop until record finishes i.e hasMore=false).

And remember with Step 4 and Step 5 Cookie/Session ID needs to be set in HTTP Header along with SOAP Call.

So to Achive this scenario , I am Planning to build interface like this

Source Message Type (Request Data for Query Operation ) –> Message Mapping [ UDF1 –> UDF2 ] + Java mapping –> Target Data Type ( Response after combining all the xml into one received from Query and Query More Operations.)

Message Mapping would be one to one Mapping . whatever query request will come from Source  I will pass as it is to target( Java Mapping) Only thing is two UDF's will be called in between Message Mapping.

UDF 1 : is to get SESSIONID using JAVA Look Up . Lookup receiver channel would be simple SOAP HTTP Receiver Adapter-1 .

UDF2 : now it is to set this SESSIONID in Cookie Parameter of HTTP url. And will be later used in Module of SOAP HTTP ( AXIS ) Receiver Adapter-2

Java Mapping : is to fetch data from query and Query More Operation Using SOAP Lookup In Java Mapping and Channel would be SOAP HTTP Axis Adapter where session id was already set using Modules.

Message Mapping + Java Mapping under one Operation Mapping.

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Guys, need some help here. Hope you can give me an idea to solve my problem.

I´m creating an integration SAP ECC/ Successfactors. I´ve gone through the steps shown.

I used a UDF to login and get sessionId. Then, using another UDF, I set Http Param Cookie with sessionId returned.

The error I´m getting is: Invalid Session.

I can see the JSESSION with the sessionId on Moni(Dynamic Configuration) but I don´t see it on HTTP Header in MDT. I might be looking at a wrong place. If so, where else could see the HTTP Header of Request?

Another point which I considered weird is that testing the first UDF, there are 2 output(sessionId) but they are different.

It seems sessionId is not being sent in Http Header.

MDT:

content-type:multipart/related;boundary=SAP_542D1A556CB81450E10080000A000063_END;type="text/xml";start="<soap-542D1A546CB81450E10080000A000063@sap.com>"

sap-xi-length:4050

host:XXXXXXX.XXXXXXXX.XXXXXX:00000

soapaction:"http://sap.com/xi/XI/Message/30"

content-length:4050

user-agent:SAP NetWeaver Application Server (1.0;730)

accept-encoding:gzip


<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/' xmlns:versionMajor='003' xmlns:versionMinor='001' xmlns:mustUnderstand='1' xmlns:Id='wsuid-main-92ABE13F5C59AB7FE10000000A1551F7' xmlns:SAP='http://sap.com/xi/XI/Message/30' xmlns:wsu='http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd'><SAP:Main versionMajor='3' versionMinor='1' SOAP:mustUnderstand='1' wsu:Id='wsuid-main-92ABE13F5C59AB7FE10000000A1551F7'><SAP:MessageClass>ApplicationMessage</SAP:MessageClass><SAP:ProcessingMode>synchronous</SAP:ProcessingMode><SAP:MessageId>542cb6be-2c54-0d90-e100-80000a000087</SAP:MessageId><SAP:TimeSent>2014-10-02T17:08:05Z</SAP:TimeSent><SAP:Sender><SAP:Party agency='' scheme=''></SAP:Party><SAP:Service>E03_CLNT_182</SAP:Service></SAP:Sender><SAP:Receiver><SAP:Party agency='' scheme=''></SAP:Party><SAP:Service>BC_VC_SFSF_WEBSERVICES</SAP:Service></SAP:Receiver><SAP:Interface namespace='http://vc.successfactors.webservices.insert'>SI_SFSF_INSERT_RESPONSE</SAP:Interface></SAP:Main><SAP:ReliableMessaging SOAP:mustUnderstand='1'><SAP:QualityOfService>BestEffort</SAP:QualityOfService></SAP:ReliableMessaging><SAP:System SOAP:mustUnderstand='1'><SAP:Record namespace='http://www.sap.com/webas/712/soap/features/runtime/metering/' name='CallingType'>SA</SAP:Record></SAP:System><SAP:Diagnostic SOAP:mustUnderstand='1'><SAP:TraceLevel>Information</SAP:TraceLevel><SAP:Logging>On</SAP:Logging></SAP:Diagnostic><SAP:HopList SOAP:mustUnderstand='1'><SAP:Hop timeStamp='2014-10-02T17:08:05Z' wasRead='false'><SAP:Engine type='BS'>E03_CLNT_182</SAP:Engine><SAP:Adapter namespace='http://sap.com/xi/XI/System'>XI</SAP:Adapter><SAP:MessageId>542cb6be-2c54-0d90-e100-80000a000087</SAP:MessageId><SAP:Info>3.0</SAP:Info></SAP:Hop><SAP:Hop timeStamp='2014-10-02T17:07:38Z' wasRead='false'><SAP:Engine type='IS'>is.00.vidpi301</SAP:Engine><SAP:Adapter namespace='http://sap.com/xi/XI/System'>XI</SAP:Adapter><SAP:MessageId>542cb6be-2c54-0d90-e100-80000a000087</SAP:MessageId><SAP:Info>3.0</SAP:Info></SAP:Hop><SAP:Hop timeStamp='2014-10-02T17:07:42Z' wasRead='false'><SAP:Engine type='AE'>af.pi3.vidpi301</SAP:Engine><SAP:Adapter namespace='http://sap.com/xi/XI/System'>XIRA</SAP:Adapter><SAP:MessageId>542cb6be-2c54-0d90-e100-80000a000087</SAP:MessageId></SAP:Hop></SAP:HopList><SAP:DynamicConfiguration SOAP:mustUnderstand='1'><SAP:Record namespace='http://sap.com/xi/System/HTTP' name='Cookie'>JSESSIONID=BB31E91CD79B863FFB587F14F2A91034.dc4bizxsfapi02</SAP:Record></SAP:DynamicConfiguration></SOAP:Header><SOAP:Body><sap:Manifest xmlns:sap='http://sap.com/xi/XI/Message/30' xmlns:xlink='http://www.w3.org/1999/xlink' xmlns:wsu='http://www.docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd' wsu:Id='wsuid-manifest-5CABE13F5C59AB7FE10000000A1551F7'><sap:Payload xlink:type='simple' xlink:href='cid:payload-542CB6BF2C540D90E10080000A000087@sap.com'><sap:Name>MainDocument</sap:Name><sap:Description></sap:Description><sap:Type>Application</sap:Type></sap:Payload></sap:Manifest></SOAP:Body></SOAP:Envelope>


Thanks in advance

Former Member
0 Kudos

Hi Prabhat,

You should use SF adapter which itself handle login and query etc... you dont have to create UDF for that.

One more thing is, this wsdl https://salesdemo4.successfactors.com/sfapi/v1/soap?wsdl

will not work. you have to use XSD generated by HCI.

Regards,

Mehul Lad.

finny_babu
Advisor
Advisor
0 Kudos

Hi Prabhat

You can try out the new SuccessFactors Adapter for PI to do the integration between SF and Third party application. Check out the blog: http://scn.sap.com/community/pi-and-soa-middleware/blog/2014/03/07/successfactors-sfsf-adapter-for-s...

Regards

Finny

npurohit
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Prabhat,

To your question if it is possible or not: Yes it is possible and that too without using BPM. What you will need definitely will be a local persistance either in PI or at the backend system to store the cookie.

I know that SAP already have an RDS (Rapid deployment solution) in order to integrate SAP ERP with sucessfactor using PI.

Thanks,

Naresh

Former Member
0 Kudos

Scereenshot related to SAP Reference Guide "States to USE SOAP HTTP AXIS " to set session in HTTP Header.

Regards

PS

Former Member
0 Kudos

Hi Prabhat,

Please check this link:

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b092777b-ee47-2a10-17b3-c5f593809...

Why dont you use BPM for this scenario:

I dont know if you are on single stack but as you have multiple query operations and you need to merge result of all of them. Also it will difficult to monitor the process if you do it in java mapping.

1. call login operation and set cookie

2. call query operation and check value of hasmore

3. loop on query more operation till value of hasmore is true

This way you can use the settings mentioned in the standard document.

Regards,

Beena.

Former Member
0 Kudos

HI Beena ,

Thing is I dont have much Idea over BPM .

Yes I have Dual Stack PI 7.3.

Tell me what all steps i need to include in BPM. Atleast give me an Idea ?

Regards

PS.

Former Member
0 Kudos

Hi Prabhat,

1. Receive step to open SA bridge

2. send sync to call login operation

3. container to store value of session id

4. send sync for first batch query operation

5. container to store value of hadmore field

6. container to append response of query to multiline variable of container

6 loop to check value of hasmore and inside loop call send sync for querymore operation and container to append response of querymore

7. transformation step to do n:1 mapping

8. send step to close SA bridge and return response

Will your client application wait till the time you get all  the response?

Is it possible for client application to send asynchronous request and then PI does data fetch and temporarily store it somewhere in database table or something and then client application can make synchronous request to fetch data already stored by PI.

Regards,

Beena.

Former Member
0 Kudos

Hi Beena ,

Thanks for your all previous comments .

But I have few Doubts on BPM Scenario.....

From Source Receive Step will receive XML data for QueryOperation  : -

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sfobject.sfapi.successfactors.com">

<soapenv:Header/>

<soapenv:Body>

<urn:query>

<urn:queryString>Select Username from User</urn:queryString>

</urn:query>

</soapenv:Body>

</soapenv:Envelope>

Now my Question is about LoginOperation, I will not receive login XML from Source.

So How can I send it in Send Sync Operation . Earlier i was planning to send this Login XML hardcoaded in Java LOOKUP UDF. 

So now I want to ask is there anyway in BPM, I can pass this login XML to fetch session ID and Then How to Set it in DynamicConfiguration ( Bcz again I need a UDF for this ).

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sfobject.sfapi.successfactors.com">

<soapenv:Header/>

<soapenv:Body>

<urn:login>

<urn:credential>

<urn:companyId>?</urn:companyId>

<urn:username>?</urn:username>

<urn:password>?</urn:password>

<urn:developerKey>?</urn:developerKey>

</urn:credential>

</urn:login>

</soapenv:Body>

</soapenv:Envelope>

Once this Login Operation - Sync Send call is done , Then finally pass actual Query XML to Query Opeartion.

I dont know ..this looks very complex . Kindly Guide .//

Regards

Prabhat Sharma

Former Member
0 Kudos

respond please

Former Member
0 Kudos

Hi Prabhat

Are you going to get session id in cookie? If so, you will need  udf in mapping.

In sender sync you may have bpm as sender and axis as receiver.

Then in interface mapping you may use udf to get session id using dynamic configuration.

1. send sync in BPM

2. create receiver determination with BPM sender and AXIS receiver

3. create interface determination

4. define mapping and in response mapping you may get session id from dynamic configuration

Hope this clears your doubt.

Regards,

Beena

Former Member
0 Kudos

Can we read and write a value to/from Payload in CCBPM?

<queryResponse>

<result>

<sfobject>

<id>USR-1</id>

<type>User</type>

<username>v4admin</username>

</sfobject>

<numResults>1</numResults>

<hasMore>true</hasMore>

<querySessionId>f6935193-8724-43a4-ba90-edc25ed1762f</querySessionId>

</result>

</queryResponse>

Example : Say I am getting this response from 1st Sync Send .. and now my requirement is to fetch the value of querySessionId and append it into the request message of 2nd Sync send call .

<urn:queryMoreRequest>

<urn:querySessionId>f6935193-8724-43a4-ba90-edc25ed1762f</urn:querySessionId>

</urn:queryMoreRequest>

How can I achive this scenario in ccBPM ???

Former Member
0 Kudos

Hi Prabhat,

You need to create container variables for send sync request and response and query request and response messages.

You can use transformation step to map the response of send sync response with next query request message.

Regards,

Beena.