javaweb-servicesjax-wsjava-ee-5netweaver

How to write a web service for a Java NetWeaver 7.5 via NWDS?


I have both ABAP ECC6.0 and SAP AS Java NetWeaver 7.5 and it is the AS Java portion I have a question about: I need to automate the import of role data into the portal.

Currently person 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 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? Suggestion how to do a RESTful web service are also welcome.


Solution

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

    First off, thanks to Suncatcher for his response. I did use the "Java EE" perspective in Eclipse, and I didn't see the "Web Service" option in the context menu. If you have any thoughts on why this would be or suggestions on another perspective to use, I would love to hear about it. As a result of this, my process doesn't match the process given in the link you posted, but it does seem to work.

    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.

    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.