private String printEndpointAddress() { if(this.definition != null && this.definition.getAddress() != null) { return " with address " + MessageHelper.maskURLPassword(this.definition.getAddress()); } else { return " "; } } }
private boolean isTransportSwitching(MessageContext synCtx, EndpointDefinition endpoint) { if (endpoint.getAddress() != null) { // If the message is sent to an explicit non-HTTP endpoint, build the message return !endpoint.getAddress().startsWith("http"); } else { String address = synCtx.getTo().getAddress(); if (address != null) { // If the message is sent to an implicit non-HTTP endpoint, build the message return !address.startsWith("http"); } } return false; }
@Override public OMElement serializeEndpointDefinition(EndpointDefinition endpointDefinition) { OMElement element = fac.createOMElement("address", SynapseConstants.SYNAPSE_OMNAMESPACE); if (endpointDefinition.getAddress() != null) { element.addAttribute( fac.createOMAttribute("uri", null, endpointDefinition.getAddress())); } else { handleException("Invalid Endpoint. Address is required"); } EndpointDefinitionSerializer serializer = new EndpointDefinitionSerializer(); serializer.serializeEndpointDefinition(endpointDefinition, element); serializeSpecificEndpointProperties(endpointDefinition, element); return element; } }
private boolean isTransportSwitching(MessageContext synCtx, EndpointDefinition endpoint) { if (endpoint != null) { // SendOn transport switching if (endpoint.getAddress() != null) { // If the message is sent to an explicit non-HTTP endpoint, build the message return !endpoint.getAddress().startsWith("http"); } else { String address = synCtx.getTo().getAddress(); if (address != null) { // If the message is sent to an implicit non-HTTP endpoint, build the message return !address.startsWith("http"); } } } else { // SendBack transport switching TransportOutDescription transportOut = ((Axis2MessageContext) synCtx).getAxis2MessageContext().getTransportOut(); if (transportOut != null) { String transportOutName = transportOut.getName(); if (transportOutName != null) { return !transportOutName.startsWith("http"); } } } return false; }
@Override public OMElement serializeEndpointDefinition(EndpointDefinition endpointDefinition) { OMElement element = fac.createOMElement("address", SynapseConstants.SYNAPSE_OMNAMESPACE); if (endpointDefinition.getAddress() != null) { element.addAttribute( fac.createOMAttribute("uri", null, endpointDefinition.getAddress())); } else { handleException("Invalid Endpoint. Address is required"); } EndpointDefinitionSerializer serializer = new EndpointDefinitionSerializer(); serializer.serializeEndpointDefinition(endpointDefinition, element); serializeSpecificEndpointProperties(endpointDefinition, element); return element; } }
String endpointUrl = endpoint.getDefinition().getAddress();
AddressEndpoint addressEndpoint = (AddressEndpoint) e; try { url = new URL(addressEndpoint.getDefinition().getAddress()); } catch (MalformedURLException e1) { String msg = "Mulformed URL in address endpoint"; WSDLEndpoint wsdlEndpoint = (WSDLEndpoint) e; try { url = new URL(wsdlEndpoint.getDefinition().getAddress()); } catch (MalformedURLException e1) { String msg = "Mulformed URL in address endpoint";
AddressEndpoint addressEndpoint = (AddressEndpoint) e; try { url = new URL(addressEndpoint.getDefinition().getAddress()); } catch (MalformedURLException e1) { String msg = "Mulformed URL in address endpoint"; WSDLEndpoint wsdlEndpoint = (WSDLEndpoint) e; try { url = new URL(wsdlEndpoint.getDefinition().getAddress()); } catch (MalformedURLException e1) { String msg = "Mulformed URL in address endpoint";
EndpointDefinition endpointDefinition = abstractEndpoint.getDefinition(); String endpointReferenceValue; if (endpointDefinition.getAddress() != null) { endpointReferenceValue = endpointDefinition.getAddress();
throws Exception { String serviceUrl = endpoint.getAddress();
if (endpointDefinition.getAddress() != null) { endpointReferenceValue = endpointDefinition.getAddress(); } else if (axisInMsgCtx.getTo() != null) { endpointReferenceValue = axisInMsgCtx.getTo().getAddress(); ((AbstractEndpoint) endpoint).getDefinition().getAddress());
"http://localhost:9001/services/Service1".equals(addressEndpoint.getDefinition().getAddress()));
"http://localhost:9001/services/Service1".equals(addressEndpoint.getDefinition().getAddress()));
"http://localhost:9001/services/Service1".equals(addressEndpoint.getDefinition().getAddress()));
"http://localhost:9001/services/Service1".equals(addressEndpoint.getDefinition().getAddress()));
public void testAddressEndpointSerialization() { String callConfig = "<call xmlns=\"http://ws.apache.org/ns/synapse\">" + "<endpoint>" + "<address uri='http://localhost:9000/services/MyService1'>" + "<enableAddressing/>" + "<timeout>" + "<duration>60</duration>" + "<responseAction>discard</responseAction>" + "</timeout>" + "</address>" + "</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 address endpoint.", call1.getEndpoint() instanceof AddressEndpoint); AddressEndpoint ep1 = (AddressEndpoint) call1.getEndpoint(); assertTrue("Top level endpoint should be a address endpoint.", call2.getEndpoint() instanceof AddressEndpoint); AddressEndpoint ep2 = (AddressEndpoint) call2.getEndpoint(); assertEquals("Address URI is not serialized properly", ep1.getDefinition().getAddress(), ep2.getDefinition().getAddress()); assertEquals( "Addressing information is not serialized properly", ep1.getDefinition().isAddressingOn(), ep2.getDefinition().isAddressingOn()); }
public void testAddressEndpointSerialization() { String sendConfig = "<send xmlns=\"http://ws.apache.org/ns/synapse\">" + "<endpoint>" + "<address uri='http://localhost:9000/services/MyService1'>" + "<enableAddressing/>" + "<timeout>" + "<duration>60</duration>" + "<responseAction>discard</responseAction>" + "</timeout>" + "</address>" + "</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 address endpoint.", send1.getEndpoint() instanceof AddressEndpoint); AddressEndpoint ep1 = (AddressEndpoint) send1.getEndpoint(); assertTrue("Top level endpoint should be a WSDL endpoint.", send2.getEndpoint() instanceof AddressEndpoint); AddressEndpoint ep2 = (AddressEndpoint) send2.getEndpoint(); assertEquals("Address URI is not serialized properly", ep1.getDefinition().getAddress(), ep2.getDefinition().getAddress()); assertEquals( "Addressing information is not serialized properly", ep1.getDefinition().isAddressingOn(), ep2.getDefinition().isAddressingOn()); }
assertTrue(ep1.isInitialized()); assertEquals(1, registry.getHitCount()); assertEquals("http://test.url", ((AddressEndpoint) ep1).getDefinition().getAddress()); assertTrue(ep4.isInitialized()); assertEquals(2, registry.getHitCount()); assertEquals("http://test2.url", ((AddressEndpoint) ep4).getDefinition().getAddress()); assertTrue(ep1 != ep4); assertTrue(!ep1.isInitialized());
String address = definition.getAddress(); if (address == null && synCtx.getTo() != null && synCtx.getTo().getAddress() != null) {
String address = definition.getAddress(); if (address == null && synCtx.getTo() != null && synCtx.getTo().getAddress() != null) {