Search in sources :

Example 1 with WSBindingProvider

use of com.sun.xml.ws.developer.WSBindingProvider in project metro-jax-ws by eclipse-ee4j.

the class WSATest method testEcho.

public void testEcho() {
    // setting user defined MessageID:
    List<Header> headers = new ArrayList<Header>();
    headers.add(new StringHeader(AddressingVersion.W3C.messageIDTag, "userDefinedMessageID"));
    ((WSBindingProvider) port).setOutboundHeaders(headers);
    port.echoString("String to be echoed");
// without fix, there is duplicit header wsa:MessageID so the WS call crashes with
// SOAPFaultException: A header representing a Message Addressing Property is
// not valid and the message cannot be processed ...
}
Also used : StringHeader(com.sun.xml.ws.message.StringHeader) Header(com.sun.xml.ws.api.message.Header) StringHeader(com.sun.xml.ws.message.StringHeader) ArrayList(java.util.ArrayList) WSBindingProvider(com.sun.xml.ws.developer.WSBindingProvider)

Example 2 with WSBindingProvider

use of com.sun.xml.ws.developer.WSBindingProvider in project metro-jax-ws by eclipse-ee4j.

the class WSDLEprExtensionsTest method testEprWithDispatchWithoutWSDL.

/**
 * Tests client-side access to EPR extensions specified in WSDL
 * @throws Exception
 */
public void testEprWithDispatchWithoutWSDL() throws Exception {
    Service service = Service.create(serviceName);
    service.addPort(portName, jakarta.xml.ws.soap.SOAPBinding.SOAP11HTTP_BINDING, endpointAddress);
    Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    WSEndpointReference wsepr = ((WSBindingProvider) dispatch).getWSEndpointReference();
    assertTrue(wsepr.getEPRExtensions().isEmpty());
}
Also used : WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) WSBindingProvider(com.sun.xml.ws.developer.WSBindingProvider) Service(jakarta.xml.ws.Service) Dispatch(jakarta.xml.ws.Dispatch)

Example 3 with WSBindingProvider

use of com.sun.xml.ws.developer.WSBindingProvider in project metro-jax-ws by eclipse-ee4j.

the class WSDLEprExtensionsTest method testEprWithDispatchWithWSDL.

/**
 * Tests client-side access to EPR extensions specified in WSDL
 * @throws Exception
 */
public void testEprWithDispatchWithWSDL() throws Exception {
    Service service = new HelloService();
    Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    WSEndpointReference wsepr = ((WSBindingProvider) dispatch).getWSEndpointReference();
    assertTrue(wsepr.getEPRExtensions().size() == 1);
    WSEndpointReference.EPRExtension idExtn = wsepr.getEPRExtension(new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity"));
    assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity")));
}
Also used : QName(javax.xml.namespace.QName) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) WSBindingProvider(com.sun.xml.ws.developer.WSBindingProvider) Service(jakarta.xml.ws.Service) Dispatch(jakarta.xml.ws.Dispatch)

Example 4 with WSBindingProvider

use of com.sun.xml.ws.developer.WSBindingProvider in project metro-jax-ws by eclipse-ee4j.

the class WSDLEprExtensionsTest method testEprWithSEI.

/**
 * Tests client-side access to EPR extensions specified in WSDL
 * @throws Exception
 */
public void testEprWithSEI() throws Exception {
    HelloService service = new HelloService();
    Hello hello = service.getHelloPort();
    WSEndpointReference wsepr = ((WSBindingProvider) hello).getWSEndpointReference();
    assertTrue(wsepr.getEPRExtensions().size() == 1);
    WSEndpointReference.EPRExtension idExtn = wsepr.getEPRExtension(new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity"));
    assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity")));
}
Also used : QName(javax.xml.namespace.QName) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) WSBindingProvider(com.sun.xml.ws.developer.WSBindingProvider)

Example 5 with WSBindingProvider

use of com.sun.xml.ws.developer.WSBindingProvider in project metro-jax-ws by eclipse-ee4j.

the class EprExtensionsContributorTest method testEprWithDispatchWithWSDL.

/**
 * Tests client-side access to EPR extensions specified in WSDL
 *
 * @throws Exception
 */
public void testEprWithDispatchWithWSDL() throws Exception {
    Service service = new HelloService();
    Dispatch dispatch = service.createDispatch(portName, Source.class, Service.Mode.PAYLOAD);
    WSEndpointReference wsepr = ((WSBindingProvider) dispatch).getWSEndpointReference();
    assertTrue(wsepr.getEPRExtensions().size() == 2);
    WSEndpointReference.EPRExtension idExtn = wsepr.getEPRExtension(new QName("http://example.com/addressingidentity", "Identity"));
    assertTrue(idExtn != null && idExtn.getQName().equals(new QName("http://example.com/addressingidentity", "Identity")));
}
Also used : QName(javax.xml.namespace.QName) WSEndpointReference(com.sun.xml.ws.api.addressing.WSEndpointReference) WSBindingProvider(com.sun.xml.ws.developer.WSBindingProvider) Service(jakarta.xml.ws.Service) Dispatch(jakarta.xml.ws.Dispatch)

Aggregations

WSBindingProvider (com.sun.xml.ws.developer.WSBindingProvider)12 WSEndpointReference (com.sun.xml.ws.api.addressing.WSEndpointReference)11 QName (javax.xml.namespace.QName)8 Dispatch (jakarta.xml.ws.Dispatch)6 Service (jakarta.xml.ws.Service)6 Header (com.sun.xml.ws.api.message.Header)3 Component (com.sun.xml.ws.api.Component)2 EndpointAddress (com.sun.xml.ws.api.EndpointAddress)2 WSBinding (com.sun.xml.ws.api.WSBinding)2 WSPortInfo (com.sun.xml.ws.api.client.WSPortInfo)2 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)2 ClientTubeAssemblerContext (com.sun.xml.ws.api.pipe.ClientTubeAssemblerContext)2 WSServiceDelegate (com.sun.xml.ws.client.WSServiceDelegate)2 EndpointReference (jakarta.xml.ws.EndpointReference)2 List (java.util.List)2 BindingID (com.sun.xml.ws.api.BindingID)1 WSService (com.sun.xml.ws.api.WSService)1 Container (com.sun.xml.ws.api.server.Container)1 StringHeader (com.sun.xml.ws.message.StringHeader)1 AddressingFeature (jakarta.xml.ws.soap.AddressingFeature)1