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 StringCLIENT_TRANSPORT_LOG_PROPERTYstatic StringENDPOINT_ADDRESS_PARAM_NAMEstatic StringSCHEMA_IMPORT_LOCATION_PARAM_NAMEStringSCHEMA_IMPORT_NAMESPACE_PARAM_NAMEstatic StringSCHEMA_INCLUDE_LOCATION_PARAM_NAMEstatic StringWSDL_IMPORT_LOCATION_PARAM_NAMEStringWSDL_IMPORT_NAMESPACE_PARAM_NAMEstatic StringWSDL_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 voidconfigureJAXWSClientHandlers(jakarta.xml.ws.Service svcClass, ServiceReferenceDescriptor desc)voidconfigureJAXWSServiceHandlers(WebServiceEndpoint ep, String bindingId, com.sun.xml.ws.api.WSBinding bindingObj)voiddoPostConstruct(Class impl, Object implObj)voiddoPreDestroy(WebServiceEndpoint ep, ClassLoader loader)voidgenerateFinalWsdl(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.voidgenerateFinalWsdl(URL wsdlFileUrl, WebService webService, WebServerInfo wsi, OutputStream outputStream)static LoggergetDefaultLogger()static LocalStringManagerImplgetDefaultStringManager()booleangetMtom(WebServiceEndpoint ep)static jakarta.xml.soap.SOAPMessagegetSOAPFault(String protocol, String faultString)WebServerInfogetWebServerInfoForDAS()StringgetWsdlDir(BundleDescriptor bundle)CollectiongetWsdlsAndSchemas(File pkgedWsdl)voidgetWsdlsAndSchemas(File wsdl, ArrayList<com.sun.xml.ws.api.server.SDDocumentSource> cumulative)CollectiongetWsdlsAndSchemas(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.booleanhandleGet(jakarta.servlet.http.HttpServletRequest request, jakarta.servlet.http.HttpServletResponse response, WebServiceEndpoint endpoint)Serve up the FINAL wsdl associated with this web service.booleanisJAXWSbasedService(WebService ws)booleanisWsdlContent(String uri, BundleDescriptor bundle)All wsdl files and wsdl imported files live under a well-known wsdl directory.URLprivilegedGetServiceRefWsdl(ServiceReferenceDescriptor desc)Accessing wsdl URL might involve file system access, so wrap operation in a doPrivileged block.static voidraiseException(jakarta.servlet.http.HttpServletResponse resp, String binding, String faultString)voidupdateServletEndpointRuntime(WebServiceEndpoint endpoint)voidvalidateEjbEndpoint(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 IOExceptionServe 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)
-
-