Disable MTOM on SOAP WS response











up vote
0
down vote

favorite












I have a soap web service, developed in java, which returns a file inside a tag of the XML response. The tag is set to type="xsd:base64Binary". The same software is deployed to two different servers, one running a JBoss AS 7.1.1 and one running a JBoss EAP 7.0.0.



Inspecting the response (eg. with Soap UI), the AS returns a Base64 encode of the file, directly inside the tag:



<originalDocument>JVBERi0xLj...</originalDocument>


The EAP returns a binary file, with a reference inside the tag (MTOM):



--uuid:6ec7448a-58a6-4045-9faf-2b8469edf8b5
Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
Content-Transfer-Encoding: binary
Content-ID: <root.message@cxf.apache.org>
....
<originalDocument>
<xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:84d45c72-2b46-4d8c-9a4d-8bcc0c9206b5-13@cxf.apache.org"/>
</originalDocument>
....
--uuid:6ec7448a-58a6-4045-9faf-2b8469edf8b5
Content-Type: application/octet-stream
Content-Transfer-Encoding: binary
Content-ID: <84d45c72-2b46-4d8c-9a4d-8bcc0c9206b5-13@cxf.apache.org>
%PDF-1.4
...


Is this a configuration of the JBoss? Or maybe an Apache configuration? How can I force the AS to use Base64 encode?



Please note that I'm referring to the response of the endpoint, and not the request from client.
And please note also that the software is the same. I'd like to have a server configuration, not a software change.



Thank you.










share|improve this question


























    up vote
    0
    down vote

    favorite












    I have a soap web service, developed in java, which returns a file inside a tag of the XML response. The tag is set to type="xsd:base64Binary". The same software is deployed to two different servers, one running a JBoss AS 7.1.1 and one running a JBoss EAP 7.0.0.



    Inspecting the response (eg. with Soap UI), the AS returns a Base64 encode of the file, directly inside the tag:



    <originalDocument>JVBERi0xLj...</originalDocument>


    The EAP returns a binary file, with a reference inside the tag (MTOM):



    --uuid:6ec7448a-58a6-4045-9faf-2b8469edf8b5
    Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
    Content-Transfer-Encoding: binary
    Content-ID: <root.message@cxf.apache.org>
    ....
    <originalDocument>
    <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:84d45c72-2b46-4d8c-9a4d-8bcc0c9206b5-13@cxf.apache.org"/>
    </originalDocument>
    ....
    --uuid:6ec7448a-58a6-4045-9faf-2b8469edf8b5
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: binary
    Content-ID: <84d45c72-2b46-4d8c-9a4d-8bcc0c9206b5-13@cxf.apache.org>
    %PDF-1.4
    ...


    Is this a configuration of the JBoss? Or maybe an Apache configuration? How can I force the AS to use Base64 encode?



    Please note that I'm referring to the response of the endpoint, and not the request from client.
    And please note also that the software is the same. I'd like to have a server configuration, not a software change.



    Thank you.










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a soap web service, developed in java, which returns a file inside a tag of the XML response. The tag is set to type="xsd:base64Binary". The same software is deployed to two different servers, one running a JBoss AS 7.1.1 and one running a JBoss EAP 7.0.0.



      Inspecting the response (eg. with Soap UI), the AS returns a Base64 encode of the file, directly inside the tag:



      <originalDocument>JVBERi0xLj...</originalDocument>


      The EAP returns a binary file, with a reference inside the tag (MTOM):



      --uuid:6ec7448a-58a6-4045-9faf-2b8469edf8b5
      Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
      Content-Transfer-Encoding: binary
      Content-ID: <root.message@cxf.apache.org>
      ....
      <originalDocument>
      <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:84d45c72-2b46-4d8c-9a4d-8bcc0c9206b5-13@cxf.apache.org"/>
      </originalDocument>
      ....
      --uuid:6ec7448a-58a6-4045-9faf-2b8469edf8b5
      Content-Type: application/octet-stream
      Content-Transfer-Encoding: binary
      Content-ID: <84d45c72-2b46-4d8c-9a4d-8bcc0c9206b5-13@cxf.apache.org>
      %PDF-1.4
      ...


      Is this a configuration of the JBoss? Or maybe an Apache configuration? How can I force the AS to use Base64 encode?



      Please note that I'm referring to the response of the endpoint, and not the request from client.
      And please note also that the software is the same. I'd like to have a server configuration, not a software change.



      Thank you.










      share|improve this question













      I have a soap web service, developed in java, which returns a file inside a tag of the XML response. The tag is set to type="xsd:base64Binary". The same software is deployed to two different servers, one running a JBoss AS 7.1.1 and one running a JBoss EAP 7.0.0.



      Inspecting the response (eg. with Soap UI), the AS returns a Base64 encode of the file, directly inside the tag:



      <originalDocument>JVBERi0xLj...</originalDocument>


      The EAP returns a binary file, with a reference inside the tag (MTOM):



      --uuid:6ec7448a-58a6-4045-9faf-2b8469edf8b5
      Content-Type: application/xop+xml; charset=UTF-8; type="text/xml"
      Content-Transfer-Encoding: binary
      Content-ID: <root.message@cxf.apache.org>
      ....
      <originalDocument>
      <xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:84d45c72-2b46-4d8c-9a4d-8bcc0c9206b5-13@cxf.apache.org"/>
      </originalDocument>
      ....
      --uuid:6ec7448a-58a6-4045-9faf-2b8469edf8b5
      Content-Type: application/octet-stream
      Content-Transfer-Encoding: binary
      Content-ID: <84d45c72-2b46-4d8c-9a4d-8bcc0c9206b5-13@cxf.apache.org>
      %PDF-1.4
      ...


      Is this a configuration of the JBoss? Or maybe an Apache configuration? How can I force the AS to use Base64 encode?



      Please note that I'm referring to the response of the endpoint, and not the request from client.
      And please note also that the software is the same. I'd like to have a server configuration, not a software change.



      Thank you.







      soap jboss response mtom






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 at 16:44









      Sebastian Ikaros Rizzo

      14611




      14611
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          I found a solution that works for me. Annotation the corresponding fields in my response type with @XmlInlineBinaryData forces the response to be inline:



          public class MyResponseType {

          @XmlElement(required = true)
          protected String systemLink;

          protected Long fileSize;

          @XmlInlineBinaryData
          protected byte md5Hash;


          My response now looks like that:



          <ns3:MyResponse>
          <systemLink>system://40278824</systemLink>
          <fileSize>3537</fileSize>
          <md5Hash>oY6Mq54Zgo76VYtxHeVH6w==</md5Hash>
          ....





          share|improve this answer










          New contributor




          Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.

























            up vote
            0
            down vote



            accepted










            My solution was to remove xmime:expectedContentTypes="application/octet-stream" from the XSD node, and to remove the @MTOM annotation. This way the output is always base64. I still did not understand why on the old application server the output was base64, even with @MTOM annotation.






            share|improve this answer





















              Your Answer






              StackExchange.ifUsing("editor", function () {
              StackExchange.using("externalEditor", function () {
              StackExchange.using("snippets", function () {
              StackExchange.snippets.init();
              });
              });
              }, "code-snippets");

              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "1"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53435281%2fdisable-mtom-on-soap-ws-response%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote













              I found a solution that works for me. Annotation the corresponding fields in my response type with @XmlInlineBinaryData forces the response to be inline:



              public class MyResponseType {

              @XmlElement(required = true)
              protected String systemLink;

              protected Long fileSize;

              @XmlInlineBinaryData
              protected byte md5Hash;


              My response now looks like that:



              <ns3:MyResponse>
              <systemLink>system://40278824</systemLink>
              <fileSize>3537</fileSize>
              <md5Hash>oY6Mq54Zgo76VYtxHeVH6w==</md5Hash>
              ....





              share|improve this answer










              New contributor




              Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.






















                up vote
                1
                down vote













                I found a solution that works for me. Annotation the corresponding fields in my response type with @XmlInlineBinaryData forces the response to be inline:



                public class MyResponseType {

                @XmlElement(required = true)
                protected String systemLink;

                protected Long fileSize;

                @XmlInlineBinaryData
                protected byte md5Hash;


                My response now looks like that:



                <ns3:MyResponse>
                <systemLink>system://40278824</systemLink>
                <fileSize>3537</fileSize>
                <md5Hash>oY6Mq54Zgo76VYtxHeVH6w==</md5Hash>
                ....





                share|improve this answer










                New contributor




                Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.




















                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  I found a solution that works for me. Annotation the corresponding fields in my response type with @XmlInlineBinaryData forces the response to be inline:



                  public class MyResponseType {

                  @XmlElement(required = true)
                  protected String systemLink;

                  protected Long fileSize;

                  @XmlInlineBinaryData
                  protected byte md5Hash;


                  My response now looks like that:



                  <ns3:MyResponse>
                  <systemLink>system://40278824</systemLink>
                  <fileSize>3537</fileSize>
                  <md5Hash>oY6Mq54Zgo76VYtxHeVH6w==</md5Hash>
                  ....





                  share|improve this answer










                  New contributor




                  Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  I found a solution that works for me. Annotation the corresponding fields in my response type with @XmlInlineBinaryData forces the response to be inline:



                  public class MyResponseType {

                  @XmlElement(required = true)
                  protected String systemLink;

                  protected Long fileSize;

                  @XmlInlineBinaryData
                  protected byte md5Hash;


                  My response now looks like that:



                  <ns3:MyResponse>
                  <systemLink>system://40278824</systemLink>
                  <fileSize>3537</fileSize>
                  <md5Hash>oY6Mq54Zgo76VYtxHeVH6w==</md5Hash>
                  ....






                  share|improve this answer










                  New contributor




                  Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  share|improve this answer



                  share|improve this answer








                  edited 2 days ago









                  desertnaut

                  16k63465




                  16k63465






                  New contributor




                  Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.









                  answered Dec 10 at 7:54









                  Benjamin K.

                  113




                  113




                  New contributor




                  Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.





                  New contributor





                  Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.






                  Benjamin K. is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                  Check out our Code of Conduct.
























                      up vote
                      0
                      down vote



                      accepted










                      My solution was to remove xmime:expectedContentTypes="application/octet-stream" from the XSD node, and to remove the @MTOM annotation. This way the output is always base64. I still did not understand why on the old application server the output was base64, even with @MTOM annotation.






                      share|improve this answer

























                        up vote
                        0
                        down vote



                        accepted










                        My solution was to remove xmime:expectedContentTypes="application/octet-stream" from the XSD node, and to remove the @MTOM annotation. This way the output is always base64. I still did not understand why on the old application server the output was base64, even with @MTOM annotation.






                        share|improve this answer























                          up vote
                          0
                          down vote



                          accepted







                          up vote
                          0
                          down vote



                          accepted






                          My solution was to remove xmime:expectedContentTypes="application/octet-stream" from the XSD node, and to remove the @MTOM annotation. This way the output is always base64. I still did not understand why on the old application server the output was base64, even with @MTOM annotation.






                          share|improve this answer












                          My solution was to remove xmime:expectedContentTypes="application/octet-stream" from the XSD node, and to remove the @MTOM annotation. This way the output is always base64. I still did not understand why on the old application server the output was base64, even with @MTOM annotation.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered 21 hours ago









                          Sebastian Ikaros Rizzo

                          14611




                          14611






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Stack Overflow!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.





                              Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


                              Please pay close attention to the following guidance:


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53435281%2fdisable-mtom-on-soap-ws-response%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Trompette piccolo

                              How do I get these specific pathlines to nodes?

                              What visual should I use to simply compare current year value vs last year in Power BI desktop