accessing wsdl on Tomcat

前端 未结 1 1750
清歌不尽
清歌不尽 2020-12-28 19:21

I have a web service and I was deploying it on GlassFish. I accessed its wsdl through http://localhost:10697/APIService/APIServiceService?wsdl.

Now I ported the WAR

1条回答
  •  囚心锁ツ
    2020-12-28 20:08

    The way to access a WSDL is not really container specific, it's more WS-stack specific. The WS-stack in GlassFish is Metro (Metro = JAX-WS RI + WSIT). Did you install/deploy Metro or JAX-WS RI on Tomcat? See Metro on Tomcat 6.x or Running JAX-WS Samples with Tomcat 6.x (JAX-WS RI might be enough in your case) for the steps.

    Update: You need to declare the WSServlet in the web.xml (see Deploying Metro endpoint):

    
    
      
        
        com.sun.xml.ws.transport.http.servlet.WSServletContextListener
        
      
      
        WebServicePort
        
        com.sun.xml.ws.transport.http.servlet.WSServlet
        
        1
      
      
        WebServicePort
        /services/*
      
      
        60
      
    
    

    And then in the sun-jaxws.xml (also packaged in WEB-INF), declare your Service Endpoint Interface (SEI):

    
    
      
    
    

    And you access the WSDL at:

    http://localhost:8080//services/hello?wsdl
               A               B         C       D
    
    • A is the host and port of the servlet container.
    • B is the name of the war file.
    • C comes from the url-pattern element in the web.xml file.
    • D comes from the ending stem of the url-pattern attribute in the sun-jaxws.xml file.

    0 讨论(0)
提交回复
热议问题