Skip to Content
Author's profile photo Raj Thukiwakam

How to integrate .NET Microsoft Applications and SAP ECC using SAP Process Integration

This blog is going to discuss about how to integrate .NET Microsoft applications and SAP ECC using SAP PI, how they will implement code in .NET environment to send request to SAP PI.

We have diffeent options to integrate .NET applications and SAP Systems.

Using SAP .NET connector without using middleware’s .

The SAP .NET Connector is a development environment that enables communication between the Microsoft. NET platform and SAP systems. This connector supports RFCs and Web services, and allows you to write different applications such as Web form, Windows form, or console applications in the Microsoft Visual Studio.Net. With the SAP .NET Connector, you can use all common programming languages, such as Visual Basic. NET, C#, or Managed C++.

Refer below SAP help document to know more about the SAP .NET connector.

Using SAP NetWeaver Gateway,

Refer Below link to know more about SAP NetWeaver GateWay

Recently I had done integration of the .NET Microsoft application and SAP ECC 6.0 using SAP Net weaver Process Integration 7.1 EHP1.

Refer below blog to choose the Right Adapter to integrate with SAP systems; it gives clear picture how to integrate SAP Systems using SAP PI with different approaches.

How to send the request from .net Application to SAP PI.

PI development process is same as any normal interface, get wsdl/xsd for both request and response structures or define data types manually if the interface is synchronous, asynchronous case you don’t required response structures., then complete ESR part(message type,service interfaces ,message and Operation mappings).

Create SOAP sender communication channel and receiver side (RFC/Proxy/IDoc) then complete configuration in ID and test your development in PI point of view. After that publish your sender agreement in Service registry and provide WSDL URL to .NET application team.

Refer below my blog how to publish service in service registry and how to test interface using WS Navigator.

.Net Application team expects WSDL and Service URL from PI Team.

After publishing the sender agreement in service registry (SR)  automatically WSDL URL will be generated share WSDL or you can share the WSDL file by selecting an option display WSDL in Sender agreement.

But the best approach is providing WSDL URL to .NET team because if any structural changes in request/response strcutures then  just publishing the sender agreement in Service registry will automatically update with new structure and WSDL URL remains same ,.NET team have to refresh their environment once to view the new structure.

if you provide WSDL file manually then you have take WSDL file for new structure and have to send one more time (Via Mail),AFAIK it’s not a right approach.

.NET have WCF programming platform to send request to PI,WCF is the place where exactly coding will be done.

Windows Communication Foundation (WCF):

Windows Communication Foundation is a programming platform and runtime system for building, configuring and deploying network-distributed services, Interoperability is the fundamental characteristics of WCF. It is unified programming model provided in .Net Framework 3.0. WCF is a combined feature of Web Service, Remoting, MSMQ and COM+. WCF provides a common platform for all .NET communication.


After providing the WSDL and Service URL to .net team, first they will add WSDL in their WCF environment;

PS: Make sure that WSDL URL should be accessible in .NET environment.




Enter the PI credentials and click on the ok. If SAP WSDL find then it will display the following data, now WSDL structure will be available in WCF environment.



They will Name the service in “Namesapce” section. The Service will add under App_WebReferences section with given name in Namesapce.Then Go to Web.config page in ASP.Net Application and add end point address is nothing but service url.

<endpoint address=”



Final step is writing code in coding section in the application, they will add code to access the SAP methods.

SAPServiceName.IXXXXX_OutClient objClient = new SAPServiceName.IXXXXX_OutClient();

objClient.ClientCredentials.UserName.UserName = “***UserName***”;

objClient.ClientCredentials.UserName.Password = “***Password***”;



1)  In Sync scenarios if response message structure payload huge means sometimes .Net team may face time out expcetions, they have to change theIR configuration details in their environment to accept huge payload as a response.

2)  PI point view make sure that SAP System returns response within expected time.

Assigned tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      Nice, Clear and to the point!
      It will be nice if you can include few lines about the Business Scenario you had in case ..
      Author's profile photo Former Member
      Former Member
      Another question is how to call .NET services (example Sharepoint service) from SAP PI. By default IIS Server use NTLM v2 authentication. My solution is using Java-proxy and Java SPNEGO technology.
      Author's profile photo Former Member
      Former Member
      I think..We have been doing the same think..

      But I don't know does this approach avoiding the XI and directly connecting to the PI system.

      I'm not a SAP person.. I'm a .Net Architect..


      Author's profile photo Raja Sekhar Reddy
      Raja Sekhar Reddy
      Blog Post Author
      XI/PI both same 🙂
      Author's profile photo Former Member
      Former Member
      Hi Raja,

      Interesting insight on the PI / .NET integration, and this could be useful to many. However, this kind of integration is a bit too heavy for what it's meant to do.

      Wouldn't it be leaner to use rather ODATA (Rest) ? I would most probably be less costy in terms of efforts and resources. Gateway can be deployed as an add-on to an existing system now (7.0 EHP2 supported only today but 7.03 and 7.3 + 7.01 and 7.1 to come over the next quarters).

      You've had just a quick mention of Gateway, but might be interesting to compare both solutions for the same usage.

      Author's profile photo Former Member
      Former Member
      HI Raja,

      Good blog, as far as i know this is a known process and we have implemented it in 2009. Only thing which is more important, when we capture the Runtime Exception in .Net application say on communication failure, Mapping error etc., There will be two options. One you cature the main brief exception or 2nd you capture the whole detailed inner exception. But most of the business scenarios are where end user can extract the report. Now they are able to see the technical error which is not relevant to them.

      Now i would like to see if you can elaborate more on this area, so that a meaningful message can be written to Business and an actual error can be given to PI support.


      Author's profile photo Former Member
      Former Member
      Alok Sharma,

      There is known issue with PI that returns the following exception

      "The one-way operation returned a non-null message with Action=''."

      You can catch this exception using System.ServiceModel.ProtocolException..

      The error message is ""The one-way operation returned a non-null message with Action=''."

      More description of this error:
      // == Suppressed this exception==
      // Caused by a SAP/SOAP HTTP 202 response message with no content being
      // returned to the .Net asynchronous web service call. The .Net Framework
      // does not accept the null on the response packet and throws the exception.
      // The SAP/SOAP webservice call is successful in this case, however, and
      // the exception can be ignored. SAP has a patch detailed on released
      // Note 1459995 to correct this issue.

      And you can catch any other protocal exception using the same object.. System.ServiceModel.ProtocolException..

      For all another exception, we are following the normal exception catch..