cancel
Showing results for 
Search instead for 
Did you mean: 

Build a web service with NWDS 7.5 for netweaver 7.5

rj4943
Discoverer
0 Kudos
834

I have recently started working in SAP part of the time. I believe our system is a little old by SAP standards--I think it's ECC6.0. The NetWeaver version is 7.5. We have both ABAP and SAP AS Java, and it is the AS Java portion I have a question about. I have been looking for a way to automate the import of role data into the portal. Currently, someone takes the file each day and uploads it using the import function in the portal. It is my understanding that SAP AS Java supports building web services, and I see that there are SAP java functions for accessing the UME, so my thought was to build a Java web service to do this. I have downloaded NWDS 7.5, and because I read that NetWeaver uses JAX-WS, I built a JAX-WS web service.

The problem I'm having is that I have no clue as to how to deploy the service/get it running/access it. When I try to find info in google, I come up with quite a few relevant hits, but many of the functions they talk about in NWDS don't seem to exist in the version I have. For example, one thing I commonly see is to use the "Web Service" option from the context menu of the java class you want to turn into a web service. My context menus don't have this option; they have mostly the standard options you see in Eclipse, with a few additions.

I did get my web service to deploy via NWDS via the deploy perspective, but while I can see the application on the server, I don't seem to be able to access it. Using https://host:port/web-service-name produces a directory listing that does not include my java classes. Also, I'm unsure as to whether I should deploy my application as a .war or a .ear, maybe that's part of the problem too? I have deployed to the server with both. Also, as someone who's familiar with deploying to Tomcat, I'm really not sure what's needed to get the SAP server to work with my app. The server complained, for example, about web.xml in the archive, and I'm not sure what to do about it.

All in all, I'm pretty confused. Does NWDS 7.5 still have support for building AS Java web services? Does it work differently from prior versions? What do I need to do to get this to work? Also, if there's a way to do a RESTful web service, that would be welcome.

Accepted Solutions (1)

Accepted Solutions (1)

rj4943
Discoverer

So, as these things often seem to go, I had a big breakthrough and solved this problem a couple weeks after posting this question, the question I posted after months of struggling with this issue. Here is what I did to make things work; I haven't meticulously gone through what I did to make sure what I'm posting is accurate; I'm just going off what I remember, if there are inaccuracies, hopefully this Will at least be enough to get someone on the right track. If you have issues or questions with this process, please do contact me.

One thing I wish I would have understood is that SAP already has JAX-WS up and running for you. Everything is configured, and SAP will take care of configuring your class to run as a JAX-WS web service. All SAP is expecting is a class who's source code has been annotated with the appropriate JAX-WS annotations. Items like web.xml are not needed.

  • Create a new EJB 3.0 project for your web service. Make sure your web service class and its methods have the appropriate JAX-WS annotations. (There are EJB annotations added as well, and I'm not sure whether or not they are needed. I left them in.)
  • Create an "Enterprise Application Project". This will be used to build the EAR that contains your web service project. As you create the project, make sure to select your web service project to include in this project.
  • Right-click the project you just created and click "export"; select the SAP EAR option.
  • Use the deploy perspective of NWDS to deploy your EAR.

I had trouble finding the address of my web service. I used the "WS Navigator" feature to find it.

Once you have your web service up, you have the address, and you can successfully retrieve a WSDL, you can generate a client for it.

Answers (0)