cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a web service

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos

Jai,

Why dont you use a simple free webservice for this?

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

Regards,

Bhavesh

Former Member
0 Kudos

Bhavesh,

I did a search in the forum and found your replies which directed me to free web services. But I thought it will be better if I can develop a simple web service first, to understand the logics....

Thanks & Regards,

Jai Shankar.

bhavesh_kantilal
Active Contributor
0 Kudos

jai,

Try using a simple webservice , free webservice and then move to the process of creating a Webservice if this is just for learning purposes.

Just my 2 cents

Regards,

Bhavesh

Former Member
0 Kudos

Thank you all for the help...

Thanks & Regards,

Jai Shankar.

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

Former Member
0 Kudos

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.