Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member182598
Active Contributor
0 Kudos

Introduction



Since WebAS 6.20, SAP started to make business functions available through standard based Web Services Technology.

Many SAP business processes and data can be accessed through RFC-enabled function modules. BAPIs are implemented as RFC-enabled function modules and provide standardized programming interface. All SAP provided RFC-enabled function modules (so all the BAPIs) are exposed as web services by default.This feature is available since WebAS 6.20. I will be discussing how to access and use these SAP provided Webservices in WebDynpro application as well as how to expose our own Function module as WebService and use them in WebDynpro applications, I am assuming that the reader has worked with WebDynpro and is familiar with working with models.
Please Go through the WebDynpro Tutorials provided on SDN

WebDynpro Tutorials

Steps to Expose your Remote Enabled Function module as WebService



1.

Use transaction SE37 to open your function module.Go to Attributes tab page and confirm that the remote enabled radio button is selected.

2.

Go to Utilities --> More Utilities --> Create WebService --> From the Function Module

A Wizard opens



WebDynpro Tutorials

1.Download the WSDL file locally or refer to the URL for the WSDL file in model creation wizard.

2.When you are using Userid/Passwd for authentication you need to pass the UserId/ Passwd with the model object before executing it.

Here I have provided the sample code:

public void executeRequest_ZemailKp_zPrashantRfc( )
{
IWDMessageManager manager = wdComponentAPI.getMessageManager();
try{
wdContext.currentRequest_ZemailKp_zPrashantRfcElement().modelObject()._setUser("User Name");
wdContext.currentRequest_ZemailKp_zPrashantRfcElement().modelObject()._setPassword("Password");
wdContext.currentRequest_ZemailKp_zPrashantRfcElement().modelObject().execute();
} catch(Exception ce) {
manager.reportException(ce.getMessage(), false);
}

Troubleshooting



While you are Using a WebService with a very complex interface (Most of the standard SAP provided WebServices are) you might get SOAP Exceptions. This may be due to the fact that you are initailizing and passing values for only few Input parameters, as you may need only few. The rest of the Input Parameters are not initialized, This may create problems sometimes and you will get

SOAP Marshalling Exception or Improper Message Structure Exception

.
In that case you need to observe your request response values using some utility applications and identify the parametrs for which the problem is occuring. After that either initialize those input parameters or remove those Input parameters from the WSDL file by editing the WSDL file. Although Editing the WSDL file manually is not a good idea as you may require those parameters at a later stage.

If you are getting the

Authentication Exception

, check the userid/passwd you are providing or, the validity of client certificate.

Please provide your valuable comments, feedbacks, suggestions.

Thanks

Prashant

7 Comments
Labels in this area