Search in sources :

Example 51 with AddressingFeature

use of javax.xml.ws.soap.AddressingFeature in project narayana by jbosstm.

the class ATInteropClient method getParticipantPort.

// don't think we ever need this as we get a registration port from the endpoint ref returned by
// the activation port request
public static ParticipantPortType getParticipantPort(MAP map, String action) {
    ParticipantService service = getParticipantService();
    ParticipantPortType port = service.getPort(ParticipantPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    String to = map.getTo();
    List<Handler> customHandlerChain = new ArrayList<Handler>();
    /*
         * we need to add the coordination context handler in the case where we are passing a
         * coordination context via a header element
         */
    customHandlerChain.add(new CoordinationContextHandler());
    /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
		customHandlerChain.add(new WSAddressingClientHandler());
         */
    bindingProvider.getBinding().setHandlerChain(customHandlerChain);
    Map<String, Object> requestContext = bindingProvider.getRequestContext();
    map.setAction(action);
    map.setFrom(getInitiator());
    AddressingHelper.configureRequestContext(requestContext, map, to, action);
    return port;
}
Also used : ParticipantService(com.jboss.transaction.txinterop.webservices.atinterop.generated.ParticipantService) AddressingFeature(javax.xml.ws.soap.AddressingFeature) ParticipantPortType(com.jboss.transaction.txinterop.webservices.atinterop.generated.ParticipantPortType) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) ArrayList(java.util.ArrayList) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider)

Example 52 with AddressingFeature

use of javax.xml.ws.soap.AddressingFeature in project narayana by jbosstm.

the class SoapFaultClient method getSoapFaultPort.

private static org.jboss.jbossts.xts.soapfault.SoapFaultPortType getSoapFaultPort(final MAP map, final String action) {
    SoapFaultService service = getSoapFaultService();
    SoapFaultPortType port = service.getPort(org.jboss.jbossts.xts.soapfault.SoapFaultPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    String to = map.getTo();
    /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
        List<Handler> customHandlerChain = new ArrayList<Handler>();
		customHandlerChain.add(new WSAddressingClientHandler());
        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
         */
    Map<String, Object> requestContext = bindingProvider.getRequestContext();
    if (action != null) {
        map.setAction(action);
    }
    AddressingHelper.configureRequestContext(requestContext, map, to, action);
    return port;
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) SoapFaultService(org.jboss.jbossts.xts.soapfault.SoapFaultService) SoapFaultPortType(org.jboss.jbossts.xts.soapfault.SoapFaultPortType) BindingProvider(javax.xml.ws.BindingProvider)

Example 53 with AddressingFeature

use of javax.xml.ws.soap.AddressingFeature in project narayana by jbosstm.

the class SoapFaultClient method getSoapFaultPort.

private static org.jboss.jbossts.xts.soapfault.SoapFaultPortType getSoapFaultPort(final W3CEndpointReference endpoint, final MAP map, final String action) {
    SoapFaultService service = getSoapFaultService();
    org.jboss.jbossts.xts.soapfault.SoapFaultPortType port = service.getPort(endpoint, org.jboss.jbossts.xts.soapfault.SoapFaultPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    Map<String, Object> requestContext = bindingProvider.getRequestContext();
    MAP requestMap = AddressingHelper.outboundMap(requestContext);
    if (action != null) {
        map.setAction(action);
    }
    AddressingHelper.installCallerProperties(map, requestMap);
    String to = requestMap.getTo();
    /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
        List<Handler> customHandlerChain = new ArrayList<Handler>();
		customHandlerChain.add(new WSAddressingClientHandler());
        bindingProvider.getBinding().setHandlerChain(customHandlerChain);
        */
    AddressingHelper.configureRequestContext(requestContext, to, action);
    return port;
}
Also used : AddressingFeature(javax.xml.ws.soap.AddressingFeature) SoapFaultPortType(org.jboss.jbossts.xts.soapfault.SoapFaultPortType) SoapFaultService(org.jboss.jbossts.xts.soapfault.SoapFaultService) BindingProvider(javax.xml.ws.BindingProvider) MAP(org.jboss.ws.api.addressing.MAP)

Example 54 with AddressingFeature

use of javax.xml.ws.soap.AddressingFeature in project narayana by jbosstm.

the class BAInteropClient method getParticipantPort.

// don't think we ever need this as we get a registration port from the endpoint ref returned by
// the activation port request
public static ParticipantPortType getParticipantPort(MAP map, String action) {
    ParticipantService service = getParticipantService();
    ParticipantPortType port = service.getPort(ParticipantPortType.class, new AddressingFeature(true, true));
    BindingProvider bindingProvider = (BindingProvider) port;
    String to = map.getTo();
    List<Handler> customHandlerChain = new ArrayList<Handler>();
    /*
         * we no longer have to add the JaxWS WSAddressingClientHandler because we can specify the WSAddressing feature
		customHandlerChain.add(new WSAddressingClientHandler());
         */
    /*
         * we need to add the coordination context handler in the case where we are passing a
         * coordination context via a header element
         */
    customHandlerChain.add(new CoordinationContextHandler());
    bindingProvider.getBinding().setHandlerChain(customHandlerChain);
    Map<String, Object> requestContext = bindingProvider.getRequestContext();
    map.setAction(action);
    AddressingHelper.configureRequestContext(requestContext, map, to, action);
    return port;
}
Also used : ParticipantService(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantService) AddressingFeature(javax.xml.ws.soap.AddressingFeature) ParticipantPortType(com.jboss.transaction.txinterop.webservices.bainterop.generated.ParticipantPortType) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) ArrayList(java.util.ArrayList) CoordinationContextHandler(com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler) Handler(javax.xml.ws.handler.Handler) BindingProvider(javax.xml.ws.BindingProvider)

Example 55 with AddressingFeature

use of javax.xml.ws.soap.AddressingFeature in project cxf by apache.

the class DispatchOpTest method testResolveOperationWithSourceAndWSA.

@Test
public void testResolveOperationWithSourceAndWSA() throws Exception {
    ServiceImpl service = new ServiceImpl(getBus(), getClass().getResource(WSDL_RESOURCE), SERVICE_NAME, null, new AddressingFeature());
    Dispatch<Source> disp = service.createDispatch(PORT_NAME, Source.class, Service.Mode.PAYLOAD);
    disp.getRequestContext().put(MessageContext.WSDL_OPERATION, OP_NAME);
    disp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ADDRESS);
    d.setMessageObserver(new MessageReplayObserver(RESP_RESOURCE));
    BindingOperationVerifier bov = new BindingOperationVerifier();
    ((DispatchImpl<?>) disp).getClient().getOutInterceptors().add(bov);
    Document doc = StaxUtils.read(getResourceAsStream(REQ_RESOURCE));
    DOMSource source = new DOMSource(doc);
    Source res = disp.invoke(source);
    assertNotNull(res);
    BindingOperationInfo boi = bov.getBindingOperationInfo();
    assertNotNull(boi);
    assertEquals(OP_NAME, boi.getName());
}
Also used : DOMSource(javax.xml.transform.dom.DOMSource) BindingOperationInfo(org.apache.cxf.service.model.BindingOperationInfo) AddressingFeature(javax.xml.ws.soap.AddressingFeature) ServiceImpl(org.apache.cxf.jaxws.ServiceImpl) DispatchImpl(org.apache.cxf.jaxws.DispatchImpl) Document(org.w3c.dom.Document) DOMSource(javax.xml.transform.dom.DOMSource) Source(javax.xml.transform.Source) MessageReplayObserver(org.apache.cxf.jaxws.MessageReplayObserver) Test(org.junit.Test) AbstractJaxWsTest(org.apache.cxf.jaxws.AbstractJaxWsTest)

Aggregations

AddressingFeature (javax.xml.ws.soap.AddressingFeature)67 BindingProvider (javax.xml.ws.BindingProvider)35 URL (java.net.URL)18 QName (javax.xml.namespace.QName)13 Test (org.junit.Test)13 Service (javax.xml.ws.Service)8 ArrayList (java.util.ArrayList)7 WebServiceFeature (javax.xml.ws.WebServiceFeature)7 MTOMFeature (javax.xml.ws.soap.MTOMFeature)7 MAP (org.jboss.ws.api.addressing.MAP)5 RespectBindingFeature (javax.xml.ws.RespectBindingFeature)4 LinkedList (java.util.LinkedList)3 DispatchImpl (org.apache.cxf.jaxws.DispatchImpl)3 WSAddressingFeature (org.apache.cxf.ws.addressing.WSAddressingFeature)3 SoapFaultPortType (org.jboss.jbossts.xts.soapfault.SoapFaultPortType)3 CoordinationContextHandler (com.jboss.transaction.txinterop.webservices.handlers.CoordinationContextHandler)2 Sc007Service (com.jboss.transaction.wstf.webservices.sc007.generated.Sc007Service)2 WSBinding (com.sun.xml.ws.api.WSBinding)2 ServletAdapterList (com.sun.xml.ws.transport.http.servlet.ServletAdapterList)2 Closeable (java.io.Closeable)2