Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
abhradeepbasu
Participant

Dear All,

Many of us are now struggling on how we can call or rather to check the data on the Successfactors API (called as SFAPI) from outside of SFSF. In order to do this we can simply achieve by using SOAP UI tool.

This is a quick reference document, primarily shows the steps on how to check the SFAPIs using SOAP UI. While implementing the integration with Successfactors, this will be very much helpful in terms of checking and testing on the SFAPIs.

Below are the few simple steps by which we can easily connect and fetch the data(verify) from Successfactors(SFSF) using SOAP UI tool.

Case: We will first fetch some records from User API and update the First Name of a specific User.

1. Install SOAP UI.

 

2. Open the SOAP UI. Click on File -> New SOAP Project.

3. Enter a meaningful Project Name.

4. Put the specific url corresponding to the SFSF data center on the Initial WSDL location from the below list (You can also save the WSDL file on your system    and take that file using the Browse option).

Here we are using:https://salesdemo4.successfactors.com/sfapi/v1/soap?wsdl

5. Press OK.

   

6. In case there is a problem in direct communication, a proxy needs to be set up to connect to this webservice from SOAP UI.

   

7. The project will be created and it can be viewed on the left hand side. Exploring the project we can see the list of operations to execute them.

Login - To login into the Successfactor. A session ID will be returned once the login operation is successful. This SessionID will be required for all the next subsequent operation.

Logout - Logout from the session.

Query - For Querying the Data from the APIs. First 250 records will be fetched.

QueryMore - If there are more than 250 records and query returns first 250 records then QueryMore can be used to fetch the next set of records.

Upsert - Data Manipulation, Update and Insert.

Insert - Insert Data

Update - Update Data.

First of all, we have to execute the login method/operation. Once it is successful, a session ID will be returned. We have to use this sessionID every time we execute any opretaion. For this business case scenario, we will first use the login operation then Query operation to fetch the records and then we will use Update operation to update one field for a particular record.

8. Login Operation: Explore Login -> double click on the request. On the right hand side request page, put the CompanyID,Username and password that we use to login in the successfactor. Enter the proper endpoint url in the End Point url section. Here it is : Web Services

Copy the SessionID from the response.

   

9. Query Operation: Explore Query-> double click on the request. On the right hand side request page, put the query into the QueryString parameter. This query is similar to the same as pl/sql query language. Under the param section use name = maxRows and Value =5 to fetch only 5 recrds from the Successfactors.

Click on the Header Section->click on the plus sign to add a custom header on the HTTP Header. Write Cookie on the LHS and on the RHS put JSESSIONID=<copied session id from the login response>.

Please see the screenshot for more clarity.

   

10. Update Operation: Now let's consider we want to update the first name for one of the User (Example USR-67).

                                 

    Now we want to change the first Name to John. In order to do this, let's use Update operation. Explore the Update operation, click on request. Use the      same JsessionID into the Header section of the HTTP request. Use the type, id and first name as shown in the below screenshot.

             

    Response shows that the update operation is now successful, In order to check the updated records we can also check this by Query operation using a where clause.

11. Querying the Updated Record: Now we can again query the data based on the id to check whether the record has been updated successfully or not. The query string will have the where clause to fetch the right record. Here for this case the query is - Select firstName, lastName From User Where id = 'USR-67'.

Remember to provide the same SessionID in the HTTP header property. Follow the below screenshot.

             

This shows that Successfactors APIs can be accessed from outside world using SOAP. This tool (SOAP UI) shows on how to access the SFSF via the SFAPIs in case we want to quickly check the data.

Note: We can also create a Test suite in SOAP UI to test this.

Assumption: The Login User has to have the access to the SFAPI.

Thanks

14 Comments
Former Member
0 Kudos

Hi Abhradeep

This is really helpful and very useful, thanks for sharing your efforts!

What would you use for OData API's?

Regards

Stuart

Uppal
Explorer
0 Kudos

Great blog Abhradeep, to the point and no rehashing of SAP documents. Thank you.

Stuart,  SAP SuccessFactors provides these API to interface with their system. We can create and consuming data via these API and they are addition to the SOAP API, for simpler and better interfacing.We can use any middleware tool since they follow standard OData protocol. The popular ones we use with SuccessFactors are Dell Boomi, SAP HCI, SAP PI, and there are more. You can find more details at, http://help.sap.com/hr_api

RaghuVamseedhar
Active Contributor
0 Kudos

For reader's benefit:-

Session can be maintained as shown in this blog Testing Integration with SuccessFactors SFAPI

Former Member
0 Kudos

Hi Abhradeep, Though I'm able to login directly into the webpage of successfactors, i'm unable to login when i test the Login wsdl file through SOAP UI.

Below is the error i do get

INFO:Error getting response for [SFAPISoapBinding.login.Request 1]:java.net.ConnectoException: Connection refused; connect

Can you please let me know why i'm unable to connect?

Thanks,

Raj

Former Member
0 Kudos

Good Sharing! Thanks Basu.

Former Member
0 Kudos

Hello all,

Could you help me? Thank you!!

I had been testing the following service in Soap UI from Successfactors certificate:

- SFSFSessionHandlingLoginQueryResult.

The error in Soap UI:

   <SOAP:Body>

      <SOAP:Fault>

         <faultcode>SOAP:Server</faultcode>

         <faultstring>Server Error</faultstring>

         <detail>

            <s:SystemError xmlns:s="http://sap.com/xi/WebService/xi2.0">

               <context>XIAdapter</context>

               <code>ADAPTER.JAVA_EXCEPTION</code>

               <text>com.sap.engine.interfaces.messaging.api.exception.MessagingException: com.sap.aii.af.service.mapping.MappingException: Mapping failed

  at com.sap.aii.adapter.soap.web.SOAPHandler.processSOAPtoXMB(SOAPHandler.java:773)

I had verified the mapping and I didn't find any error... Have you ever seen that? Could you help me to solve this problem?

Thank you all!

Former Member
0 Kudos

Hello

I’m unable to load the WSDL into SOAP UI, Showing below error

Error Loading WSDL

Error loading [https://salesdemo4.successfactors.com/sfapi/v1/soap?wsdl]: java.lang.NullPointerException

Please suggest how to fix this ….

Former Member
0 Kudos

Hello,

I am try to query the records from successfoactors instance using soap request.

select  Id, start_date from EmpEmployment where Id = 'User-12'


when i send request with above query which is working and retruning responce XML but when i send request with the same query and changing the where condition with date filed, I'm getting error

<ns2:errorCode>QUERY_FAILURE</ns2:errorCode>

<ns2:errorMessage>Query failure! Error: Failed to query</ns2:errorMessage>

XML Request sent:

<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  Id, start_date from EmpEmployment where start_date = '1998-10-05'</urn:queryString>

         <!--Zero or more repetitions:-->

         <urn:param>

            <urn:name>maxRows</urn:name>

            <urn:value>800</urn:value>

         </urn:param>

      </urn:query>

   </soapenv:Body>

</soapenv:Envelope>


can any one help me with an example to query records with date,datetime field in where condition?


Thank you,

Sathish

0 Kudos
It worked for me, and saved a lot of time. 🙂

I used update part and obviously Session part as well.

Thanks for sharing.
pavan_chemma
Discoverer
0 Kudos
Hi Abradeep,

This blog was very helpful. I was getting Invalid Session ID. Thank you for explaining in detail.

 

Regards

Mehar

 
0 Kudos

Hi Abhradeep,

You are great Abhradeep.

Really, this is very useful blog for who is working and searching document of SuccessFactor API (SFAPI) SOAP web service.

Thanks for sharing your efforts!

Thanks & Regards

Ananth

0 Kudos

New to SAP Successfactors.  Followed this article to query the Candidate entity and was successful.  However I have not been able to insert .  Can you please provide an example of an insert or update.  What are businesskeys and what needs to go in there.  The following is what I see for update.

Is it better to use the SOAP API or the Odata API.

 

<urn:update>
      <urn:type>Candidate$201</urn:type>
      <!--1 or more repetitions:-->
      <urn:sfobject>
           <!--You have a CHOICE of the next 2 items at this level-->
           <!--Optional:-->
           <urn:id>?</urn:id>
           <!--Optional:-->
           <urn:businessKeys>
                <!--You may enter ANY elements at this point-->
           </urn:businessKeys>
           <urn:type>?</urn:type>
           <!--You may enter ANY elements at this point-->
      </urn:sfobject>

</urn:update>

 

Thank You.

S0024576714
Explorer
0 Kudos
Let us know the latest download link for SOAP UI.
SubrataB
Discoverer
0 Kudos

Absolutely amazing blog with all the necessary details, Thanks Abhradeep!

Labels in this area