WebServiceEndpoint next = (WebServiceEndpoint) iter.next(); Service service = wsUtil.getServiceForPort(model, next.getWsdlPort()); if( service == null ) { service = (Service) model.getServices().next(); + next.getEndpointName() + "' Port '" + next.getWsdlPort() + "'"); next.setServiceNamespaceUri(serviceName.getNamespaceURI()); next.setServiceLocalPart(serviceName.getLocalPart()); Port port = wsUtil.getPortFromModel(model, next.getWsdlPort()); if( port == null ) { String msg = "Can't find model port for endpoint " + next.getEndpointName() + " with wsdl-port " + next.getWsdlPort(); throw new IllegalStateException(msg); port.getProperty(ModelProperties.PROPERTY_TIE_CLASS_NAME); if( tieClassName == null ) { tieClassName = next.getServiceEndpointInterface() + "_Tie"; next.setTieClassName(tieClassName); if( next.implementedByWebComponent() ) { wsUtil.updateServletEndpointRuntime(next); } else {
public String getEndpointAddressUri() { if (implementedByEjbComponent() && !hasEndpointAddressUri()) { setEndpointAddressUri("/" + getWebService().getName() + "/" + getEndpointName()); } return endpointAddressUri; }
public synchronized void undeploy(@ProbeParam("endpoint")WebServiceEndpoint endpoint) { // remove from [appName+moduleName+endpointName --> deployed data] com.sun.enterprise.deployment.Application app = endpoint.getBundleDescriptor().getApplication(); String appName = app.getAppName(); String moduleName = endpoint.getBundleDescriptor().getModuleName(); String endpointName = endpoint.getEndpointName(); Application application = applications.get(appName); if (application != null) { application.removeEndpoint(moduleName, endpointName); if (application.isEmpty()) { applications.remove(appName); } } }
public void addEndpoint(WebServiceEndpoint endpoint) { endpoint.setWebService(this); endpoints.put(endpoint.getEndpointName(), endpoint); }
public DeployedEndpointData(String path, Application app, WebServiceEndpoint endpoint) { super(path, "", ""); this.appName = app.getAppName(); this.endpointName = endpoint.getEndpointName(); this.namespace = endpoint.getServiceName().getNamespaceURI(); this.serviceName = endpoint.getServiceName().getLocalPart(); QName pName = endpoint.getWsdlPort(); this.portName = (pName != null) ? pName.getLocalPart() : ""; this.implClass = endpoint.implementedByEjbComponent() ? endpoint.getEjbComponentImpl().getEjbImplClassName() : endpoint.getServletImplClass(); this.address = path; this.wsdl = address+"?wsdl"; this.tester = address+"?Tester"; this.implType = endpoint.implementedByEjbComponent() ? "EJB" : "SERVLET"; this.deploymentType = "109"; fillStatMap(); }
endpoint = new WebServiceEndpoint(); endpoint.setEndpointName(portComponentName); newWS.addEndpoint(endpoint); wsDesc.setSpecVersion(com.sun.enterprise.deployment.node.WebServicesDescriptorNode.SPEC_VERSION); } else { newWS = endpoint.getWebService(); if(endpoint.getWsdlService() != null) { if( (targetNameSpace != null) && (targetNameSpace.length() != 0 ) && (!endpoint.getWsdlService().getNamespaceURI().equals(targetNameSpace)) ) { throw new AnnotationProcessorException( "Target Namespace inwsdl-service element does not match @WebService.targetNamespace", annInfo); targetNameSpace = endpoint.getWsdlService().getNamespaceURI(); if((!endpoint.hasUserSpecifiedProtocolBinding()) && (userSpecifiedBinding != null) && (userSpecifiedBinding.length() != 0)){ endpoint.setProtocolBinding(userSpecifiedBinding); endpoint.setServiceEndpointInterface("javax.xml.ws.Provider"); } else { endpoint.setServiceEndpointInterface(serviceEndpointIntf.getName()); if(endpoint.getServletImplClass() == null) { endpoint.setServletImplClass(((Class)annElem).getName());
descriptor.getEndpointName()); QName wsdlService = descriptor.getWsdlService(); if((wsdlService!=null) && (wsdlService.getLocalPart().length() != 0)) { appendQNameChild(WebServicesTagNames.WSDL_SERVICE, wseNode, wsdlService.getNamespaceURI(), wsdlService.getLocalPart(), descriptor.getWsdlServiceNamespacePrefix()); QName wsdlPort = descriptor.getWsdlPort(); if((wsdlPort!=null) && (wsdlPort.getLocalPart().length() != 0)) { appendQNameChild(WebServicesTagNames.WSDL_PORT, wseNode, wsdlPort.getNamespaceURI(), wsdlPort.getLocalPart(), descriptor.getWsdlPortNamespacePrefix()); descriptor.getMtomEnabled()); appendTextChild(wseNode, WebServicesTagNames.MTOM_THRESHOLD, descriptor.getMtomThreshold()); if(descriptor.hasUserSpecifiedProtocolBinding()) { appendTextChild(wseNode, WebServicesTagNames.PROTOCOL_BINDING, descriptor.getProtocolBinding()); descriptor.getServiceEndpointInterface()); if( descriptor.implementedByWebComponent() ) {
endpoint.getEndpointName()); appendTextChild(endpointNode, WebServicesTagNames.ENDPOINT_ADDRESS_URI, endpoint.getEndpointAddressUri()); if( endpoint.implementedByEjbComponent() && endpoint.hasAuthMethod() ) { Node loginConfigNode = appendChild(endpointNode, RuntimeTagNames.LOGIN_CONFIG); endpoint.getAuthMethod()); appendTextChild(loginConfigNode, RuntimeTagNames.REALM, endpoint.getRealm()); endpoint.getMessageSecurityBinding(); if (messageSecBindingDesc != null) { MessageSecurityBindingNode messageSecBindingNode = endpoint.getTransportGuarantee()); QName serviceName = endpoint.getServiceName(); if( serviceName != null ) { Node serviceQnameNode = appendChild endpoint.getTieClassName()); if( endpoint.implementedByWebComponent() && (endpoint.getServletImplClass() != null) ) { appendTextChild(endpointNode, WebServicesTagNames.SERVLET_IMPL_CLASS,
Class.forName(endpoint.getServletImplClass(), true, classLoader); String givenBinding = endpoint.getProtocolBinding(); if (endpoint.getWebService().hasWsdlFile()) { pkgedWsdl = servletContext.getResource('/' + endpoint.getWebService().getWsdlFileUri()); } catch (MalformedURLException e) { logger.severe("Cannot load the wsdl from the aplication : " + e.getMessage()); pkgedWsdl = endpoint.getWebService().getWsdlFileUrl(); java.net.URL catalogURL = servletContext.getResource('/' + endpoint.getBundleDescriptor().getDeploymentDescriptorDir() + File.separator + "jax-ws-catalog.xml"); int mtomThreshold = endpoint.getMtomThreshold() != null ? new Integer(endpoint.getMtomThreshold()) : 0; MTOMFeature mtom = new MTOMFeature(true, mtomThreshold); wsFeatures.add(mtom); Addressing addressing = endpoint.getAddressing(); if (addressing != null) { AddressingFeature addressingFeature = new AddressingFeature(addressing.isEnabled(), RespectBinding rb = endpoint.getRespectBinding(); if (rb != null) { RespectBindingFeature rbFeature = new RespectBindingFeature(rb.isEnabled()); if (endpoint.getValidateRequest() != null && Boolean.parseBoolean(endpoint.getValidateRequest())) { if (endpoint.getStreamAttachments() != null && Boolean.parseBoolean(endpoint.getStreamAttachments())) {
descriptor.getEndpointName()); if( descriptor.implementedByEjbComponent() && descriptor.hasAuthMethod() ) { Node loginConfigNode = appendChild(wseNode, RuntimeTagNames.LOGIN_CONFIG); descriptor.getAuthMethod()); appendTextChild(loginConfigNode, RuntimeTagNames.REALM, descriptor.getRealm()); if(descriptor.getTransportGuarantee() != null) { appendTextChild(wseNode, WebServicesTagNames.TRANSPORT_GUARANTEE, descriptor.getTransportGuarantee()); if (descriptor.getWsdlExposed() != null) { new WSDLNode(descriptor).writeDescriptor(wseNode, descriptor); if (descriptor.getStreamAttachments() != null) { appendTextChild(wseNode, WLWebServicesTagNames.STREAM_ATTACHMENTS, descriptor.getStreamAttachments()); if (descriptor.getValidateRequest() != null) { appendTextChild(wseNode, WLWebServicesTagNames.VALIDATE_REQUEST, descriptor.getValidateRequest()); if (descriptor.getHttpResponseBufferSize() != null) {
loader.loadClass(endpoint_.getServiceEndpointInterface()); Class implementationClass = loader.loadClass(endpoint_.getServletImplClass()); String tieClassName = endpoint_.getTieClassName(); if(tieClassName != null) { Class tieClass = loader.loadClass(tieClassName); endpointInfo.setImplementationClass(implementationClass); endpointInfo.setName(endpoint_.getEndpointName()); WebService webService = endpoint_.getWebService(); endpointInfo.setPortName(endpoint_.getWsdlPort()); endpointInfo.setServiceName(endpoint_.getServiceName()); String uri = endpoint_.getEndpointAddressUri(); uri = uri.startsWith("/") ? uri : "/" + uri; endpointInfo.setUrlPattern(uri);
setWebComponentImpl(wc); saveServletImplClass(); String msg = "Servlet " + getWebComponentLink() + " implements " + endpoints.size() + " web service endpoints " + " but must only implement 1"; if( getEndpointAddressUri() == null ) { Set urlPatterns = webComponentImpl.getUrlPatternsSet(); if( urlPatterns.size() == 1 ) { setEndpointAddressUri(uri); guarantee.equals (UserDataConstraint.CONFIDENTIAL_TRANSPORT) ) ) { setTransportGuarantee(guarantee); break; String msg = "Endpoint " + getEndpointName() + " has not been assigned an endpoint address " + " and is associated with servlet " +
EjbDescriptor ejbDesc = endpoint.getEjbComponentImpl(); Iterator<ResourceReferenceDescriptor> it = ejbDesc.getResourceReferenceDescriptors().iterator(); while(it.hasNext()) { logger.severe("Cannot initialize endpoint " + endpoint.getName() + " : error is : " + t.getMessage()); return null; try { WsUtil wsu = new WsUtil(); String implClassName = endpoint.getEjbComponentImpl().getEjbClassName(); Class clazz = container.getEndpointClassLoader().loadClass(implClassName); String givenBinding = endpoint.getProtocolBinding(); if(endpoint.getWebService().hasWsdlFile()) { ApplicationInfo appInfo = appRegistry.get(endpoint.getBundleDescriptor().getApplication().getRegistrationName()); URI deployedDir =appInfo.getSource().getURI(); if(endpoint.getBundleDescriptor().getApplication().isVirtual()) { pkgedWsdl = deployedDir.resolve(endpoint.getWebService().getWsdlFileUri()).toURL(); } else { String moduleUri1 = endpoint.getBundleDescriptor().getModuleDescriptor().getArchiveUri(); pkgedWsdl = deployedDir.resolve(moduleUri+"/"+endpoint.getWebService().getWsdlFileUri()).toURL(); pkgedWsdl = endpoint.getWebService().getWsdlFileUrl(); java.net.URL catalogURL = clazz.getResource('/' + endpoint.getBundleDescriptor().getDeploymentDescriptorDir() + File.separator + "jax-ws-catalog.xml");
WebComponentDescriptor webComp = nextEndpoint.getWebComponentImpl(); if( !nextEndpoint.hasServletImplClass() ) { throw new DeploymentException( format(rb.getString( "enterprise.deployment.backend.cannot_find_servlet"), nextEndpoint.getEndpointName())); String servletImplClass = nextEndpoint.getServletImplClass(); if( !nextEndpoint.getWebService().hasFilePublishing() ) { String publishingUri = nextEndpoint.getPublishingUri(); String publishingUrlPattern = (publishingUri.charAt(0) == '/') ?publishingUri : "/" + publishingUri + "/*"; Class servletImplClazz = cl.loadClass(servletImplClass); String containerServlet; if(wsutil.isJAXWSbasedService(nextEndpoint.getWebService())) { containerServlet = "org.glassfish.webservices.JAXWSServlet"; addWSServletContextListener(webBunDesc); throw new DeploymentException( format(rb.getString( "enterprise.deployment.backend.cannot_find_servlet"), nextEndpoint.getEndpointName())); URL rootURL = wsi.getWebServerRootURL(nextEndpoint.isSecure()); String contextRoot = webBunDesc.getContextRoot(); URL actualAddress = nextEndpoint.composeEndpointAddress(rootURL, contextRoot); nextEndpoint.getEndpointName(), actualAddress.toString() ));
endpoint.saveServletImplClass(); (WebComponentDescriptor) endpoint.getWebComponentImpl(); String msg = "Servlet " + endpoint.getWebComponentLink() + " implements " + endpoints.size() + " web service endpoints " + " but must only implement 1"; if( endpoint.getEndpointAddressUri() == null ) { Set urlPatterns = webComp.getUrlPatternsSet(); if( urlPatterns.size() == 1 ) { endpoint.setEndpointAddressUri(uri); guarantee.equals (UserDataConstraint.CONFIDENTIAL_TRANSPORT) ) ) { endpoint.setTransportGuarantee(guarantee); break; String msg = "Endpoint " + endpoint.getEndpointName() + " has not been assigned an endpoint address " + " and is associated with servlet " +
if( implementedByWebComponent() ) { if (endpointAddressUri == null) { updateServletEndpointRuntime(); if( hasEndpointAddressUri() ) { uri = endpointAddressUri.startsWith("/") ? endpointAddressUri : ("/" + endpointAddressUri); } else { uri = "/" + getWebService().getName() + "/" + getEndpointName(); setEndpointAddressUri(uri);
throws ServletException, IOException { if (("Tester".equalsIgnoreCase(request.getQueryString())) && (!(HTTPBinding.HTTP_BINDING.equals(endpoint.getProtocolBinding())))) { if ((endpt != null) && ((endpt.getDescriptor().isSecure()) || (endpt.getDescriptor().getMessageSecurityBinding() != null) || endpoint.hasSecurePipeline())) { String message = endpt.getDescriptor().getWebService().getName() + "is a secured web service; Tester feature is not supported for secured services"; (new WsUtil()).writeInvalidMethodType(response, message); return; if (endpt != null && Boolean.parseBoolean(endpt.getDescriptor().getDebugging())) { (HTTPBinding.HTTP_BINDING.equals(endpoint.getProtocolBinding()))) { doPost(request, response); return;
if( hasSomeTextXmlContent(headers) ) { String message = "Received HTTP GET containing text/xml " + " content for endpoint " + endpoint.getEndpointName() + " at " + endpoint.getEndpointAddressUri() + " . HTTP POST should be used instead."; String queryString = request.getQueryString(); WebService webService = endpoint.getWebService(); String wsdlPath = endpoint.getWsdlContentPath(requestUri); String moduleID = endpoint.getBundleDescriptor().getApplication().getRegistrationName(); WebServerInfo wsi = getWebServerInfoForDAS(); URL url = webService.getWsdlFileUrl();
if(svcEP.implementedByWebComponent()) { myEndpoint = WebServiceEngineImpl.getInstance().getEndpoint(req.getServletPath()); } else { myEndpoint = WebServiceEngineImpl.getInstance().getEndpoint(req.getRequestURI()); String seiClassName = myEndpoint.getDescriptor().getServiceEndpointInterface(); ClassLoader testerCL = svcEP.getWebService().getBundleDescriptor().getClassLoader(); if (testerCL != null ){ Thread.currentThread().setContextClassLoader(testerCL); Class seiClass = Thread.currentThread().getContextClassLoader().loadClass(seiClassName); if(seiClass.getAnnotation(javax.jws.WebService.class) == null) { testerNotSupportedError(myEndpoint.getDescriptor().getServiceName(), out); return; myEndpoint.getDescriptor().getServiceName().getLocalPart()+" "+ localStrings.getLocalString( "enterprise.webservice.monitoring.title", "Web Service Tester") + "</TITLE></HEAD>"); out.print("<BODY><H1>"+ myEndpoint.getDescriptor().getServiceName().getLocalPart()+" "+ localStrings.getLocalString( "enterprise.webservice.monitoring.title",
public Node writeDescriptor(Node parent, WebServiceEndpoint descriptor) { String ctxtPath; String serviceUri; String endpointAddressUri = descriptor.getEndpointAddressUri(); if (descriptor.implementedByEjbComponent()) { ctxtPath = endpointAddressUri.substring(0, endpointAddressUri.lastIndexOf("/") - 1); serviceUri = endpointAddressUri.substring(endpointAddressUri.lastIndexOf("/")); } else { //for servlet endpoint, use web application context root ctxtPath = descriptor.getWebComponentImpl().getWebBundleDescriptor().getContextRoot(); serviceUri = endpointAddressUri; } Document doc = getOwnerDocument(parent); Element serviceEndpointAddress = doc.createElement(WLWebServicesTagNames.SERVICE_ENDPOINT_ADDRESS); Element ctxtPathEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_CONTEXTPATH); ctxtPathEl.appendChild(doc.createTextNode(ctxtPath)); serviceEndpointAddress.appendChild(ctxtPathEl); Element serviceuriEl = doc.createElement(WLWebServicesTagNames.WEBSERVICE_SERVICEURI); serviceuriEl.appendChild(doc.createTextNode(serviceUri)); serviceEndpointAddress.appendChild(serviceuriEl); parent.appendChild(serviceEndpointAddress); return serviceEndpointAddress; }