You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Rich Scheuerle (JIRA)" <ji...@apache.org> on 2007/09/13 23:16:32 UTC

[jira] Created: (WSCOMMONS-252) Expose a method on OMOutputFormat to allow the user to set a content type

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: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Resolved: (WSCOMMONS-252) Expose a method on OMOutputFormat to allow the user to set a content type

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-252?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved WSCOMMONS-252.
--------------------------------------

    Resolution: Fixed

Committed 575483


> 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: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org