2 Replies Latest reply on Mar 7, 2014 10:08 AM by Jorge Morales

    Why is "unwrapped" a first class citizen of SOAPBindingModel

    Jorge Morales Master

      Hi,

      I've been looking through the code, trying to understand how it works, and I see there is a special treatment for "unwrapped" messages. More precisely to not "unwrapped" messages.

       

      Can somebody explain the reason behind it?

       

      Regards,

        • 1. Re: Why is "unwrapped" a first class citizen of SOAPBindingModel
          Keith Babo Master

          When enabled, unwrap removes the enclosing operation name element used with doc-lit wrapped.  So if the SOAP:Body was this:

          <soap:Body>
                  <orders:submitOrder xmlns:orders="urn:switchyard-quickstart:bean-service:1.0">
                      <order>
                          <orderId>PO-19838-XYZ</orderId>
                          <itemId>BUTTER</itemId>
                          <quantity>200</quantity>
                      </order>
                  </orders:submitOrder>
          </soap:Body>
          

          This would be the content of the message with unwrap enabled:

          <order xmlns:orders="urn:switchyard-quickstart:bean-service:1.0">
                          <orderId>PO-19838-XYZ</orderId>
                          <itemId>BUTTER</itemId>
                          <quantity>200</quantity>
          </order>
          

           

          The motivation for this option is that transformations may not want to incorporate details from the binding (like adding a parent operation element) into the actual mapping logic to keep them protocol-independent.

          • 2. Re: Why is "unwrapped" a first class citizen of SOAPBindingModel
            Jorge Morales Master

            Holy sh..!!!

            It is good to know this hidden gems.

            I've been getting myself fooled, because I thought it had to do with wrapped/bare document style, and so I had hard times getting the transformations to work :-(

             

            Thanks for the answer.

             

            And now, regarding this, should a recommendation be to create bare style wsdls, and then select unwrapped in the binding side?

            Being reading this: http://www.coderanch.com/t/501314/Web-Services/java/Simple-Unwrapped-Wrapped-SOAP-messages