cancel
Showing results for 
Search instead for 
Did you mean: 

Web services usng the .NET Connector 2.0

Former Member
0 Kudos

How do I build a Proxy using .NET Connector 2.0 that consumes a Web Service rather than making a remote function call?

All the help files I read make reference to some type of Wizard that is supposed to prompt me for the type of call. Yet I don't ever see that wizard. As soon as I "Add New Item..." and select SAP .NET Connector, I immediately get a SAPProxy1.sapwsdl file added to my project.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Wardell,

All the RFC-enabled function modules are avilable as webservices since WAS 6.20. And if want to consume them through SOAP (webservices) then you do not need .NET connector.

Just ask the system administrator for the R3 Web service repository browser URL. Get the WSDL path. Add Web Reference in Visual Studio by providing WSDL path and that is it.

Regards.

Former Member
0 Kudos

Sorry I'm not agree... An access using JCo or .net proxy is alway faster and safer than a access via the webservice and de soap/rfc service provided by SAP WebAS.

Former Member
0 Kudos

Hi Jerome,

I totally agree with you. Using remote function call through NCo/JCo is always faster.

But read the question posted by Wardell. He does not want to use Remote Function Call and just want to cosume the webservice.

Now as per the security you mentioned, it depends. SOAP and RFC bases communications have their own usage. And by and large depends upon the requirement. You just can't go about suggesting RFC based communication in every situation.

Regards.

Answers (1)

Answers (1)

Former Member
0 Kudos

2 solutions...

1 - You can create web services hosted by IIS with Visual Studio 2003 and .net 1.1. To do you need visual studio 2003, SAP .net connector 2.0, Java JRE, and a framework .net 1.x (included with Visual Studion 2003). You installed VS2003, JRE and finally SAP .Net connector (http://service.sap.com/connector) .. You create your project on Visual Studio on C# or VB.net... You create your web services ... You add a new Item SAP Proxy. On the Server Explorer you add the SAP system. If no icon SAP is visible on Server explorer click on Refresh button + add server.... You add a filter on RFC ... You drag and drop the RFC on the SAP Proxy windows... You rebuild all... And you just have to call your RFC into the code of you're webservice ...

Your code could look like this

		[WebMethod]
		public int updateCounter(string strNumCounter, string strMesure)
		{
			counterResult myResult = new counterResult();
			string strSAPConnParameters="";
			string SAPIP = "localhost"; // IP of the SAP server
			string SAPUser = "BCUSER";		// SAP user, currently a RFC user
			string SAPPassword = "MINISAP";	// SAP user password
			string SAPSystem = "00";		// SAP system 
			string SAPClient = "000";		// SAP client 

			strSAPConnParameters = "ASHOST="+SAPIP+" USER="+SAPUser + " PASSWD="+ SAPPassword +" CLIENT="+SAPClient+" SYSNR="+SAPSystem;
			try
			{
				SAPProxy1 mySAPConnection = new SAPProxy1();
				SAP.Connector.SAPConnection conn = new SAP.Connector.SAPConnection(strSAPConnParameters);
				mySAPConnection.Connection = conn;
				byte iResult;
				mySAPConnection.Zupdatecompteur(strMesure, strNumCounter, out iResult);
				mySAPConnection.Dispose();
				return 1;
			}
			catch(Exception ex) 
			{
				return -1; 
			}

}

2 - If you work on SAP ECC 6. Go to transaction SICF ton activate the webas and the service WSDL and SOAP/RFC... And you go to SE37 you select a RFC and you click on utilities more utilities and you can expose your RFC as a webservice (uses the wizard is piece of cake)

3 - You can also use a EAI as SAP XI, or MS BizTalk, or a toolbox as ERPCONNECT