Search in sources :

Example 1 with AppSequenceType

use of org.apache.cxf.ws.discovery.wsdl.AppSequenceType in project cxf by apache.

the class WSDiscoveryClient method addAddressing.

private void addAddressing(BindingProvider p, boolean addSeq, String action) {
    AddressingProperties addrProperties = new AddressingProperties();
    if (action != null) {
        AttributedURIType act = new AttributedURIType();
        act.setValue(action);
        addrProperties.setAction(act);
    }
    if (adHoc) {
        EndpointReferenceType to = new EndpointReferenceType();
        addrProperties.exposeAs(version.getAddressingNamespace());
        AttributedURIType epr = new AttributedURIType();
        epr.setValue(version.getToAddress());
        to.setAddress(epr);
        addrProperties.setTo(to);
        if (addSeq) {
            AppSequenceType s = new AppSequenceType();
            s.setInstanceId(instanceId);
            s.setMessageNumber(msgId.getAndIncrement());
            JAXBElement<AppSequenceType> seq = new ObjectFactory().createAppSequence(s);
            Header h = new Header(seq.getName(), seq, new JAXBDataBinding(getJAXBContext()));
            List<Header> headers = new ArrayList<>();
            headers.add(h);
            p.getRequestContext().put(Header.HEADER_LIST, headers);
        }
    } else {
        addrProperties.exposeAs(version.getAddressingNamespace());
    }
    p.getRequestContext().put(JAXWSAConstants.CLIENT_ADDRESSING_PROPERTIES, addrProperties);
}
Also used : EndpointReferenceType(org.apache.cxf.ws.addressing.EndpointReferenceType) ObjectFactory(org.apache.cxf.ws.discovery.wsdl.ObjectFactory) Header(org.apache.cxf.headers.Header) AttributedURIType(org.apache.cxf.ws.addressing.AttributedURIType) ArrayList(java.util.ArrayList) AddressingProperties(org.apache.cxf.ws.addressing.AddressingProperties) JAXBDataBinding(org.apache.cxf.jaxb.JAXBDataBinding) AppSequenceType(org.apache.cxf.ws.discovery.wsdl.AppSequenceType)

Aggregations

ArrayList (java.util.ArrayList)1 Header (org.apache.cxf.headers.Header)1 JAXBDataBinding (org.apache.cxf.jaxb.JAXBDataBinding)1 AddressingProperties (org.apache.cxf.ws.addressing.AddressingProperties)1 AttributedURIType (org.apache.cxf.ws.addressing.AttributedURIType)1 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)1 AppSequenceType (org.apache.cxf.ws.discovery.wsdl.AppSequenceType)1 ObjectFactory (org.apache.cxf.ws.discovery.wsdl.ObjectFactory)1