Expose a method on OMOutputFormat to allow the user to set a content type
-------------------------------------------------------------------------

                 Key: WSCOMMONS-252
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-252
             Project: WS-Commons
          Issue Type: Bug
          Components: AXIOM
            Reporter: Rich Scheuerle
            Assignee: Rich Scheuerle
            Priority: Minor


This is a trivial change suggested by Nick Gallardo to support a setContentType 
on OMOutputFormat.

I will commit the change after I complete testing.

 
     private String charSetEncoding;
     private String xmlVersion;
+    private String contentType;
     private boolean ignoreXMLDeclaration = false;
     private boolean autoCloseWriter = false;
 ..
 
     public String getContentType() {
-        String soapContentType;
-        if (isSoap11) {
-            soapContentType = SOAP11Constants.SOAP_11_CONTENT_TYPE;
-        } else {
-            soapContentType = SOAP12Constants.SOAP_12_CONTENT_TYPE;
+        if (contentType == null) {
+            if (isSoap11) {
+                contentType = SOAP11Constants.SOAP_11_CONTENT_TYPE;
+            } else {
+                contentType = SOAP12Constants.SOAP_12_CONTENT_TYPE;
+            }
         }
+        
         // MTOM is given priority
         if (isOptimized()) {
-            return this.getContentTypeForMTOM(soapContentType);
+            return this.getContentTypeForMTOM(contentType);
         } else if (isDoingSWA()) {
-            return this.getContentTypeForSwA(soapContentType);
+            return this.getContentTypeForSwA(contentType);
         } else {
-            return soapContentType;
+            return contentType;
         }
     }
+    
+    public void setContentType(String c) {
+        contentType = c;
+    }
 
     public String getMimeBoundary() {
         if (mimeBoundary == null) {



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to