Author: thomas.diesler(a)jboss.com
Date: 2008-06-03 12:03:06 -0400 (Tue, 03 Jun 2008)
New Revision: 7297
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
Log:
[JBWS-2013] Implement standard message context properties
Modified:
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java
===================================================================
---
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2008-06-03
15:55:29 UTC (rev 7296)
+++
stack/native/trunk/modules/core/src/main/java/org/jboss/ws/core/jaxws/handler/MessageContextJAXWS.java 2008-06-03
16:03:06 UTC (rev 7297)
@@ -23,23 +23,23 @@
// $Id: MessageContextImpl.java 275 2006-05-04 21:36:29Z jason.greene(a)jboss.com $
+import java.io.IOException;
+import java.net.URL;
+
import javax.xml.ws.handler.MessageContext;
-import javax.xml.soap.AttachmentPart;
-import javax.xml.soap.SOAPException;
import org.jboss.logging.Logger;
+import org.jboss.ws.WSException;
import org.jboss.ws.core.CommonMessageContext;
import org.jboss.ws.core.binding.SerializationContext;
import org.jboss.ws.core.jaxws.SerializationContextJAXWS;
import org.jboss.ws.core.soap.MessageContextAssociation;
-import org.jboss.ws.core.soap.attachment.SwapableMemoryDataSource;
import org.jboss.ws.metadata.umdm.EndpointMetaData;
import org.jboss.ws.metadata.umdm.OperationMetaData;
import org.jboss.ws.metadata.umdm.ServiceMetaData;
import org.jboss.xb.binding.NamespaceRegistry;
+import org.xml.sax.InputSource;
-import java.util.Iterator;
-
/**
* The interface MessageContext abstracts the message context that is processed by a
handler in the handle method.
*
@@ -111,10 +111,10 @@
MessageContextAssociation.popMessageContext();
SOAPMessageContextJAXWS resContext = new SOAPMessageContextJAXWS(reqContext);
resContext.setSOAPMessage(null);
-
+
// Reverse the direction
resContext.put(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new Boolean(!outbound));
-
+
MessageContextAssociation.pushMessageContext(resContext);
cleanupAttachments(reqContext);
@@ -125,7 +125,31 @@
public void setOperationMetaData(OperationMetaData opMetaData)
{
super.setOperationMetaData(opMetaData);
+
+ // [JBWS-2031] Implement standard message context properties
if (opMetaData != null)
- this.put(MessageContext.WSDL_OPERATION, opMetaData.getQName());
+ {
+ EndpointMetaData epMetaData = opMetaData.getEndpointMetaData();
+ ServiceMetaData serviceMetaData = epMetaData.getServiceMetaData();
+
+ URL wsdlURL = serviceMetaData.getWsdlFileOrLocation();
+ if (wsdlURL != null)
+ {
+ try
+ {
+ InputSource inputSource = new InputSource(wsdlURL.openStream());
+ put(MessageContext.WSDL_DESCRIPTION, inputSource);
+ }
+ catch (IOException ex)
+ {
+ throw new WSException("Cannot open: " + wsdlURL);
+ }
+ }
+
+ put(MessageContext.WSDL_SERVICE, serviceMetaData.getServiceName());
+ put(MessageContext.WSDL_PORT, epMetaData.getPortName());
+ put(MessageContext.WSDL_INTERFACE, epMetaData.getPortTypeName());
+ put(MessageContext.WSDL_OPERATION, opMetaData.getQName());
+ }
}
}
Show replies by date