java – Problem testing a SOAP web service


I am implementing a SOAP web service in Java in an application that uses Struts in the presentation layer and I am having trouble testing it. The IDE I am using is Netbeans and I did the service using the wizard provided by the IDE. The application successfully deploys to a GlassFish server and the web service I am deploying is properly exposed. The address of the generated WSDL is:

http: // localhost: 8080 / Medications / webServices / TestWSDL? WSDL

The problem occurs when I want to test the service by changing the URL to http: // localhost: 8080 / Medicamentos / webServices / TestWSDL? Tester , link that should show me a page to enter the necessary data to test the service, but it redirects me to the page endpoint information ( http: // localhost: 8080 / Medicamentos / webServices / TestWSDL ). In the struts.xml file I have already told Struts to exclude the / webServices / * routes so that they are handled by the servlet in charge of the web service:

<constant name="struts.action.excludePattern" value="/webServices/.*"/>

My web.xml file:

<!-- Spring/Hibernate conf -->
<!--Struts filter and interceptor -->

<!-- Sticky session -->

Do I have to add something extra to exclude the url so that I can test the web service or do I have something wrong with the regex ?. I have already tested the service using SoapUI and the like, but would like to be able to test from browser via URL.


Glassfish internally uses the org.glassfish.webservices.JAXWSServlet servlet . It looks for two strings in the query-string of the request URL:

  • endpoint ? Tester : This forwards the request to another servlet , org.glassfish.webservices.monitoring.WebServiceTesterServlet , which generates a client with wsimport from the WSDL obtained with a request adding ?WSDL to the URL and generates the HTML for the test page .
  • endpoint ? WSDL : This generates the WSDL using an instance of and writes it to the request.

However, in your case, you have registered the and the , which does not have that option.

If the Glassfish you are using supports Java EE 6 or higher, just write down the class that implements the web service with @WebService without the need to map a servlet . And then you will have the test page available. *

* It is important to disable this option in productive environments, either through the sun-web.xml file or sun-ejb-jar.xml specifying false in the debugging-enabled element.

Scroll to Top