public void onFault(MessageContext synCtx) { // is this an actual leaf endpoint if (getParentEndpoint() != null) { // is this really a fault or a timeout/connection close etc? if (isTimeout(synCtx)) { getContext().onTimeout(); } else if (isSuspendFault(synCtx)) { getContext().onFault(); } } setErrorOnMessage(synCtx, null, null); super.onFault(synCtx); }
public void send(MessageContext synCtx) { // For setting Car name (still for Proxy) logSetter(); if (getParentEndpoint() == null && !readyToSend()) { // if the this leaf endpoint is too a root endpoint and is in inactive informFailure(synCtx, SynapseConstants.ENDPOINT_ADDRESS_NONE_READY, "Currently , WSDL endpoint : " + getContext()); } else { super.send(synCtx); } }
String serviceName = wsdlEndpoint.getServiceName(); if (serviceName != null) { wsdlElement.addAttribute("service", serviceName, null); String portName = wsdlEndpoint.getPortName(); if (portName != null) { wsdlElement.addAttribute("port", portName, null); String uri = wsdlEndpoint.getWsdlURI(); if (uri != null) { wsdlElement.addAttribute("uri", uri, null); OMElement wsdlDoc = wsdlEndpoint.getWsdlDoc(); if (wsdlDoc != null) { wsdlElement.addChild(wsdlDoc); EndpointDefinition epDefinition = wsdlEndpoint.getDefinition(); EndpointDefinitionSerializer serializer = new EndpointDefinitionSerializer(); serializer.serializeEndpointDefinition(epDefinition, wsdlElement);
protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint, Properties properties) { WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(); OMAttribute name = epConfig.getAttribute(new QName( org.apache.synapse.config.xml.XMLConfigConstants.NULL_NAMESPACE, "name")); wsdlEndpoint.setName(name.getAttributeValue()); wsdlEndpoint.setDefinition(endpoint); processAuditStatus(endpoint, wsdlEndpoint.getName(), wsdlElement); wsdlEndpoint.setServiceName(serviceName); wsdlEndpoint.setPortName(portName); wsdlEndpoint.setWsdlURI(wsdlURI.trim()); if (noParsing == null || !JavaUtils.isTrueExplicitly(noParsing)) { String synapseHome = properties.get(SynapseConstants.SYNAPSE_HOME) != null ? (new QName(org.apache.axis2.namespace.Constants.NS_URI_WSDL11, "definitions")); if (endpoint == null && definitionElement != null) { wsdlEndpoint.setWsdlDoc(definitionElement);
WSDLEndpoint wsdlEndpoint = (WSDLEndpoint) e; try { url = new URL(wsdlEndpoint.getDefinition().getAddress()); } catch (MalformedURLException e1) { String msg = "Mulformed URL in address endpoint";
url = new URL(((AddressEndpoint) (ep)).getDefinition().getAddress() + "?wsdl"); } else if (ep instanceof WSDLEndpoint) { url = new URL(((WSDLEndpoint) (ep)).getWsdlURI()); } else { handleException("Unable to resolve WSDL url. " + publishWSDLEndpoint +
public void onSuccess() { getContext().onSuccess(); }
String serviceName = wsdlEndpoint.getServiceName(); if (serviceName != null) { wsdlElement.addAttribute("service", serviceName, null); String portName = wsdlEndpoint.getPortName(); if (portName != null) { wsdlElement.addAttribute("port", portName, null); String uri = wsdlEndpoint.getWsdlURI(); if (uri != null) { wsdlElement.addAttribute("uri", uri, null); OMElement wsdlDoc = wsdlEndpoint.getWsdlDoc(); if (wsdlDoc != null) { wsdlElement.addChild(wsdlDoc); EndpointDefinition epDefinition = wsdlEndpoint.getDefinition(); EndpointDefinitionSerializer serializer = new EndpointDefinitionSerializer(); serializer.serializeEndpointDefinition(epDefinition, wsdlElement);
protected Endpoint createEndpoint(OMElement epConfig, boolean anonymousEndpoint, Properties properties) { WSDLEndpoint wsdlEndpoint = new WSDLEndpoint(); OMAttribute name = epConfig.getAttribute(new QName( org.apache.synapse.config.xml.XMLConfigConstants.NULL_NAMESPACE, "name")); wsdlEndpoint.setName(name.getAttributeValue()); wsdlEndpoint.setDefinition(endpoint); processAuditStatus(endpoint, wsdlEndpoint.getName(), wsdlElement); wsdlEndpoint.setServiceName(serviceName); wsdlEndpoint.setPortName(portName); wsdlEndpoint.setWsdlURI(wsdlURI.trim()); if (noParsing == null || !JavaUtils.isTrueExplicitly(noParsing)) { try { (new QName(org.apache.axis2.namespace.Constants.NS_URI_WSDL11, "definitions")); if (endpoint == null && definitionElement != null) { wsdlEndpoint.setWsdlDoc(definitionElement);
WSDLEndpoint wsdlEndpoint = (WSDLEndpoint) e; try { url = new URL(wsdlEndpoint.getDefinition().getAddress()); } catch (MalformedURLException e1) { String msg = "Mulformed URL in address endpoint";
public void onSuccess() { getContext().onSuccess(); }
public void testWSDLEndpointSerialization() { String sendConfig = "<send xmlns=\"http://ws.apache.org/ns/synapse\">" + "<endpoint>" + "<wsdl uri='file:src/test/resources/esbservice.wsdl' service='esbservice' port='esbserviceSOAP11port_http'>" + "<enableAddressing/>" + "</wsdl>" + "</endpoint>" + "</send>"; OMElement config1 = createOMElement(sendConfig); SendMediator send1 = (SendMediator) factory.createMediator(config1, new Properties()); OMElement config2 = serializer.serializeMediator(null, send1); SendMediator send2 = (SendMediator) factory.createMediator(config2, new Properties()); assertTrue("Top level endpoint should be a WSDL endpoint.", send1.getEndpoint() instanceof WSDLEndpoint); WSDLEndpoint ep1 = (WSDLEndpoint) send1.getEndpoint(); assertTrue("Top level endpoint should be a WSDL endpoint.", send2.getEndpoint() instanceof WSDLEndpoint); WSDLEndpoint ep2 = (WSDLEndpoint) send2.getEndpoint(); assertEquals("Service name is not serialized properly.", ep1.getServiceName(), ep2.getServiceName()); assertEquals("Port name is not serialized properly", ep1.getPortName(), ep2.getPortName()); assertEquals("WSDL URI is not serialized properly", ep1.getWsdlURI(), ep2.getWsdlURI()); assertEquals( "Addressing information is not serialized properly", ep1.getDefinition().isAddressingOn(), ep2.getDefinition().isAddressingOn()); }
public void onFault(MessageContext synCtx) { // For setting Car name (still for Proxy) logSetter(); // is this an actual leaf endpoint if (getParentEndpoint() != null) { // is this really a fault or a timeout/connection close etc? if (isTimeout(synCtx)) { getContext().onTimeout(); } else if (isSuspendFault(synCtx)) { getContext().onFault(); } } setErrorOnMessage(synCtx, null, null); super.onFault(synCtx); }
public void send(MessageContext synCtx) { if (getParentEndpoint() == null && !readyToSend()) { // if the this leaf endpoint is too a root endpoint and is in inactive informFailure(synCtx, SynapseConstants.ENDPOINT_ADDRESS_NONE_READY, "Currently , WSDL endpoint : " + getContext()); } else { super.send(synCtx); } }
public void testWSDLEndpointSerialization() { String callConfig = "<call xmlns=\"http://ws.apache.org/ns/synapse\">" + "<endpoint>" + "<wsdl uri='file:src/test/resources/esbservice.wsdl' service='esbservice' port='esbserviceSOAP11port_http'>" + "<enableAddressing/>" + "</wsdl>" + "</endpoint>" + "</call>"; OMElement config1 = createOMElement(callConfig); CallMediator call1 = (CallMediator) factory.createMediator(config1, new Properties()); OMElement config2 = serializer.serializeMediator(null, call1); CallMediator call2 = (CallMediator) factory.createMediator(config2, new Properties()); assertTrue("Top level endpoint should be a WSDL endpoint.", call1.getEndpoint() instanceof WSDLEndpoint); WSDLEndpoint ep1 = (WSDLEndpoint) call1.getEndpoint(); assertTrue("Top level endpoint should be a WSDL endpoint.", call2.getEndpoint() instanceof WSDLEndpoint); WSDLEndpoint ep2 = (WSDLEndpoint) call2.getEndpoint(); assertEquals("Service name is not serialized properly.", ep1.getServiceName(), ep2.getServiceName()); assertEquals("Port name is not serialized properly", ep1.getPortName(), ep2.getPortName()); assertEquals("WSDL URI is not serialized properly", ep1.getWsdlURI(), ep2.getWsdlURI()); assertEquals( "Addressing information is not serialized properly", ep1.getDefinition().isAddressingOn(), ep2.getDefinition().isAddressingOn()); }