Class WsUtil


  • public class WsUtil
    extends Object
    Web service related utilities.
    Author:
    Kenneth Saks
    • Constructor Detail

      • WsUtil

        public WsUtil()
    • Method Detail

      • handleGet

        public boolean handleGet​(jakarta.servlet.http.HttpServletRequest request,
                                 jakarta.servlet.http.HttpServletResponse response,
                                 WebServiceEndpoint endpoint)
                          throws IOException
        Serve up the FINAL wsdl associated with this web service.
        Returns:
        true for success, false for failure
        Throws:
        IOException
      • isWsdlContent

        public boolean isWsdlContent​(String uri,
                                     BundleDescriptor bundle)
        All wsdl files and wsdl imported files live under a well-known wsdl directory.
        Parameters:
        uri - module uri
      • getWsdlDir

        public String getWsdlDir​(BundleDescriptor bundle)
        Returns:
        module-specific dedicated wsdl directory
      • generateFinalWsdl

        public void generateFinalWsdl​(URL wsdlFileUrl,
                                      WebService webService,
                                      WebServerInfo wsi,
                                      File finalWsdlFile)
                               throws Exception
        Transform the deployed WSDL document for a given webservice by replacing the ENDPOINT ADDRESS for each port with the actual endpoint address on which it will be listening.
        Throws:
        Exception
      • privilegedGetServiceRefWsdl

        public URL privilegedGetServiceRefWsdl​(ServiceReferenceDescriptor desc)
                                        throws Exception
        Accessing wsdl URL might involve file system access, so wrap operation in a doPrivileged block.
        Throws:
        Exception
      • isJAXWSbasedService

        public boolean isJAXWSbasedService​(WebService ws)
      • raiseException

        public static void raiseException​(jakarta.servlet.http.HttpServletResponse resp,
                                          String binding,
                                          String faultString)
      • getSOAPFault

        public static jakarta.xml.soap.SOAPMessage getSOAPFault​(String protocol,
                                                                String faultString)
      • getWebServerInfoForDAS

        public WebServerInfo getWebServerInfoForDAS()
      • getDefaultLogger

        public static Logger getDefaultLogger()
        Returns:
        the default Logger implementation for this package
      • validateEjbEndpoint

        public void validateEjbEndpoint​(WebServiceEndpoint ejbEndpoint)
      • updateServletEndpointRuntime

        public void updateServletEndpointRuntime​(WebServiceEndpoint endpoint)
      • getWsdlsAndSchemas

        public Collection getWsdlsAndSchemas​(URL pkgedWsdl)
                                      throws Exception
        This implementation is similar to #getWsdlsAndSchemas(File pkgedWsdl, except that this works on URL which makes it easy when the wsdl is loaded from the archive.
        Parameters:
        pkgedWsdl - URL
        Returns:
        Throws:
        Exception
      • getWsdlsAndSchemas

        public void getWsdlsAndSchemas​(File wsdl,
                                       ArrayList<com.sun.xml.ws.api.server.SDDocumentSource> cumulative)
                                throws Exception
        Throws:
        Exception
      • doPostConstruct

        public void doPostConstruct​(Class impl,
                                    Object implObj)
      • configureJAXWSServiceHandlers

        public void configureJAXWSServiceHandlers​(WebServiceEndpoint ep,
                                                  String bindingId,
                                                  com.sun.xml.ws.api.WSBinding bindingObj)
      • configureJAXWSClientHandlers

        public void configureJAXWSClientHandlers​(jakarta.xml.ws.Service svcClass,
                                                 ServiceReferenceDescriptor desc)