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);
}
Aggregations