Search code examples
javaeclipseweb-servicestomcatwsdl

Not able to open WSDL in browser


I created a simple java program like below,

import javax.jws.WebService;

@WebService
public class testing {
public static void main(String args[]){
    System.out.println("hiiii");
}
}

Then i created a web service from this in eclipse which was

<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="testingService" targetNamespace="http://service.xms.com/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://service.xms.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
  <wsdl:portType name="testing">
  </wsdl:portType>
  <wsdl:binding name="testingServiceSoapBinding" type="tns:testing">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  </wsdl:binding>
  <wsdl:service name="testingService">
    <wsdl:port name="testingPort" binding="tns:testingServiceSoapBinding">
      <soap:address location="h..p://loca...st:8080/XMSExpenseServicePROD/services/testingPort"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Now when i open h..p://loca...st:8080/XMSExpenseServicePROD/services/testingPort?wsdl in browser, it gives me 404 error, The requested resource is not available... What is wrong in my program here or where i am going wrong. Plese help.

This is not the exact issue, issue was in a different project but after investigation i found, i am not able to even open this url in browser which is generated by eclipse. I am not able to figure out where i am going wrong. Can anyone help?

enter image description here

enter image description here


Solution

  • Is:

    <soap:address location="h..p://loca...st:8080/XMSExpenseServicePROD/services/testingPort"/>

    actually defined in your xml with that URL? If you are omitting any of your config, can you post the whole config?

    What is running on localhost:8080, is this from Tomcat? Do you have the tomcat log output?

    What's the project directory structure?