cancel
Showing results for 
Search instead for 
Did you mean: 

How To Develop a Simple WebService App XI Scenarios

Former Member
0 Kudos

Hi,

How can I develop A simple Webservice for any scenario, for example, if am doing File to file scenario, and i want to develop a Webservice for the same scenario,

I think in ID we have an option Under Tools "Define Webservice" where in we can use wsdl format of the message interfaces.

How should i proceed to develop the Webservice?

Regards,

Varun

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi varun

we can develop webservice using NETWEAVER DEVELOPER STUDIO

check this thread with same issue

regards

kummari

Answers (9)

Answers (9)

Former Member
0 Kudos

Dear Varun,

In Integartion Directory, Tools----


>Define Webservice. There u specify sender namespace and sender interface name, and sender service. Then it will generate the wsdl file and save it.

After that follow the below link.Hope this will be useful.

http://www.riyaz.net/blog/index.php/2007/12/11/xipi-consuming-xi-web-services-using-web-dynpro-part-....

Former Member
0 Kudos

Hi,

Check this whole Disscussion for better Understanding

Regards

Seshagiri

Former Member
0 Kudos

Hi,

Please go through the saptechnical, you can find lot of examples with screenshots.

Netaji.B

Former Member
0 Kudos

Defining and Develop Webservice is same, as u need to define the same in ID.

for Consuming the Webservice u need a Web Service Client, in which can be done using XML SPY something like that.

varun_k
Contributor
0 Kudos

Hi,

I want to develop using Microsoft VS.

Can I make use of the Message Interfaces wsdl format and develop webservices in Microsoft VS.

Regards,

Varun

prateek
Active Contributor
0 Kudos

Can I make use of the Message Interfaces wsdl format and develop webservices in Microsoft VS.

There is some understanding problem. When u create a wsdl in ID, it means webservice is hosted at XI and the sender system is a SOAP client, which uses this wsdl generated at XI to call the XI webservice.

U can create a SOAP client in Microsoft VS in this case.

Regards,

Prateek

Former Member
0 Kudos

Hi Varun,

After creating the wsdl file u can deploy using MS visual studio.

Follow the steps and run the scenario.

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);

}

}

"Award points if it is helpful"

Former Member
0 Kudos

discarded

Edited by: Raghu on Aug 12, 2008 2:41 PM

santhosh_kumarv
Active Contributor
0 Kudos

Hi Varun,

Check this Step by Step Guide.

[How to Develop a Webservice Using NWDS and SAP XI.30 |https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/5f3ee9d7-0901-0010-1096-f5b548ac1555]

Thanks

SaNv...

prateek
Active Contributor
0 Kudos

How can I develop A simple Webservice for any scenario

For a complete scenario, u cannot create a single webservice.

I think in ID we have an option Under Tools "Define Webservice"

This is just to expose a single message interface as webservice and Not the entire scenario.

What u may do is to create a SOAP client with a button send, on pressing which u can trigger the transfer of data.

Regards,

Prateek

Former Member
0 Kudos