Search in sources :

Example 36 with EndpointReference

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));
}
Also used : MessageContext(org.apache.axis2.context.MessageContext)

Example 37 with EndpointReference

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));
}
Also used : MessageContext(org.apache.axis2.context.MessageContext)

Example 38 with EndpointReference

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);
}
Also used : OMFactory(org.apache.axiom.om.OMFactory) WSDLLocation(org.apache.axis2.addressing.metadata.WSDLLocation)

Example 39 with EndpointReference

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);
}
Also used : OMFactory(org.apache.axiom.om.OMFactory) OMNamespace(org.apache.axiom.om.OMNamespace) QName(javax.xml.namespace.QName) ArrayList(java.util.ArrayList) WSDLLocation(org.apache.axis2.addressing.metadata.WSDLLocation) OMAttribute(org.apache.axiom.om.OMAttribute)

Example 40 with EndpointReference

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);
}
Also used : OMFactory(org.apache.axiom.om.OMFactory) WSDLLocation(org.apache.axis2.addressing.metadata.WSDLLocation)

Aggregations

EndpointReference (org.apache.axis2.addressing.EndpointReference)261 Options (org.apache.axis2.client.Options)99 OMElement (org.apache.axiom.om.OMElement)67 AxisFault (org.apache.axis2.AxisFault)66 MessageContext (org.apache.axis2.context.MessageContext)58 ConfigurationContext (org.apache.axis2.context.ConfigurationContext)57 ServiceClient (org.apache.axis2.client.ServiceClient)54 QName (javax.xml.namespace.QName)40 ArrayList (java.util.ArrayList)37 AxisService (org.apache.axis2.description.AxisService)28 Map (java.util.Map)25 MessageContext (org.apache.synapse.MessageContext)25 Axis2MessageContext (org.apache.synapse.core.axis2.Axis2MessageContext)25 Test (org.junit.Test)20 IOException (java.io.IOException)19 SOAPEnvelope (org.apache.axiom.soap.SOAPEnvelope)18 RelatesTo (org.apache.axis2.addressing.RelatesTo)18 URL (java.net.URL)17 SOAPFactory (org.apache.axiom.soap.SOAPFactory)17 AxisConfiguration (org.apache.axis2.engine.AxisConfiguration)17