Package org.glassfish.webservices
Class WsUtil
- java.lang.Object
-
- org.glassfish.webservices.WsUtil
-
public class WsUtil extends Object
Web service related utilities.- Author:
- Kenneth Saks
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLIENT_TRANSPORT_LOG_PROPERTY
static String
ENDPOINT_ADDRESS_PARAM_NAME
static String
SCHEMA_IMPORT_LOCATION_PARAM_NAME
String
SCHEMA_IMPORT_NAMESPACE_PARAM_NAME
static String
SCHEMA_INCLUDE_LOCATION_PARAM_NAME
static String
WSDL_IMPORT_LOCATION_PARAM_NAME
String
WSDL_IMPORT_NAMESPACE_PARAM_NAME
static String
WSDL_INCLUDE_LOCATION_PARAM_NAME
-
Constructor Summary
Constructors Constructor Description WsUtil()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configureJAXWSClientHandlers(jakarta.xml.ws.Service svcClass, ServiceReferenceDescriptor desc)
void
configureJAXWSServiceHandlers(WebServiceEndpoint ep, String bindingId, com.sun.xml.ws.api.WSBinding bindingObj)
void
doPostConstruct(Class impl, Object implObj)
void
doPreDestroy(WebServiceEndpoint ep, ClassLoader loader)
void
generateFinalWsdl(URL wsdlFileUrl, WebService webService, WebServerInfo wsi, File finalWsdlFile)
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.void
generateFinalWsdl(URL wsdlFileUrl, WebService webService, WebServerInfo wsi, OutputStream outputStream)
static Logger
getDefaultLogger()
static LocalStringManagerImpl
getDefaultStringManager()
boolean
getMtom(WebServiceEndpoint ep)
static jakarta.xml.soap.SOAPMessage
getSOAPFault(String protocol, String faultString)
WebServerInfo
getWebServerInfoForDAS()
String
getWsdlDir(BundleDescriptor bundle)
Collection
getWsdlsAndSchemas(File pkgedWsdl)
void
getWsdlsAndSchemas(File wsdl, ArrayList<com.sun.xml.ws.api.server.SDDocumentSource> cumulative)
Collection
getWsdlsAndSchemas(URL pkgedWsdl)
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.boolean
handleGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, WebServiceEndpoint endpoint)
Serve up the FINAL wsdl associated with this web service.boolean
isJAXWSbasedService(WebService ws)
boolean
isWsdlContent(String uri, BundleDescriptor bundle)
All wsdl files and wsdl imported files live under a well-known wsdl directory.URL
privilegedGetServiceRefWsdl(ServiceReferenceDescriptor desc)
Accessing wsdl URL might involve file system access, so wrap operation in a doPrivileged block.static void
raiseException(jakarta.servlet.http.HttpServletResponse resp, String binding, String faultString)
void
updateServletEndpointRuntime(WebServiceEndpoint endpoint)
void
validateEjbEndpoint(WebServiceEndpoint ejbEndpoint)
-
-
-
Field Detail
-
CLIENT_TRANSPORT_LOG_PROPERTY
public static final String CLIENT_TRANSPORT_LOG_PROPERTY
- See Also:
- Constant Field Values
-
ENDPOINT_ADDRESS_PARAM_NAME
public static final String ENDPOINT_ADDRESS_PARAM_NAME
- See Also:
- Constant Field Values
-
WSDL_IMPORT_NAMESPACE_PARAM_NAME
public final String WSDL_IMPORT_NAMESPACE_PARAM_NAME
- See Also:
- Constant Field Values
-
WSDL_IMPORT_LOCATION_PARAM_NAME
public static final String WSDL_IMPORT_LOCATION_PARAM_NAME
- See Also:
- Constant Field Values
-
WSDL_INCLUDE_LOCATION_PARAM_NAME
public static final String WSDL_INCLUDE_LOCATION_PARAM_NAME
- See Also:
- Constant Field Values
-
SCHEMA_IMPORT_NAMESPACE_PARAM_NAME
public final String SCHEMA_IMPORT_NAMESPACE_PARAM_NAME
- See Also:
- Constant Field Values
-
SCHEMA_IMPORT_LOCATION_PARAM_NAME
public static final String SCHEMA_IMPORT_LOCATION_PARAM_NAME
- See Also:
- Constant Field Values
-
SCHEMA_INCLUDE_LOCATION_PARAM_NAME
public static final String SCHEMA_INCLUDE_LOCATION_PARAM_NAME
- See Also:
- Constant Field Values
-
-
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
-
generateFinalWsdl
public void generateFinalWsdl(URL wsdlFileUrl, WebService webService, WebServerInfo wsi, OutputStream outputStream) throws Exception
- 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
-
getDefaultStringManager
public static LocalStringManagerImpl getDefaultStringManager()
-
validateEjbEndpoint
public void validateEjbEndpoint(WebServiceEndpoint ejbEndpoint)
-
updateServletEndpointRuntime
public void updateServletEndpointRuntime(WebServiceEndpoint endpoint)
-
getWsdlsAndSchemas
public Collection getWsdlsAndSchemas(File pkgedWsdl) throws Exception
- Throws:
Exception
-
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
-
doPreDestroy
public void doPreDestroy(WebServiceEndpoint ep, ClassLoader loader)
-
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)
-
getMtom
public boolean getMtom(WebServiceEndpoint ep)
-
-