cancel
Showing results for 
Search instead for 
Did you mean: 

Can I expose a standalone Java class as a Web Service

Former Member
0 Kudos

Hi all,

I have an external application which generates a client as a simple Java class.

Now I need to access this class in my Composite Application, for that purpose I need to expose it as an Web Service.

So is it possible to expose a simple Java standalone project as a Web Service.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos
Former Member
0 Kudos

Hi Ayyapa,

I did find this documentation.

But it is for NW04s ,in NetWeaver 7.1 there is no Web Service Perspctive.

So is there any solution in NW 7.1

Thanks

Former Member
0 Kudos

Hi Brian,

Here comes the link: http://help.sap.com/saphelp_nwce10/helpdata/en/46/7895c5cb496ef0e10000000a1553f6/content.htm

It's about how to create a Web Service from a servlet based endpoint. Although it's called servlet based endpoint a POJO is used in reallity.

What you need to do:

1. Go to meny: File->New -> Project..., then from the New Project Wizard choose Web/Dynamic Web Project.

2. In the New Dynamic Web Project, fill in the Project Name. Make sure that you associate the project with an EAR. If not existing, just enter a name. Ear will be created for you. Make sure that the target runtime is "SAP Libraries". Click Next.

3. On the "Project Facets" page, make sure that the "Dynamic Web Module" with version 2.5 is selected, so should be Java 5.0 and "SAP Specific Web Module" version 2.5. Click Finish.

4. Copy your file (using copy & paste/drag & drop, or create new file and then copy & paste the content of yours, etc...) into the source folder of the newly created web module. It should be called "Java Resources:src". Make sure your file is in the correct package

5. Proceed as explained in the link

Regards,

Hristo

P.S. you could access the 7.1 CE documentation at http://help.sap.com/saphelp_nwce10/helpdata/en/44/d958673ef05f4de10000000a11466f/frameset.htm

Former Member
0 Kudos

Hi Brian,

I'm not able to fully understand your scenario. However here are some clues that might help:

1. The SAP Netweaver Web Service runtime is available only inside NetWeaver AS. This means that you're not able to get a standalone java application to provide a web service

2. From 1 it follows that you need to somehow package and deploy you externally generated class to NetWeaver AS. There are two options:

- put @Stateless annotations and deploy it as an EJB

- copy the class in dynamic web 2.5 project and deploy it

3. I don't understand whether your class is already annotated with @WebService annotation. If so any of the options in 2 would work. If not use the eclipse wizard to make your class a web service.

Hope this helps,

Regards,

Hristo

Former Member
0 Kudos

Thanks Hristo,

Can you provide me any links on

1. How to copy the file into Web 2.5 project

and

2. How to use the eclipse wizard to make my class a Web Service.

Thanks for all the help..

Brian