public static void addWSDLProperties(MessageContext jaxwsMessageContext) {
org.apache.axis2.context.MessageContext msgContext =
jaxwsMessageContext.getAxisMessageContext();
ServiceContext serviceContext = msgContext.getServiceContext();
SOAPMessageContext soapMessageContext = null;
if (serviceContext != null) {
WebServiceContext wsc =
(WebServiceContext)serviceContext.getProperty(WEBSERVICE_MESSAGE_CONTEXT);
if (wsc != null) {
soapMessageContext = (SOAPMessageContext)wsc.getMessageContext();
}
}
OperationDescription op = jaxwsMessageContext.getOperationDescription();
if (op != null && soapMessageContext != null) {
soapMessageContext
.put(javax.xml.ws.handler.MessageContext.WSDL_OPERATION, op.getName());
soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.WSDL_OPERATION,
Scope.APPLICATION);
if (log.isDebugEnabled()) {
log.debug("WSDL_OPERATION :" + op.getName());
}
EndpointInterfaceDescription eid = op.getEndpointInterfaceDescription();
if (eid != null) {
EndpointDescription ed = eid.getEndpointDescription();
QName portType = eid.getPortType();
if (portType == null || portType.getLocalPart() == "") {
if (log.isDebugEnabled()) {
log.debug(
"Did not get port type from EndpointInterfaceDescription, attempting to get PortType from EndpointDescription");
}
}
if (ed != null) {
soapMessageContext
.put(javax.xml.ws.handler.MessageContext.WSDL_PORT, ed.getPortQName());
soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.WSDL_PORT,
Scope.APPLICATION);
if (log.isDebugEnabled()) {
log.debug("WSDL_PORT :" + ed.getPortQName());
}
}
soapMessageContext
.put(javax.xml.ws.handler.MessageContext.WSDL_INTERFACE, portType);
soapMessageContext.setScope(javax.xml.ws.handler.MessageContext.WSDL_INTERFACE,
Scope.APPLICATION);
if (log.isDebugEnabled()) {
log.debug("WSDL_INTERFACE :" + portType);
}
}