private void processEndpoints(AxisService axisService, AxisConfiguration axisConfiguration) throws AxisFault { Map<String, AxisEndpoint> enspoints = axisService.getEndpoints(); if (enspoints == null || enspoints.size() == 0) { org.apache.axis2.deployment.util.Utils.addEndpointsToService( axisService, axisConfiguration); } }
private void processEndpoints(AxisService axisService, AxisConfiguration axisConfiguration) throws AxisFault { Map<String, AxisEndpoint> enspoints = axisService.getEndpoints(); if (enspoints == null || enspoints.size() == 0) { org.apache.axis2.deployment.util.Utils.addEndpointsToService( axisService, axisConfiguration); } }
public static AxisBinding getHttpBinding(AxisService service) { for (Object o : service.getEndpoints().values()) { AxisEndpoint endpoint = (AxisEndpoint)o; AxisBinding binding = endpoint.getBinding(); if (isHttpBinding(binding)) { return binding; } } return null; }
public static AxisBinding getSoap11Binding(AxisService service) { for (Object o : service.getEndpoints().values()) { AxisEndpoint endpoint = (AxisEndpoint)o; AxisBinding binding = endpoint.getBinding(); if (isSoap11Binding(binding)) { return binding; } } return null; }
public static AxisBinding getSoap12Binding(AxisService service) { for (Object o : service.getEndpoints().values()) { AxisEndpoint endpoint = (AxisEndpoint)o; AxisBinding binding = endpoint.getBinding(); if (isSoap12Binding(binding)) { return binding; } } return null; }
public static AxisBinding getSoap12Binding(AxisService service) { for (Object o : service.getEndpoints().values()) { AxisEndpoint endpoint = (AxisEndpoint)o; AxisBinding binding = endpoint.getBinding(); if (isSoap12Binding(binding)) { return binding; } } return null; }
public static AxisBinding getHttpBinding(AxisService service) { for (Object o : service.getEndpoints().values()) { AxisEndpoint endpoint = (AxisEndpoint)o; AxisBinding binding = endpoint.getBinding(); if (isHttpBinding(binding)) { return binding; } } return null; }
public static AxisBinding getSoap11Binding(AxisService service) { for (Object o : service.getEndpoints().values()) { AxisEndpoint endpoint = (AxisEndpoint)o; AxisBinding binding = endpoint.getBinding(); if (isSoap11Binding(binding)) { return binding; } } return null; }
private AxisService removeServiceReferences(String serviceName) { AxisService axisService = allServices.remove(serviceName); if (axisService != null) { if (!axisService.isClientSide()) { notifyObservers(new AxisEvent(AxisEvent.SERVICE_REMOVE, axisService), axisService); } // removes the endpoints to this service for (Iterator<String> iter = axisService.getEndpoints().keySet() .iterator(); iter.hasNext();) { String key = serviceName + "." + iter.next(); this.allEndpoints.remove(key); } } return axisService; }
private AxisService removeServiceReferences(String serviceName) { AxisService axisService = allServices.remove(serviceName); if (axisService != null) { if (!axisService.isClientSide()) { notifyObservers(new AxisEvent(AxisEvent.SERVICE_REMOVE, axisService), axisService); } // removes the endpoints to this service for (Iterator<String> iter = axisService.getEndpoints().keySet() .iterator(); iter.hasNext();) { String key = serviceName + "." + iter.next(); this.allEndpoints.remove(key); } } return axisService; }
public void removeSecurityPolicyFromAllBindings(AxisService axisService, String uuid) throws ServerException { if (log.isDebugEnabled()) { log.debug("Removing security policy from all bindings."); } Map endPointMap = axisService.getEndpoints(); for (Object o : endPointMap.entrySet()) { Map.Entry entry = (Map.Entry) o; AxisEndpoint point = (AxisEndpoint) entry.getValue(); AxisBinding binding = point.getBinding(); if (binding.getPolicySubject().getAttachedPolicyComponent(uuid) != null) { binding.getPolicySubject().detachPolicyComponent(uuid); } } }
public void removeSecurityPolicyFromAllBindings(AxisService axisService, String uuid) throws ServerException { if (log.isDebugEnabled()) { log.debug("Removing security policy from all bindings."); } Map endPointMap = axisService.getEndpoints(); for (Object o : endPointMap.entrySet()) { Map.Entry entry = (Map.Entry) o; AxisEndpoint point = (AxisEndpoint) entry.getValue(); AxisBinding binding = point.getBinding(); if (binding.getPolicySubject().getAttachedPolicyComponent(uuid) != null) { binding.getPolicySubject().detachPolicyComponent(uuid); } } }
public void removeSecurityPolicyFromAllBindings(AxisService axisService, String uuid) throws ServerException { if (log.isDebugEnabled()) { log.debug("Removing security policy from all bindings."); } Map endPointMap = axisService.getEndpoints(); for (Object o : endPointMap.entrySet()) { Map.Entry entry = (Map.Entry) o; AxisEndpoint point = (AxisEndpoint) entry.getValue(); AxisBinding binding = point.getBinding(); if (binding.getPolicySubject().getAttachedPolicyComponent(uuid) != null) { binding.getPolicySubject().detachPolicyComponent(uuid); } } }
private static Binding extractBindingInformation(final AxisService service, final Definition wsdlOfService, final MessageContext inMessageContext) { AxisEndpoint currentEndpoint = (AxisEndpoint) inMessageContext .getProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME); if (currentEndpoint == null) { String defaultEndpointName = service.getEndpointName(); currentEndpoint = service.getEndpoints().get(defaultEndpointName); if (currentEndpoint == null) { throw new NullPointerException("AxisEndpoint cannot be null."); } } AxisBinding currentAxisBinding = currentEndpoint.getBinding(); QName bindingQName = currentAxisBinding.getName(); return wsdlOfService.getBinding(bindingQName); }
public static AxisService createClientSideAxisService( Definition wsdlDefinition, QName wsdlServiceName, String portName, Options options) throws AxisFault { WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisServiceBuilder( wsdlDefinition, wsdlServiceName, portName); serviceBuilder.setServerSide(false); AxisService axisService = serviceBuilder.populateService(); AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoints() .get(axisService.getEndpointName()); if (axisEndpoint != null) { options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); options.setSoapVersionURI((String) axisEndpoint.getBinding() .getProperty(WSDL2Constants.ATTR_WSOAP_VERSION)); } return axisService; }
public static AxisService createClientSideAxisService( Definition wsdlDefinition, QName wsdlServiceName, String portName, Options options) throws AxisFault { WSDL11ToAxisServiceBuilder serviceBuilder = new WSDL11ToAxisServiceBuilder( wsdlDefinition, wsdlServiceName, portName); serviceBuilder.setServerSide(false); AxisService axisService = serviceBuilder.populateService(); AxisEndpoint axisEndpoint = (AxisEndpoint) axisService.getEndpoints() .get(axisService.getEndpointName()); if (axisEndpoint != null) { options.setTo(new EndpointReference(axisEndpoint.getEndpointURL())); options.setSoapVersionURI((String) axisEndpoint.getBinding() .getProperty(WSDL2Constants.ATTR_WSOAP_VERSION)); } return axisService; }
public void addPolicyToAllBindings(AxisService axisService, Policy policy) throws ServerException { try { if (policy.getId() == null) { // Generate an ID policy.setId(UUIDGenerator.getUUID()); } Map endPointMap = axisService.getEndpoints(); for (Object o : endPointMap.entrySet()) { Map.Entry entry = (Map.Entry) o; AxisEndpoint point = (AxisEndpoint) entry.getValue(); AxisBinding binding = point.getBinding(); String bindingName = binding.getName().getLocalPart(); //only UTOverTransport is allowed for HTTP if (bindingName.endsWith("HttpBinding") && (!policy.getAttributes().containsValue("UTOverTransport"))) { continue; } binding.getPolicySubject().attachPolicy(policy); // Add the new policy to the registry } } catch (Exception e) { log.error("Error in adding security policy to all bindings", e); throw new ServerException("addPoliciesToService", e); } }
/** * Returns the fully qualified Stub name reused in many methods * * @return classname */ protected String getFullyQualifiedStubName() { String packageName = codeGenConfiguration.getPackageName(); String localPart = null; if (this.axisService.getEndpoints().size() > 1) { localPart = makeJavaClassName(axisService.getName() + axisService.getEndpointName()); } else { localPart = makeJavaClassName(axisService.getName()); } return packageName + "." + localPart + STUB_SUFFIX; }
private void inferEndpoint(MessageContext msgCtx, AxisService service) { if (!msgCtx.isServerSide()) { return; } String transport = null; TransportInDescription transportIn = msgCtx.getTransportIn(); if (transportIn != null) { transport = transportIn.getName(); if (transport == null) { return; } } AxisEndpoint endpoint = null; Map endpointMapping = service.getEndpoints(); String serviceName = service.getName(); if (msgCtx.isDoingREST()) { endpoint = (AxisEndpoint) endpointMapping.get(WSDLUtil. getEndpointName(serviceName, transport)); } if (endpoint != null) { msgCtx.setProperty(WSDL2Constants.ENDPOINT_LOCAL_NAME, endpoint); } } }
/** * Generates the model for the callbacks. */ protected Document createDOMDocumentForCallbackHandler() { Document doc = getEmptyDocument(); Element rootElement = doc.createElement("callback"); addAttribute(doc, "package", codeGenConfiguration.getPackageName(), rootElement); if (codeGenConfiguration.isPackClasses() && this.axisService.getEndpoints().size() > 1) { addAttribute(doc, "name", makeJavaClassName(axisService.getName() + axisService.getEndpointName()) + CALL_BACK_HANDLER_SUFFIX, rootElement); } else { addAttribute(doc, "name", makeJavaClassName(axisService.getName()) + CALL_BACK_HANDLER_SUFFIX, rootElement); } // TODO JAXRPC mapping support should be considered here ?? this.loadOperations(doc, rootElement, null); doc.appendChild(rootElement); return doc; }