Skip to Content
avatar image
Former Member

How To Develop a Simple WebService App XI Scenarios

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

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

10 Answers

  • Best Answer
    avatar image
    Former Member
    Aug 12, 2008 at 08:43 AM

    hi varun

    we can develop webservice using NETWEAVER DEVELOPER STUDIO

    check this thread with same issue

    How to develop webservice using Netweaver Developer studio

    regards

    kummari

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2008 at 08:48 AM
    Add comment
    10|10000 characters needed characters exceeded

  • Aug 12, 2008 at 08:55 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Aug 12, 2008 at 08:56 AM

    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...

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2008 at 09:06 AM

    discarded

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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2008 at 09:10 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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"

  • avatar image
    Former Member
    Aug 12, 2008 at 09:23 AM

    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.

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2008 at 09:30 AM

    Hi,

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

    Netaji.B

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2008 at 10:11 AM

    Hi,

    Check this whole Disscussion for better Understanding

    Implementing Webservices Doubt

    Regards

    Seshagiri

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Aug 12, 2008 at 10:47 AM

    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-ii.

    Add comment
    10|10000 characters needed characters exceeded