use of org.apache.cxf.endpoint.Endpoint in project tomee by apache.
the class EjbMessageContext method getEndpointReference.
public EndpointReference getEndpointReference(Element... referenceParameters) {
org.apache.cxf.message.Message msg = getWrappedMessage();
Endpoint ep = msg.getExchange().get(Endpoint.class);
W3CEndpointReferenceBuilder builder = new W3CEndpointReferenceBuilder();
builder.address(ep.getEndpointInfo().getAddress());
builder.serviceName(ep.getService().getName());
builder.endpointName(ep.getEndpointInfo().getName());
if (referenceParameters != null) {
for (Element referenceParameter : referenceParameters) {
builder.referenceParameter(referenceParameter);
}
}
return builder.build();
}
use of org.apache.cxf.endpoint.Endpoint in project ddf by codice.
the class PolicyWSDLGetInterceptor method handleMessage.
// Majority of this method is from the WSDLGetInterceptor, in-line comments
// specify which areas were added
@Override
public void handleMessage(Message message) throws Fault {
String method = (String) message.get(Message.HTTP_REQUEST_METHOD);
String query = (String) message.get(Message.QUERY_STRING);
if (!"GET".equals(method) || StringUtils.isEmpty(query)) {
return;
}
String baseUri = (String) message.get(Message.REQUEST_URL);
String ctx = (String) message.get(Message.PATH_INFO);
Map<String, String> map = UrlUtils.parseQueryString(query);
if (isRecognizedQuery(map, baseUri, ctx, message.getExchange().getEndpoint().getEndpointInfo())) {
Document doc = getDocument(message, baseUri, map, ctx);
// DDF- start ADDED code
if (map.containsKey("wsdl")) {
doc = addPolicyToWSDL(doc, loader.getPolicy());
doc = configureAddress(doc);
}
// DDF- end of ADDED code
Endpoint e = message.getExchange().get(Endpoint.class);
Message mout = new MessageImpl();
mout.setExchange(message.getExchange());
mout = e.getBinding().createMessage(mout);
mout.setInterceptorChain(OutgoingChainInterceptor.getOutInterceptorChain(message.getExchange()));
message.getExchange().setOutMessage(mout);
mout.put(WSDLGetInterceptor.DOCUMENT_HOLDER, doc);
mout.put(Message.CONTENT_TYPE, "text/xml");
// just remove the interceptor which should not be used
cleanUpOutInterceptors(mout);
// notice this is being added after the purge above, don't swap the order!
mout.getInterceptorChain().add(WSDLGetOutInterceptor.INSTANCE);
// DDF- CHANGED TRANSFORM_SKIP to transform.skip because private field
message.getExchange().put("transform.skip", Boolean.TRUE);
// skip the service executor and goto the end of the chain.
message.getInterceptorChain().doInterceptStartingAt(message, OutgoingChainInterceptor.class.getName());
}
}
Aggregations