Problem when 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 have trouble testing it. The IDE that I am using is Netbeans and the service was done using the assistant provided by the IDE. The application deploys correctly on a GlassFish server and the web service that I am implementing is exposed appropriately. The generated WSDL address is:


The problem occurs when I want to try the service by changing the URL to link , link that should show me a page for enter the necessary data to test the service, but redirects me to the information page of the endpoint ( link ). In the file struts.xml I have already indicated to Struts that exclude the routes / webServices / * 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 -->

Anything additional I have to add to exclude the URL and to be able to prove the web service or I have something bad in the regular expressions ?. I have already tried the service using SoapUI and the like, but I would like to be able to perform the tests from the browser through the URL.

asked by dwarandae 04.12.2015 в 23:44

1 answer


Glassfish uses the servlet org.glassfish.webservices.JAXWSServlet internally. It finds 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 by 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, simply write down the class that implements the web service with @WebService without the need to map any servlet And then you will have the test page available. *

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

answered by 05.12.2015 / 04:25