Skip to Content
author's profile photo Former Member
Former Member

Creating a web service

Hi All,

I wanted to try a simple HTTP-SOAP scenario for my understanding. I tried to create a simple web service with ref to blog /people/siva.maranani/blog/2005/09/03/invoke-webservices-using-sapxi by Siva.

I got stuck while creating the ear file. I am using NWDS. I created a simple Java Class and created the web service for it. But I cant create a .ear file from that. Can you pls help me out....

Thanks & Regards,

Jai Shankar.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    Posted on Oct 16, 2006 at 11:46 AM

    Jai,

    Why dont you use a simple free webservice for this?

    http://webservices.iter.dk/calculator.asmx

    Regards,

    Bhavesh

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 11:29 AM

    Hi,

    First start by creating a EJBModule project.

    Inside that project create a package if you want. Then it should contain all the EJB classes. Then edit ejb-jar.xml with the class names. Now right click on the project name and build EJB archive. Now again create a enterprise application project. Here it will ask for the EJB archive. Specify the archive tou have created above. Now again right click on the enterprise application project and give build EAR. Now the EAR file is ready.

    Thanks and Regards,

    Sudheer.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Sudheer,

      >>>Then edit ejb-jar.xml with the class names.

      Can you explain me this step? How can I add the class names to source xml file? My Java file name is WsDemo.java.

      Thanks & Regards,

      Jai Shankar.

  • author's profile photo Former Member
    Former Member
    Posted on Oct 16, 2006 at 11:46 AM

    Hi

    Try this

    Step 1:

    Careate The Java Project With The Logic.

    Step 2:

    I.Create an EJB Project .

    (i) Add the Project reference of the java project created.

    (ii) create the StateLess Session Bean

    (iii) click the ejb-jar.xml and Dblclick the Bean and go to the method tab

    (iv) create the business method and save the bean class. Inside the method

    do the following code coressponding for the application

    (eg)

    public TaskParameterBean[] getTask(String parameter, String taskOrginId) {

    // TODO : Implement

    TaskParameterDBBean data=new TaskParameterDBBean();

    List li=data.getTask(parameter,taskOrginId);

    int size=li.size();

    TaskParameterBean[] resultbean=new TaskParameterBean[size];

    for(int i=0;i<size;i++){

    resultbean<i>=(TaskParameterBean)li.get(i);

    }

    return resultbean;

    }

    II.Create An Enterprice Application Project

    (i) add the EJB Project to this Project

    (ii) Create Archive and Deployee to server

    Step 3:

    Create the webservice threw the right click the bean and new -> WebService

    Deployee the EJB model , EAR and deployee the project.

    Step 4:

    Create a new Deployable Webservice Project and add the client sadl file from

    the local server. And Create Archive and deployee the EAR.

    Test the webservice.

    see this help

    http://help.sap.com/saphelp_nw2004s/helpdata/en/08/11703e5da3e946e10000000a114084/frameset.htm

    Kind Regards

    Mukesh

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.