Chris
Chris

Reputation: 321

SOAP Web Service in GlassFish Java EE Application

I have built a SOAP web service using JAX-WS annotations per Java EE guidance.

@WebService( name = "PersonDataExposureService" )
public class PersonDataExposureWebServiceBean {
...
@WebMethod
public PersonList retrieveAllPeople() { ... 
    // get the data and return it ... 
}
... more methods ...
}

The web service is deployed to GlassFish in a Java EE Application built in NetBeans using the NetBeans wizard. The application deploys and the UI is rendered and is functional, in the same WAR as the web service.

I am trying to verify the availability of the SOAP web service based upon some examples in the Java EE documentation using...

http://localhost:8080/DemoApplication-war/PersonDataExposureService?wsdl

or

http://localhost:8080/DemoApplication-war/PersonDataExposureService?retrieveAllPeople

where DemoApplication-war is the WAR produced by the NetBeans Java EE wizard.

I am getting an error:

HTTP Status 404 - Not Found

type Status report

message Not Found

description The requested resource is not available.

How can I get the WSDL and web service method to render directly in the browser by accessing the web service directly through the URL?

What am I doing wrong?

Upvotes: 0

Views: 825

Answers (1)

Chris
Chris

Reputation: 321

Invoking the "Test Web Service" for the PersonDataExposureService node of the "Web Services" section of the navigation tree for the WAR in the NetBeans IDE produces:

http://localhost:8080/DemoApplication-war/PersonDataExposureWebServiceBeanService?Tester

This allows direct testing of the web service interface from the browser.

The WSDL can subsequently be accessed by using:

http://localhost:8080/DemoApplication-war/PersonDataExposureWebServiceBeanService?wsdl

The redirected naming is a little confusing, but it works. It is not really clear why an additional "Service" is appended to the web service name. If somebody could provide additional clarification on the generated names, this would be helpful.

Upvotes: 0

Related Questions