Search in sources :

Example 6 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 7 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 8 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 9 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 10 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)37 Test (org.junit.Test)17 QName (javax.xml.namespace.QName)9 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)9 URL (java.net.URL)8 InputStream (java.io.InputStream)6 StreamResult (javax.xml.transform.stream.StreamResult)6 EndpointReference (javax.xml.ws.EndpointReference)6 Element (org.w3c.dom.Element)6 Number (org.apache.cxf.factory_pattern.Number)5 NumberFactory (org.apache.cxf.factory_pattern.NumberFactory)5 NumberFactoryService (org.apache.cxf.factory_pattern.NumberFactoryService)5 NumberService (org.apache.cxf.factory_pattern.NumberService)5 Document (org.w3c.dom.Document)5 Source (javax.xml.transform.Source)4 Endpoint (javax.xml.ws.Endpoint)4 ServiceImpl (org.apache.cxf.jaxws.ServiceImpl)4 ArrayList (java.util.ArrayList)2 JAXBContext (javax.xml.bind.JAXBContext)2 JAXBException (javax.xml.bind.JAXBException)2