- This topic has 5 replies, 3 voices, and was last updated 17 years, 8 months ago by Russ.
-
AuthorPosts
-
RussMemberI have a simple web service which I built from the top-down approach using an existing WSDL. I am using Version: 5.1.0 GA Build id: 20061111-5.1.0-GA for MyEclipse. I am able to build the application, deploy it, and run it with a simple client I have created. When I try the same service using the Web Service Explorer within MyEclipse I am getting a http 404 error. When I go looking for the WSDL within my browser, the server displays the WSDL without a problem.
This is the code I have working that is hitting the web service:
public String callWebService(String userId, String taskId) throws MalformedURLException, Exception { //Create a metadata of the service Service serviceModel = new ObjectServiceFactory().create(WebServiceBean.class); System.out.println("callSoapServiceLocal(): got service model." ); //Create a proxy for the deployed service XFire xfire = XFireFactory.newInstance().getXFire(); XFireProxyFactory factory = new XFireProxyFactory(xfire); String serviceUrl = "http://localhost:8080/MyWebService/services/TheWebService"; WebServiceBean client = null; try { client = (WebServiceBean) factory.create(serviceModel, serviceUrl); } catch (MalformedURLException e) { System.err.println("WsClient.callWebService(): EXCEPTION: " + e.toString()); } //Invoke the service String serviceResponse = ""; try { serviceResponse = client.getTaskDetails("userId","blah blah"); } catch (Exception e){ System.err.println("WsClient.callWebService(): EXCEPTION: " + e.toString()); serviceResponse = e.toString(); } System.out.println("WsClient.callWebService(): status=" + serviceResponse); //Return the response return serviceResponse; }
Any suggestions guys?
Thanks as always for your suggestions!
Russ
Brian FernandesModeratorRuss,
Quick question, does the WS Explorer show up at all and 404 only when you attempt to connect to your web service? Or do you see a 404 error the moment you open the WS Explorer?
What URL do you type into the WS Explorer and on what page?
RussMemberSorry, I did not say it explicitly… but the 404 shows up when I try to run the service by calling the same method..
I am finding the WSDL and calling the specific method on the web service. I am passing the same parameters as I do in the client code.
RussMemberI wanted to test this to be sure….so the results are the same…..
When I cal from the client you can see the URL is
"http://localhost:8080/MyWebService/services/TheWebService";
When I call from the Web Service Explorer the URL is:
http://localhost:8080/MyWebService/services/TheWebServiceBean";
I was thinking the problem could be just a simple name change, so I tested that too.
http://localhost:8080/MyWebService/services/TheWebService";
The above URL was added as an authorized endpoint. In either case, the Web Service Explorer was returning a http 404 error for both URLs.
When I go look at the services file, the name was
TheWebService
When I go look at the JSR 181 annotations for the declaration for the web service, I see
TheWebServiceBean
Russ
nvenkataraoMemberI think you are not pointing to the exactly where service is configured….like
http://localhost:8080/MyWebService/services/TheWebServiceBean check this url once “TheWebServiceBean” this should match with your service.xml file configured service name…..check once…
RussMemberThe problem was the services.xml did not have the correct style/use combination.
-
AuthorPosts