Search in sources :

Example 61 with W3CEndpointReference

use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.

the class BankImpl method createEprAccount.

public W3CEndpointReference createEprAccount(String accountName) {
    System.out.println("[Bank] Called createEprAccount( " + accountName + " )...");
    System.out.println();
    W3CEndpointReference ref = createAccountReference(accountName);
    if (ref != null) {
        accountList.put(accountName, ref);
    }
    return ref;
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference)

Example 62 with W3CEndpointReference

use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.

the class BankImpl method createAccount.

public W3CEndpointReference createAccount(String accountName) {
    System.out.println("[Bank] Called createAccount( " + accountName + " )...");
    System.out.println();
    W3CEndpointReference ref = null;
    ref = createAccountReference(accountName);
    if (ref != null) {
        accountList.put(accountName, ref);
    }
    return ref;
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference)

Example 63 with W3CEndpointReference

use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.

the class ProviderImplTest method testCreateW3CEprNoMetadataEmptyCustomMetadata.

@org.junit.Test
public void testCreateW3CEprNoMetadataEmptyCustomMetadata() throws Exception {
    ProviderImpl impl = new ProviderImpl();
    W3CEndpointReference w3Epr = impl.createW3CEndpointReference("http://myaddress", null, null, new ArrayList<>(), null, null);
    java.io.StringWriter sw = new java.io.StringWriter();
    StreamResult result = new StreamResult(sw);
    w3Epr.writeTo(result);
    assertTrue("Address is expected", sw.toString().contains("Address"));
    assertFalse("empty Metadata element should be dropped", sw.toString().contains("Metadata"));
}
Also used : StreamResult(javax.xml.transform.stream.StreamResult) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference)

Example 64 with W3CEndpointReference

use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.

the class ProviderImplTest method testCreateW3CEprNoMetadata.

@org.junit.Test
public void testCreateW3CEprNoMetadata() throws Exception {
    ProviderImpl impl = new ProviderImpl();
    W3CEndpointReference w3Epr = impl.createW3CEndpointReference("http://myaddress", null, null, null, null, null, null, null, null);
    java.io.StringWriter sw = new java.io.StringWriter();
    StreamResult result = new StreamResult(sw);
    w3Epr.writeTo(result);
    assertTrue("Address is expected", sw.toString().contains("Address"));
    assertFalse("empty Metadata element should be dropped", sw.toString().contains("Metadata"));
}
Also used : StreamResult(javax.xml.transform.stream.StreamResult) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference)

Example 65 with W3CEndpointReference

use of javax.xml.ws.wsaddressing.W3CEndpointReference in project cxf by apache.

the class ProviderImplTest method testCreateW3CEpr.

@org.junit.Test
public void testCreateW3CEpr() throws Exception {
    QName serviceName = new QName("http://cxf.apache.org", "ServiceName");
    QName portName = new QName("http://cxf.apache.org", "PortName");
    ProviderImpl impl = new ProviderImpl();
    W3CEndpointReference w3Epr = impl.createW3CEndpointReference("http://myaddress", serviceName, portName, null, "wsdlLoc", null);
    java.io.StringWriter sw = new java.io.StringWriter();
    StreamResult result = new StreamResult(sw);
    w3Epr.writeTo(result);
    String expected = "<wsdl:definitions";
    assertTrue("Embeded wsdl element is not generated", sw.toString().indexOf(expected) > -1);
    assertTrue("wsdlLocation attribute has the wrong value", sw.toString().contains(":wsdlLocation=\"http://cxf.apache.org wsdlLoc\""));
}
Also used : StreamResult(javax.xml.transform.stream.StreamResult) QName(javax.xml.namespace.QName) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference)

Aggregations

W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)154 Test (org.junit.Test)80 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)56 MAP (org.jboss.ws.api.addressing.MAP)53 SystemException (com.arjuna.wst.SystemException)16 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)16 QName (javax.xml.namespace.QName)16 W3CEndpointReferenceBuilder (javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder)16 InvalidCreateParametersException (com.arjuna.wsc.InvalidCreateParametersException)15 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)14 WrongStateException (com.arjuna.wst.WrongStateException)12 TransactionRolledBackException (com.arjuna.wst.TransactionRolledBackException)11 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)9 CoordinationContext (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext)9 TxContextImple (com.arjuna.mwlabs.wst11.ba.context.TxContextImple)8 State (com.arjuna.webservices11.wsba.State)8 InvalidProtocolException (com.arjuna.wsc.InvalidProtocolException)8 CoordinatorCompletionCoordinatorDetails (com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails)8 ParticipantCompletionParticipantDetails (com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails)8 URL (java.net.URL)8