users@glassfish.java.net

Trouble creating Webservice from existing WSDL

From: <glassfish_at_javadesktop.org>
Date: Wed, 04 Feb 2009 18:28:19 PST

Here's my problem:

I have an existing, reasonably large, project. It's recently been migrated to Glassfish, which went very well, and had no major problems. That was good.

One of the things I need to do, now that it's been migrated, is to build a web service for it. The way we did this was build the WSDL first to get agreement on it with the client and such, then started coding it.

This is where my problems start. For the record, I'm using Eclipse Ganymede (not switching to Netbeans, so NB instructions aren't going to be much use), and Glassfish V2 UR2.

I was able to get the web service working as a servlet, sort of, but Glassfish wasn't recognising it as a web service, so now I'm trying to get it working in such a fashion that Glassfish will recognise it, and it will be visible under the Webservices menu in the Glassfish admin page.

The project is currently a WAR file. I have, in WEB-INF, the files web.xml, sun-web.xml, and webservice.xml. Currently, I'm getting the error message "DPL5041:Unknown port-component-name <port-component-name text> port, all sub elements will be ignored" - anyone have the faintest idea why I'm getting that?

As far as I'm aware, the port-component-name is unique. I've tried setting it to the <portType> name and the <service>/<port> name in the WSDL, but neither works. It's looking in the sun-web.xml file, and then giving me that error message. I'm not sure if it's seeing the webservice.xml file. It sounds like it's trying to look up the port-component-name somewhere, but where?

I've used wsimport to generate the Java files from the WSDL, and that seemed to work smoothly. I've attached the class I created manually to implement the interface generated by the WSDL. Does that look right to everyone?

The Web Service gets compiled into a JAR and placed into the lib directory of the WAR - will that present a problem? Should I move to an EAR instead? If so, what changes would that require to get the web service working as expected?

I've attached the WSDL, web.xml, sun-web.xml and webservice.xml files, though I've removed bits which I believe aren't relevant, and also removed all bits which are company-specific.

So, what am I missing?

I would prefer instructions that do not rely on an IDE, as that will make it easier for me to understand what the hell I've missed.

I've been hunting all over the web for hints on how to do this, but most assume you're using NetBeans (which I'm not), and that you'll be going from Java to WSDL, which I'm also not. I'm going from WSDL to Java.
[Message sent by forum member 'ipsi' (ipsi)]

http://forums.java.net/jive/thread.jspa?messageID=330212