WSDL file in SAP

www.sapyard.com
Share on Facebook22Share on LinkedIn56Tweet about this on TwitterShare on Google+0
Please Share!!

Normally when a third party calls SAP, it does an RFC function module or BAPI call through Middleware. They can also do direct web service calls thus by-passing Middleware. In such web service calls, WSDL files come into picture. WSDL is a file which is recognized by the third party as well as SAP.

Technically speaking this means there must be a SAP Web Service and then the third party has to communicate with this Web Service in some language (say .NET).
[adToAppearHere]

WSDL – What is it?
Definition : WSDL is the abbreviation of Web Service Definition Language. WSDL is a document written in XML. The document describes a Web service. It specifies the operations (or methods) the service exposes.

Some Scenario:
Every time anyone from the third party (say Online Shopping) does some expenditure or purchase, they need to call SAP for validation of some fields like, company code, cost center, G/L account etc and also to check for budget availability. Traditionally, that third party(Online Shopping) communicates with Middleware and Middleware in turn calls the RFC function module to do the validations in SAP. RFC function module in SAP returns relevant message to Middleware and Middleware communicates the same to the party (Online Shopping).

The above scenario works well and good. Suppose, in future, Middleware was to shut down and that party (Online Shopping) would interact directly with SAP. In such case, that party (Online Shopping) would not be able to call the RFC function module directly, thus, concept of WSDL file come into picture.

Solution:
Convert RFC / BAPI to WSDL and use it instead of RFC.

To create a Web Service in SAP we do not need to write any ABAP or Java code. We do not even need to have any prior knowledge of any other programming language.

For this we just need to run the Web Service Creation Wizard. We can select a BAPI or a Remote Function module in transaction SE37 or SE80 and start the Web Service Creation Wizard for it. The wizard directs step by step and creates a WSDL file for the RFC or the BAPI.

Please note: in order to create WSDL file, the function module must be an RFC function module. We cannot create WSDL for normal function modules.

Updated WSDL Creation Steps in SAP :
Go to transaction SE80. Open the function group and the RFC Function module for which you want to create the WSDL. For demo ZTESTWSDL RFC FM is considered.
Right click on the FM->Create->Web Service.


I have selected the No Authentication required Profile. You can choose any other as per your requirement from the drop down list.
Give the package, transport number and complete the wizard.

Once the wizard is complete, activate the service definition.

WSDL Configuration in SAP(Updated steps) :

Execute transaction SOAMANAGER and log into the SAP NetWeaver with your SAP userid and password.

Application and Scenario Communication Tab->Single Service Administration
Search for your Service. Select the row and hit Apply Selection button.
Go to Configuration->Create Service
Give the Service Name and the Binding Name and hit Apply Settings.
Select the suitable authentication and security option and Save it.
Check the service created should be in Active Status.
Now the WSDL configuration is complete and it should be ready to be exposed to the external system.

Go to Overview Tab and click on the link ’Open WSDL document for selected binding’. This will show the WSDL file.

Click the link ‘Display selected Binding’s WSDL URL’. Share this link to the external system for them to call.

ECC Role needed to access Web Service:

When the third party tries to call the URL (SAP WSDL), we might need to provide them a user id and password. The user for which the Web Service call is to be enabled should have the role ‘SAP_BC_WEBSERVICE_SERVICE_USER’. Check your role in t-code SU01.

[adToAppearHereLink]


Testing the WSDL
:

In order to simulate whether the WSDL is working correctly or not, we can use some free/trial version of some software available in web. I have used soapUI demo version. Download the free trial version and install it.

Prerequisite: Save the WSDL(XML) file from SOAMANAGER at your desktop as .wsdl extension.

Execute the soapUI application which you have downloaded and installed.
Give a Project name and browse the wsdl file which you have saved at your desktop.

Click the Request 1 on the left hand side. Enter the SAP user id and password in the Request 1 middle sub-window area in Tab ‘Aut’ below. Then execute the ‘Submit request to specified endpoint URL’ button.

Enter the input parameter for the FM. The Output message ‘Response successful from SAP’ is the expected export parameter value from SAP FM. This shows the configuration is all correct and you have all authorization in place.

The below steps to generate WSDL and configuration steps are only for those users who are in ECC 5 version.

WSDL Creation Steps in SAP :
Go to transaction SE37. Open one RFC Function module. Go to Utilities —> More Utilities –> Create Web Service –> From the Function Module.

Here one RFC Function module ZFIFM_INT_BUDGET_AVAILABILITY is taken for demonstration.

A wizard opens. Press Continue.

Enter Service definition name (begin with Z) and short text and click Continue.


Check the Check Box and click Continue.

Select Profile: Basic Authorization: SOAP Profile and Check the check box and Click Continue.

WSDL is created. Press Complete.

Save in the desired package and CTS. Here it is saved as local object.

Web Service is created. Go to Transaction Code WSADMIN
Check for SOAP Application for RFC-Compliant FMs. Check the WSDL, Z_DEMO_WSDL we just created.

In order to display the WSDL file which is created, select the Z_DEMO_WSDL and press Ctrl+F1.

Pop up comes. Select Document Style.

Brower opens. Enter your SAP Log on USER ID and Password (same SAP user ID and password used for creation of the WSDL).

You will see the WSDL File. Copy the URL from the address bar or save the WSDL as file and the third party can use this WSDL.

Benefits of WSDL:
1) For Projects where any third party which normally cannot call RFCs or BAPIs but which can call Web Services can call the WSDL of these RFCs or BAPIs and meet the same functionality which the RFC or BAPI would have met.
2) Middleware can be by-passed.
You might like to check our series on Web Dynpro.
Image source : www.sirz.de

Share on Facebook22Share on LinkedIn56Tweet about this on TwitterShare on Google+0
Please Share!!

About the Author

SAP Yard
SAP Yard
SAPYard is one stop page for all Technical Folks in SAP. You would find un-conventional explanations, tutorials, and tricks. Please like our Facebook Page and also join our LinkedIn Group.

15 Comments on "WSDL file in SAP"

  1. Nice article. WSDLs are very useful for integrating third party systems with SAP On Prem solutions. A very popular example is in the area of integration of a Communication Management System( Contact Center Software eg. Cisco, Avaya etc ) with SAP CRM Interaction Center.

    • Thanks Saurav. Yes it is very useful and still widely used for non SAP integration.

      Please keep visiting and providing your feedback.

      Regards,
      Team SAPYard.

  2. This is very nicely explained.. very helpful who is working with web services as first object or even for the lazy brains (like me :P) would like to refer this doc. even after several implementations…!!

  3. Very nice tutorial, well written and descriptive.

  4. Simple and clear explanation for someone new

  5. Can you explain the Pros and cons of handshake with SOA middleware using webservice and by exchanging XML files.

  6. Can you explain the Pros and cons of handshake with SOA middleware using webservice and by exchanging XML files.

  7. Thanks!!! 刘文静 .. Good to know that our post was useful to you.

  8. It is detailed and helpful, especially the part about soapUI testing. Thank you very much!

  9. WSDL creation and configuration steps are updated now..

  10. Hi Chopper.

    Many still use WSADMIN in ECC 5.0. It may help them.

  11. These instructions are outdated. The screens are different and the WSADMIN application is deprecated.

  12. Very Good and simple explanation… Thanks.

    A question: Can a new RFC be added to a Web Service already created or do I have to create individual web services for each RFC? I know that we can create a single web service for a function group. I am looking at a scenario where, I have two RFCs from different function groups… Let me know, if you have an answer. Thanks.

Leave a comment

Your email address will not be published.


*