Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

>Net webservive with SAp

Hi All,

How to integrate .Net webservice with SAP





Sender SOAP Adapter

Receiver RFC/IDOC/ABAP proxies.


Step 1:

Create the Sender Datatypes for Request & Response


Create the MT for Req & Res

Step3 :

Create OB Message Interface ( Syncronous)

Step4 :

Import FM/BAPI

step5 :

Request Mapping : Sender Req MT--> FM Req

Response Mapping : FM Res----->Sender Res MT


Interface Mapping


Step1 :

Configure Sender Soap Adapter

Step2 :

Configure Receiver RFC Adapter

Step 3: Configure Sender Agreement, receiver determination,Interface determination,Receiver agreement

Step 4:

Create WSDL file.( ID->tools-Defien webservice)

save the file as .wsdl file

Give the file to sender system


Create a proxy class using a WSDL and

use it in a Client Program in .NET : (assuming Maths as the WSDL and Webserice name)

1.) Place maths.wsdl in C:/Sample/ folder

2.) Open Visual studio command prompt using the Start Menu

Start->Programs->Microsoft Visual Studio 2005->Visual Studio Tools->Visual Studio 2005 Command


3.) In the Command prompt go to that directory

> C:

> CD\

> CD Sample

> wsdl maths.wsdl /out:"c:\sample"

4.) The previous step will create a file called Maths.cs , go to that folder and confirm this

5.) Open Microsoft Visual Studio 2005, open the Client application where this webservice needs to be


6.) If your Client application is a web application, the see if the website has a folder called


If not then create this folder. Right Click on this folder and click on "Add Existing Item"

7.) Browse to C:/sample and select the Maths.cs file

8.) If your client is a Desktop application , just add this file in a similar manner to the project(no

need of creating any folder)

9.) After the file gets added, open Maths.cs file

10.) Add a namespace to it for convinience


namespace SAP



This should come before the Class Declaration and close it after the class

eg: See the red lines

namespace SAP


/// <remarks/>

[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]



[System.Web.Services.WebServiceBindingAttribute(Name = "Equi_get_NotifBinding", Namespace =


public partial class Equi_get_NotifService : System.Web.Services.Protocols.SoapHttpClientProtocol





11.) Save the Maths.cs file

12.) Open the Webform or windows form code where this webserive will be called

13.) The webservice will now be available here under the SAP namespace

so when u type "SAP." u will get all the classes in it.

Add credential in this code as shown below


private void GetNotifications()




SAP.Equi_get_NotifService ser1 = new SAP.Equi_get_NotifService(); //This is the

Webserive Proxy class

SAP.Equi_get_Notif_Request req = new SAP.Equi_get_Notif_Request(); //Request Class

req.Equipment = SAPID;

req.Date = Calendar1.SelectedDate;

System.Net.CredentialCache ch = new System.Net.CredentialCache();

//Adding Credentials for authentication on webservice server

System.Net.NetworkCredential cr = new System.Net.NetworkCredential("xisuper", "infotech");

ch.Add(new Uri(ser1.Url), "Basic", cr);

ser1.Credentials = ch; // Assing this Credential to the

ProxyClass.Credentials property as shown here

SAP.Equi_get_Notif_ResponseNotifications[] res = ser1.Equi_get_Notif(req); //Call

the webservice, res is the responce object

GridView1.DataSource = res;



catch (Exception ex)





0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question