Author: alessio.soldano(a)jboss.com
Date: 2007-10-31 05:40:07 -0400 (Wed, 31 Oct 2007)
New Revision: 4950
Modified:
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/jaxws/binding/ClientHandler2.java
Log:
[JBWS-1876] Fix issue
Modified:
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java
===================================================================
---
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2007-10-31
09:23:03 UTC (rev 4949)
+++
stack/native/branches/asoldano/trunk/src/main/java/org/jboss/ws/core/soap/SOAPMessageImpl.java 2007-10-31
09:40:07 UTC (rev 4950)
@@ -23,16 +23,6 @@
// $Id$
-import org.jboss.ws.WSException;
-import org.jboss.ws.core.SOAPMessageAbstraction;
-import org.jboss.ws.core.CommonMessageContext;
-import org.jboss.ws.core.soap.attachment.*;
-import org.jboss.ws.extensions.xop.XOPContext;
-import org.jboss.ws.metadata.umdm.EndpointMetaData;
-import org.jboss.ws.metadata.umdm.OperationMetaData;
-
-import javax.mail.MessagingException;
-import javax.xml.soap.*;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Collection;
@@ -40,6 +30,31 @@
import java.util.LinkedList;
import java.util.List;
+import javax.mail.MessagingException;
+import javax.xml.soap.AttachmentPart;
+import javax.xml.soap.MimeHeader;
+import javax.xml.soap.MimeHeaders;
+import javax.xml.soap.SOAPConstants;
+import javax.xml.soap.SOAPElement;
+import javax.xml.soap.SOAPEnvelope;
+import javax.xml.soap.SOAPException;
+import javax.xml.soap.SOAPFault;
+import javax.xml.soap.SOAPMessage;
+import javax.xml.soap.SOAPPart;
+
+import org.jboss.ws.WSException;
+import org.jboss.ws.core.CommonMessageContext;
+import org.jboss.ws.core.SOAPMessageAbstraction;
+import org.jboss.ws.core.soap.attachment.AttachmentPartImpl;
+import org.jboss.ws.core.soap.attachment.CIDGenerator;
+import org.jboss.ws.core.soap.attachment.MimeConstants;
+import org.jboss.ws.core.soap.attachment.MultipartRelatedEncoder;
+import org.jboss.ws.core.soap.attachment.MultipartRelatedSwAEncoder;
+import org.jboss.ws.core.soap.attachment.MultipartRelatedXOPEncoder;
+import org.jboss.ws.extensions.xop.XOPContext;
+import org.jboss.ws.metadata.umdm.EndpointMetaData;
+import org.jboss.ws.metadata.umdm.OperationMetaData;
+
/**
* The root class for all SOAP messages. As transmitted on the "wire", a SOAP
message is an XML document or a
* MIME message whose first body part is an XML/SOAP document.
@@ -207,7 +222,15 @@
return new MimeMatchingAttachmentsIterator(headers, attachments);
}
-
+
+ private String getSOAPContentType() throws SOAPException
+ {
+ if
(SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(soapPart.getEnvelope().getNamespaceURI()))
+ return SOAPConstants.SOAP_1_2_CONTENT_TYPE;
+ else
+ return SOAPConstants.SOAP_1_1_CONTENT_TYPE;
+ }
+
public void saveChanges() throws SOAPException
{
if (saveRequired == true)
@@ -220,7 +243,7 @@
throw new IllegalStateException("XOP parameter not properly
inlined");
// default content-type
- String contentType = MimeConstants.TYPE_SOAP11 + "; charset=" +
getCharSetEncoding();
+ String contentType = getSOAPContentType() + "; charset=" +
getCharSetEncoding();
if (hasAttachments)
{
Modified:
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/jaxws/binding/ClientHandler2.java
===================================================================
---
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/jaxws/binding/ClientHandler2.java 2007-10-31
09:23:03 UTC (rev 4949)
+++
stack/native/branches/asoldano/trunk/src/test/java/org/jboss/test/ws/jaxws/binding/ClientHandler2.java 2007-10-31
09:40:07 UTC (rev 4950)
@@ -50,7 +50,6 @@
MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
String[] ct = mimeHeaders.getHeader("Content-Type");
- System.out.println(mimeHeaders);
if (ct != null)
{
for (int i = 0; i < ct.length; i++)
@@ -72,7 +71,6 @@
soapMessage.saveChanges();
MimeHeaders mimeHeaders = soapMessage.getMimeHeaders();
- System.out.println(mimeHeaders);
String[] ct = mimeHeaders.getHeader("Content-Type");
if (ct != null)
{
Show replies by date