use of org.apache.axis2.addressing.EndpointReference in project axis-axis2-java-core by apache.
the class AddressingHelperTest method testIsReplyRedirectedAnonReplyTo.
public void testIsReplyRedirectedAnonReplyTo() {
MessageContext mc = new MessageContext();
mc.setReplyTo(new EndpointReference(AddressingConstants.Final.WSA_ANONYMOUS_URL));
assertFalse(AddressingHelper.isReplyRedirected(mc));
}
use of org.apache.axis2.addressing.EndpointReference in project axis-axis2-java-core by apache.
the class AddressingHelperTest method testIsFaultRedirectedNonAnonFaultTo.
public void testIsFaultRedirectedNonAnonFaultTo() {
MessageContext mc = new MessageContext();
mc.setFaultTo(new EndpointReference("http://ws.apache.org/axis2"));
assertTrue(AddressingHelper.isFaultRedirected(mc));
}
use of org.apache.axis2.addressing.EndpointReference in project axis-axis2-java-core by apache.
the class EndpointReferenceHelperTest method testSetAndGetWSDLLocationMetadataForFinalSpecEPR.
public void testSetAndGetWSDLLocationMetadataForFinalSpecEPR() throws Exception {
String address = "http://ws.apache.org/axis2";
String targetNamespace = "targetNamespace";
String location = "wsdlLocation";
EndpointReference epr = new EndpointReference(address);
OMFactory omf = OMAbstractFactory.getOMFactory();
// Uses final WSDLI namespace on wsdlLocation attribute
EndpointReferenceHelper.setWSDLLocationMetadata(omf, epr, AddressingConstants.Final.WSA_NAMESPACE, new WSDLLocation(targetNamespace, location));
WSDLLocation wsdlLocation = EndpointReferenceHelper.getWSDLLocationMetadata(epr, AddressingConstants.Final.WSA_NAMESPACE);
assertEquals(wsdlLocation.getTargetNamespace(), targetNamespace);
assertEquals(wsdlLocation.getLocation(), location);
}
use of org.apache.axis2.addressing.EndpointReference in project axis-axis2-java-core by apache.
the class EndpointReferenceHelperTest method testGetWSDLLocationMetadataForFinalSpecEPRWithOldWsdliNamespace.
public void testGetWSDLLocationMetadataForFinalSpecEPRWithOldWsdliNamespace() throws Exception {
String address = "http://ws.apache.org/axis2";
String targetNamespace = "targetNamespace";
String location = "wsdlLocation";
EndpointReference epr = new EndpointReference(address);
// Uses old candidate spec WSDLI namespace on wsdlLocation attribute
OMFactory omf = OMAbstractFactory.getOMFactory();
String value = new StringBuffer(targetNamespace).append(" ").append(location).toString();
QName OLD_WSDLI = new QName("http://www.w3.org/2006/01/wsdl-instance", "wsdlLocation", "wsdli");
OMNamespace wsdliNs = omf.createOMNamespace(OLD_WSDLI.getNamespaceURI(), OLD_WSDLI.getPrefix());
OMAttribute attribute = omf.createOMAttribute(OLD_WSDLI.getLocalPart(), wsdliNs, value);
ArrayList list = new ArrayList();
list.add(attribute);
epr.setMetadataAttributes(list);
WSDLLocation wsdlLocation = EndpointReferenceHelper.getWSDLLocationMetadata(epr, AddressingConstants.Final.WSA_NAMESPACE);
assertEquals(wsdlLocation.getTargetNamespace(), targetNamespace);
assertEquals(wsdlLocation.getLocation(), location);
}
use of org.apache.axis2.addressing.EndpointReference in project axis-axis2-java-core by apache.
the class EndpointReferenceHelperTest method testSetAndGetWSDLLocationMetadataForSubmissionSpecEPR.
public void testSetAndGetWSDLLocationMetadataForSubmissionSpecEPR() throws Exception {
String address = "http://ws.apache.org/axis2";
String targetNamespace = "targetNamespace";
String location = "wsdlLocation";
EndpointReference epr = new EndpointReference(address);
OMFactory omf = OMAbstractFactory.getOMFactory();
// Uses final WSDLI namespace on wsdlLocation attribute
EndpointReferenceHelper.setWSDLLocationMetadata(omf, epr, AddressingConstants.Submission.WSA_NAMESPACE, new WSDLLocation(targetNamespace, location));
WSDLLocation wsdlLocation = EndpointReferenceHelper.getWSDLLocationMetadata(epr, AddressingConstants.Submission.WSA_NAMESPACE);
assertEquals(wsdlLocation.getTargetNamespace(), targetNamespace);
assertEquals(wsdlLocation.getLocation(), location);
}
Aggregations