2012年10月2日 星期二

[Link] Consuming SAP Web Services and .NET



CONSUMING PROXY IN .NET CLIENT
Follow the steps to create and read the data by using the proxy. 
  1. Add a new 'ASP.NET Web application' to the SAPDotNetIntegration solution. And name it as AspDotNetClient.
  2. Add the reference to the SAPWebServiceProxyLibrary.dll compiled and saved on the disk. By right clicking on the AspDotNetClient, and clicking on the 'Add reference context' menu.
  3. Add the following statement to the code behind using SAPWebServiceProxyLibrary.CustomerMasterNamespace;
  4. Following are the basic lines of code to be written to asscess the data from SAP system. //Creating the Service ZSN_WEBSERVICEService_proxy = new ZSN_WEBSERVICEService();//stores the return row XML data from the SAP web service String outData; //Setting the User Credentials _proxy.Credentials = new NetworkCredential("loginName""password");//We have a stateful communication therefore we have to use a //CookieContainerCookieContainer _cookie = new CookieContainer();_proxy.CookieContainer = _cookie;// p_filepath_app is the input parameter to identify the specific SAP web // service outData = _proxy.ZsnWebservice("xmlfilepathonthesapserver");