on 09-04-2008 9:48 AM
Hi,
Can any one explain how to do integration with .Net and SAP using XI.
and also wat are the steps to be done at .Net side.
Regards,
shaik
If Hi,
.Net: Use Soap Adapter ( Sender)
SOAP : RFC/ABAP Proxy ( Synchronous)
At SAP XI Side.
Step1 :
Using RFC :
Import RFC in IR
Step 2:
Create the DT,MT & MI(Synch-Outbound) in IR( .Net)
Step 3:
Message mapping for Req and response
Step 4:
Message Interface
Step 5:
ID
Configure Sender and receiver adapter
Step 6:
.
Create webservice for sender ( Integration Directory ->tools ->define webservice.
It will generate the webservice and save it as .wsl file.
Step 7:
Use the wsdl file in java to send the data to XI from Java
Do some programing in .Net.
At .Net side
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 Prompt
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 called
6.) If your Client application is a web application, the see if the website has a folder called "App_Code"
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
eg:
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.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name = "Equi_get_NotifBinding", Namespace = "http://Equipment_Get_Notifications")]
public partial class Equi_get_NotifService : System.Web.Services.Protocols.SoapHttpClientProtocol
{
functions....
........
.......
}
}
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
eg:
private void GetNotifications()
{
try
{
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;
GridView1.DataBind();
}
catch (Exception ex)
{
Response.Write(ex.Message);
}
}
.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.