use of com.sun.enterprise.deployment.WebServiceEndpoint in project Payara by payara.
the class WebServiceNode method addDescriptor.
/**
* Adds a new DOL descriptor instance to the descriptor
* instance associated with this XMLNode
*
* @param descriptor the new descriptor
*/
public void addDescriptor(Object descriptor) {
WebServiceEndpoint endpoint = (WebServiceEndpoint) descriptor;
WebService webService = (WebService) getDescriptor();
webService.addEndpoint(endpoint);
}
use of com.sun.enterprise.deployment.WebServiceEndpoint in project Payara by payara.
the class WebServiceNode method writeDescriptor.
/**
* write the method descriptor class to a query-method DOM tree and
* return it
*
* @param parent node in the DOM tree
* @param nodeName name for the root element of this xml fragment
* @param descriptor the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName, WebService descriptor) {
Node topNode = super.writeDescriptor(parent, nodeName, descriptor);
writeDisplayableComponentInfo(topNode, descriptor);
appendTextChild(topNode, WebServicesTagNames.WEB_SERVICE_DESCRIPTION_NAME, descriptor.getName());
appendTextChild(topNode, WebServicesTagNames.WSDL_FILE, descriptor.getWsdlFileUri());
appendTextChild(topNode, WebServicesTagNames.JAXRPC_MAPPING_FILE, descriptor.getMappingFileUri());
WebServiceEndpointNode endpointNode = new WebServiceEndpointNode();
for (WebServiceEndpoint next : descriptor.getEndpoints()) {
endpointNode.writeDescriptor(topNode, WebServicesTagNames.PORT_COMPONENT, next);
}
return topNode;
}
use of com.sun.enterprise.deployment.WebServiceEndpoint in project Payara by payara.
the class JaxRpcRICodegen method accept.
/**
* visits a web service definition
*
* @param webService
*/
@Override
public void accept(WebService webService) {
if (processServiceReferences) {
return;
}
if (!webServiceInContext(webService)) {
return;
}
super.accept(webService);
try {
if ((new WsUtil()).isJAXWSbasedService(webService)) {
WsUtil wsUtil = new WsUtil();
Collection<WebServiceEndpoint> endpoints = webService.getEndpoints();
for (WebServiceEndpoint ep : endpoints) {
if (ep.implementedByWebComponent()) {
wsUtil.updateServletEndpointRuntime(ep);
} else {
wsUtil.validateEjbEndpoint(ep);
}
}
// wsImport(webService, files);
} else {
jaxrpcWebService(webService, files);
}
} catch (Exception e) {
RuntimeException ge = new RuntimeException(e.getMessage());
ge.initCause(e);
throw ge;
}
}
use of com.sun.enterprise.deployment.WebServiceEndpoint in project Payara by payara.
the class JaxRpcRICodegen method accept.
/**
* Visits a webs service reference
*/
@Override
public void accept(ServiceReferenceDescriptor serviceRef) {
if (!processServiceReferences) {
return;
}
boolean codegenRequired = false;
URL wsdlOverride = null;
boolean wsdlOverriden = false;
boolean jaxwsClient = false;
super.accept(serviceRef);
try {
ClassLoader clr = serviceRef.getBundleDescriptor().getClassLoader();
if (serviceRef.getServiceInterface() != null) {
Class serviceInterface = clr.loadClass(serviceRef.getServiceInterface());
if (javax.xml.ws.Service.class.isAssignableFrom(serviceInterface)) {
jaxwsClient = true;
}
}
// already set.
for (Iterator ports = serviceRef.getPortsInfo().iterator(); ports.hasNext(); ) {
ServiceRefPortInfo portInfo = (ServiceRefPortInfo) ports.next();
if (portInfo.isLinkedToPortComponent()) {
WebServiceEndpoint linkedPortComponent = portInfo.getPortComponentLink();
if (linkedPortComponent == null) {
throw new Exception(localStrings.getLocalString("enterprise.webservice.componentlinkunresolved", "The port-component-link {0} cannot be resolved", new Object[] { portInfo.getPortComponentLinkName() }));
}
WsUtil wsUtil = new WsUtil();
WebServerInfo wsi = wsUtil.getWebServerInfoForDAS();
URL rootURL = wsi.getWebServerRootURL(linkedPortComponent.isSecure());
URL actualAddress = linkedPortComponent.composeEndpointAddress(rootURL);
if (jaxwsClient) {
portInfo.addStubProperty(javax.xml.ws.BindingProvider.ENDPOINT_ADDRESS_PROPERTY, actualAddress.toExternalForm());
} else {
portInfo.addStubProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, actualAddress.toExternalForm());
}
if (serviceRef.getBundleDescriptor().getModuleType().equals(DOLUtils.carType())) {
wsdlOverride = serviceRef.getWsdlOverride();
if (wsdlOverride != null) {
wsdlOverriden = true;
serviceRef.setWsdlOverride(linkedPortComponent.getWebService().getWsdlFileUrl());
}
}
}
}
// If this is a post JAXRPC-1.1 based web service, then no need for code gen etc etc
if (jaxwsClient) {
return;
}
if (serviceRef.hasGeneratedServiceInterface()) {
if (serviceRef.hasWsdlFile() && serviceRef.hasMappingFile()) {
codegenRequired = true;
} else {
throw new Exception("Deployment error for service-ref " + serviceRef.getName() + ".\nService references with generated service " + "interface must include WSDL and mapping information.");
}
} else {
if (serviceRef.hasWsdlFile()) {
if (serviceRef.hasMappingFile()) {
codegenRequired = true;
} else {
throw new Exception("Deployment error for service-ref " + serviceRef.getName() + ".\nService references with wsdl must also have " + "mapping information.");
}
}
}
if (codegenRequired) {
ModelInfo modelInfo = createModelInfo(serviceRef);
/*
* If clients exist, force regeneration so that the ClientArtifactsManager is populated. Issue
* 10612.
*/
String[] args = createJaxrpcCompileArgs(false, hasWebServiceClients);
CompileTool wscompile = rpcFactory.createCompileTool(System.out, "wscompile");
wscompileForAccept = wscompile;
WsCompile delegate = new WsCompile(wscompile, serviceRef);
delegate.setModelInfo(modelInfo);
wscompile.setDelegate(delegate);
jaxrpc(args, delegate, serviceRef, files);
if (hasWebServiceClients) {
addArtifactsForAppClient();
}
}
if (wsdlOverriden) {
serviceRef.setWsdlOverride(wsdlOverride);
}
} catch (IllegalStateException e) {
// do nothing
logger.info("Attempting to add artifacts for appClient after artifacts were generated" + " " + e.getMessage());
} catch (Exception e) {
RuntimeException re = new RuntimeException(e.getMessage());
re.initCause(e);
throw re;
}
}
use of com.sun.enterprise.deployment.WebServiceEndpoint in project Payara by payara.
the class WebServicesDeploymentMBean method deploy.
public synchronized void deploy(WebServicesDescriptor wsDesc, WebServiceDeploymentNotifier notifier) {
for (WebService svc : wsDesc.getWebServices()) {
for (WebServiceEndpoint endpoint : svc.getEndpoints()) {
deploy(endpoint);
notifier.notifyDeployed(endpoint);
}
}
}
Aggregations