I hope this problem is extremely simple and it's just me being an idiot. I am new to SOAP and am attempting to set up a SOAP WebService (using Java and Spring) and then using the tool SoapUI I attempt to send a SOAP request to my Web service. However I always get 404 Not Found errors when I submit my request. I suspect / hope that I have just set my Endpoint incorrectly in SoapUI, but I don't know what value I should be putting there. Can anyone help?
These are the steps I have taken to setup my WebApp with SOAP support:
1) I am using an existing WebApp (which has existing REST Web Services) running in Spring Tool Suite (which is based on Eclipse) and using Jetty. In my web.xml file I added a new SOAP Web Service:
SOAPWebService
/ws/SOAP/*
SOAPWebService
org.springframework.ws.transport.http.MessageDispatcherServlet
transformWsdlLocations
true
1
2) I created a new class "ProjectSearchEndpoint" which has an annotation of @Endpoint. The payload root = @PayloadRoot(namespace = "http://FOO.FOO/foo", localPart = "ProjectRequest")
3) I added the DSD to the WEB-INF of my WebApp: ws-project.xsd
4) I created a servlet XML file called: SOAPWebService-servlet.xml which references the DSD
NOTE: the endpoint code and DSD come from the blog: http://javaclue.blogspot.co.uk/2012/05/soap-web-service-using-spring-ws-20.html I edited the namespace to make it "http://FOO.FOO/foo" but apart from that the code is the same although I have added System.out lines to show when the object is constructed (it is) and when the "searchProjects" method is invoked (it never is).
I can start my webApp successfully and if in my browser I navigate to the URL:
http://localhost:8080/MyApp/ws/SOAP/projectSearch.wsdl
I get to see the WSDL. All good so far.
When I use SoapUI I create a new project and pass in the WSDL. SoapUI seems happy. I ask for a request and SoapUI creates a Soap Envelope with my ProjectRequest in it. Everything is going very well! However to submit this request SoapUI wants an Endpoint. I think my endpoint is:
http://localhost:8080/MyApp/ws/SOAP/
but this just returns a 404 not found. Trying other combinations such as
http://localhost:8080/MyApp/ws/SOAP/projectSearch
http://localhost:8080/MyApp/ws/SOAP/projectSearch?wsdl
http://localhost:8080/MyApp/ws/SOAP/ProjectRequest
all result in 404. What is my endpoint? What value should I be putting into SoapUI?
Update 1
For clarity this is what I am doing in soapUI
Having started soapUI, I create a "new soapUI Project". The name is A1. The Initial WSDL is:
http://localhost:8080/MyApp/ws/SOAP/projectSearch.wsdl
also "Create Requests" is ticked in the dialog box.
I click OK and it creates a ProjectSearchSoap11 (with an icon of a green I next to it) with a single Project underneath it (icon of red arrows) and under that "Request1" (icon the word SOAP). I right-click Request1 and select "Show Request Editor". This displays a window with a SOAP envelope and my namespace and ProjectRequest. This all looks good.
I now want to click "Submit request to sepecified Endpoint URL" (green arrow at top-left) but this is greyed-out until I specify an endpoint (to the right). I click on the endpoints drop-down and select "edit-current". A dialog appears. I enter:
http://localhost:8080/MyApp/ws/SOAP/
and click ok. Now the run icon is enabled (green). Clicking this icon then results in a "response" window appearing, which is blank, but the raw data is:
HTTP/1.1 404 Not Found
Content-Length: 0
Server: Jetty(6.1.26)
I am guessing that the endpoint I am choosing is wrong. Can you confirm that this is the wrong format or I'm missing a suffix of some kind. If you think it's correct then it must be my setup on the web application that is at fault.
Thanks,
Phil