Author: scheu
Date: Mon Nov 23 14:53:40 2009
New Revision: 883357

URL: http://svn.apache.org/viewvc?rev=883357&view=rev
Log:
WSCOMMNS-510
Contributor:Wendy Raschke
Change Axiom to conform with:
The WS-I Basic Profile 2.0 Specification, Rule R1109 states, "Parameters on the 
Content-Type MIME header field-value in a request MESSAGE MUST be a quoted 
string."
Also a verification unit test.

Modified:
    
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java
    
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMOutputFormatTest.java

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java?rev=883357&r1=883356&r2=883357&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/OMOutputFormat.java
 Mon Nov 23 14:53:40 2009
@@ -261,7 +261,7 @@
      * Content-Type value as defined by RFC 2387 and the XOP specification.  
The generated
      * header will look like the following:
      * 
-     *   Content-Type: multipart/related; boundary=[MIME BOUNDARY VALUE]; 
+     *   Content-Type: multipart/related; boundary="[MIME BOUNDARY VALUE]"; 
      *      type="application/xop+xml"; 
      *      start="[MESSAGE CONTENT ID]"; 
      *      start-info="[MESSAGE CONTENT TYPE]";
@@ -283,7 +283,13 @@
         sb.append("multipart/related");
         sb.append("; ");
         sb.append("boundary=");
+        // The value of the boundary parameter must be enclosed in double 
quotation  
+        // marks, according to the Basic Profile 2.0 Specification, Rule R1109:
+        // "Parameters on the Content-Type MIME header field-value in a 
request 
+        // MESSAGE MUST be a quoted string."
+        sb.append("\"");
         sb.append(getMimeBoundary());
+        sb.append("\"");
         sb.append("; ");
         sb.append("type=\"" + MTOMConstants.MTOM_TYPE + "\"");
         sb.append("; ");
@@ -298,7 +304,13 @@
         sb.append("multipart/related");
         sb.append("; ");
         sb.append("boundary=");
+        // The value of the boundary parameter must be enclosed in double 
quotation  
+        // marks, according to the Basic Profile 2.0 Specification, Rule R1109:
+        // "Parameters on the Content-Type MIME header field-value in a 
request 
+        // MESSAGE MUST be a quoted string."
+        sb.append("\"");
         sb.append(getMimeBoundary());
+        sb.append("\"");
         sb.append("; ");
         sb.append("type=\"").append(SOAPContentType).append("\"");
         sb.append("; ");

Modified: 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMOutputFormatTest.java
URL: 
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMOutputFormatTest.java?rev=883357&r1=883356&r2=883357&view=diff
==============================================================================
--- 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMOutputFormatTest.java
 (original)
+++ 
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMOutputFormatTest.java
 Mon Nov 23 14:53:40 2009
@@ -73,6 +73,12 @@
         // sub items in the future.
         
assertTrue(contentType.indexOf(SOAP11Constants.SOAP_11_CONTENT_TYPE)!=-1);
         assertTrue(contentType.indexOf(MTOMConstants.MTOM_TYPE)!=-1);
+        
+        // Test for a double quoted boundary value.
+        // The Basic Profile 2.0 Specification, Rule R1109 says,
+        // "Parameters on the Content-Type MIME header field-value 
+        // in a request MESSAGE MUST be a quoted string."
+        assertTrue(contentType.indexOf("boundary=\"")!=-1);
     }
     
     public void testGetContentTypeSOAP11SWA() {
@@ -102,7 +108,11 @@
         assertTrue(contentType.indexOf("multipart/related")>=0);
         assertTrue(contentType.indexOf(MTOMConstants.MTOM_TYPE) < 0);
         
-        
+        // Test for a double quoted boundary value.
+        // The Basic Profile 2.0 Specification, Rule R1109 says,
+        // "Parameters on the Content-Type MIME header field-value 
+        // in a request MESSAGE MUST be a quoted string."
+        assertTrue(contentType.indexOf("boundary=\"")!=-1);
     }
     
     public void testGetContentTypeSOAP12MTOM() {


Reply via email to