Author: heiko.braun(a)jboss.com
Date: 2007-01-10 05:44:34 -0500 (Wed, 10 Jan 2007)
New Revision: 1887
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
Log:
Fix JBCTS-454
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-10
10:19:51 UTC (rev 1886)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonClient.java 2007-01-10
10:44:34 UTC (rev 1887)
@@ -331,9 +331,10 @@
log.debug("Handler modified body payload, unbind message
again");
SOAPMessage resMessage = msgContext.getSOAPMessage();
binding.unbindResponseMessage(opMetaData, resMessage, epInv,
unboundHeaders);
+
+ retObj = syncOutputParams(inputParams, epInv);
}
- retObj = syncOutputParams(inputParams, epInv);
}
return retObj;
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-01-10
10:19:51 UTC (rev 1886)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/CommonSOAPBinding.java 2007-01-10
10:44:34 UTC (rev 1887)
@@ -304,7 +304,7 @@
if (opMetaData.isRPCEncoded())
XOPContext.setMTOMEnabled(false);
else
- XOPContext.setMTOMEnabled( isMTOMEnabled() ); // TODO: shouldn't this
depend on the request encoding?
+ XOPContext.setMTOMEnabled( isMTOMEnabled() );
// Associate current message with message context
SOAPMessageImpl resMessage = (SOAPMessageImpl)createMessage(opMetaData);
Modified: trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java
===================================================================
--- trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2007-01-10
10:19:51 UTC (rev 1886)
+++ trunk/jbossws-core/src/main/java/org/jboss/ws/core/EndpointInvocation.java 2007-01-10
10:44:34 UTC (rev 1887)
@@ -337,7 +337,7 @@
{
try
{
- if (param.getIndex() >= 0)
+ if (param.getIndex() >= 0 &&
!outParameters.containsKey(param.getIndex()) )
outParameters.put(param.getIndex(),
targetParameterTypes[param.getIndex()].newInstance());
}
catch (Exception e)
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2007-01-10
10:19:51 UTC (rev 1886)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxrpc/ParameterWrapping.java 2007-01-10
10:44:34 UTC (rev 1887)
@@ -230,7 +230,7 @@
{
Class targetType = targetTypes[param.getIndex()];
if (HolderUtils.isHolderType(targetType))
- value = HolderUtils.createHolderInstance(value, targetType);
+ HolderUtils.setHolderValue(methodParams[param.getIndex()], value);
methodParams[param.getIndex()] = value;
}
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java 2007-01-10
10:19:51 UTC (rev 1886)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/jaxws/client/WebServiceRefDeployer.java 2007-01-10
10:44:34 UTC (rev 1887)
@@ -80,6 +80,6 @@
if (sref.getWsdlLocation() == null && wsref.wsdlLocation().length() >
0)
sref.setWsdlLocation(wsref.wsdlLocation());
- Util.bind(ctx, jndiName, new ServiceReferenceable(serviceTypeName, portTypeName,
sref));
+ Util.rebind(ctx, jndiName, new ServiceReferenceable(serviceTypeName, portTypeName,
sref));
}
}
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-01-10
10:19:51 UTC (rev 1886)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/core/server/AbstractServiceEndpointInvoker.java 2007-01-10
10:44:34 UTC (rev 1887)
@@ -175,7 +175,7 @@
// Set the outbound property
if (epMetaData.getType() == EndpointMetaData.Type.JAXWS)
- msgContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY, new
Boolean(true));
+ msgContext.setProperty(MessageContext.MESSAGE_OUTBOUND_PROPERTY,
Boolean.TRUE);
if(binding instanceof CommonSOAPBinding)
XOPContext.setMTOMEnabled( ((CommonSOAPBinding)binding).isMTOMEnabled());
Modified:
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java
===================================================================
---
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2007-01-10
10:19:51 UTC (rev 1886)
+++
trunk/jbossws-core/src/main/java/org/jboss/ws/extensions/xop/jaxws/AttachmentMarshallerImpl.java 2007-01-10
10:44:34 UTC (rev 1887)
@@ -30,16 +30,23 @@
super();
}
- public String addMtomAttachment(DataHandler dataHandler, String string, String
string1)
+ /**
+ * @param data - represents the data to be attached. Must be non-null.
+ * @param elementNamespace - the namespace URI of the element that encloses the
base64Binary data. Can be empty but never null.
+ * @param elementLocalName - The local name of the element. Always a non-null valid
string.
+ *
+ * @return content-id URI, cid, to the attachment containing data or null if data
should be inlined.
+ */
+ public String addMtomAttachment(DataHandler data, String elementNamespace, String
elementLocalName)
{
CommonMessageContext msgContext = MessageContextAssociation.peekMessageContext();
SOAPMessageImpl soapMessage = (SOAPMessageImpl)msgContext.getSOAPMessage();
- QName xmlName = new QName(string, string1);
+ QName xmlName = new QName(elementNamespace, elementLocalName);
log.debug("serialize: [xmlName=" + xmlName + "]");
String cid =
soapMessage.getCidGenerator().generateFromName(xmlName.getLocalPart());
- AttachmentPart xopPart = soapMessage.createAttachmentPart(dataHandler);
+ AttachmentPart xopPart = soapMessage.createAttachmentPart(data);
xopPart.addMimeHeader(MimeConstants.CONTENT_ID, '<' + cid +
'>'); // RFC2392 requirement
soapMessage.addAttachmentPart(xopPart);
@@ -48,9 +55,26 @@
return "cid:" + cid;
}
- public String addMtomAttachment(byte[] bytes, int i, int i1, String string, String
string1, String string2)
+ /**
+ * @param data - represents the data to be attached. Must be non-null. The actual data
region is specified by (data,offset,length) tuple.
+ * @param offset - The offset within the array of the first byte to be read; must be
non-negative and no larger than array.length
+ * @param length - The number of bytes to be read from the given array; must be
non-negative and no larger than array.length
+ * @param mimeType - If the data has an associated MIME type known to JAXB, that is
passed as this parameter. If none is known, "application/octet-stream". This
parameter may never be null.
+ * @param elementNamespace - the namespace URI of the element that encloses the
base64Binary data. Can be empty but never null.
+ * @param elementLocalName - The local name of the element. Always a non-null valid
string.
+ *
+ * @return content-id URI, cid, to the attachment containing data or null if data
should be inlined.
+ */
+ public String addMtomAttachment(byte[] data, int offset, int length,
+ String mimeType, String elementNamespace, String
elementLocalName)
{
- throw new WSException("Not yet implemented");
+
+ if(true)
+ mimeType = null; // ignore the mime type. otherwise the content handlers will
fail
+
+ String contentType = mimeType != null ? mimeType :
"application/octet-stream";
+ DataHandler dh = new DataHandler(data, contentType);
+ return addMtomAttachment(dh, elementNamespace, elementLocalName);
}
public String addSwaRefAttachment(DataHandler dataHandler)