5 Replies Latest reply on May 28, 2009 12:34 PM by marcelcasado

    Where can I find a swa (soap + attachments) contract first example

    marcelcasado

      Hi,

       

      We are implementing a service based on the WCS (Web coverage Service) specification. The specs require to use soap with attachments to return binary data. Is there a cxf example of contract first with "swa" that I can look into?

       

       

      Excerpt of the WCS specs :

      10.3.11.5  SOAP with Attachments response

      When the ―store parameter is absent or has the value ―false, responses to GetCoverage SOAP requests shall be encoded as SOAP with Attachments as defined in (but using SOAP 1.2 rather than SOAP 1.1). These responses shall consist of MIME multipart messages, as specified in 10.3.11.3, with the Coverages element contained within a SOAP 1.2 envelope, encoded as specified in Annex E.

       

      10.3.11.3 MIME multipart response

      GetCoverage responses transferred using MIME multipart shall be encoded according to , with the first part containing an XML encoded Coverages element. Every part of the multipart message shall have a content-id. The part containing the Coverages element shall have a content-id equal to ―urn:ogc:wcs:1.1:coverages; other parts may have any content-id values. The Coverages element shall reference other parts of the multipart message by their content-id values, prefixed by ―cid:.

      EXAMPLE 1 If a multipart message contains a part with ―content id:ottawa_temp.tiff, then the Coverage element would reference that part with the following XML fragment:

       

      NOTE Using prefixes other than ―cid:, the Coverages element can (but normally should not) reference resources external to the MIME multipart message.

       

      Based on this specs is this something I can achieve with MTOM instead of SWA on CXF ?

       

      Thanks,

       

      -Marcel

        • 1. Re: Where can I find a swa (soap + attachments) contract first example
          ubhole

          Hi Marcel

           

          We are implementing a service based on the WCS (Web coverage Service) specification. The specs require to use soap with attachments to return binary data. Is there a cxf example of contract first with "swa" that I can look into?

          you can take a look at the system test Here which shows how to use SwA.

           

          Excerpt of the WCS specs :

          10.3.11.5  SOAP with Attachments response

          When the ―store parameter is absent or has the value ―false, responses to GetCoverage SOAP requests shall be encoded as SOAP with Attachments as defined in W3C Note (but using SOAP 1.2 rather than SOAP 1.1). These responses shall consist of MIME multipart messages, as specified in 10.3.11.3, with the Coverages element contained within a SOAP 1.2 envelope, encoded as specified in Annex E.

           

          10.3.11.3 MIME multipart response

          GetCoverage responses transferred using MIME multipart shall be encoded according to IETF RFC 2387, with the first part containing an XML encoded Coverages element. Every part of the multipart message shall have a content-id. The part containing the Coverages element shall have a content-id equal to ―urn:ogc:wcs:1.1:coverages; other parts may have any content-id values. The Coverages element shall reference other parts of the multipart message by their content-id values, prefixed by ―cid:.

          EXAMPLE 1 If a multipart message contains a part with ―content id:ottawa_temp.tiff, then the Coverage element would reference that part with the following XML fragment:

          <Reference xlink:href="cid:ottawa_temp.tiff"/>

          NOTE Using prefixes other than ―cid:, the Coverages element can (but normally should not) reference resources external to the MIME multipart message.

           

           

           

           

           

           

           

           

           

          Based on this specs is this something I can achieve with MTOM instead of SWA on CXF ?

           

          As FUSE SF supports SwA you can use SwA. For using MTOM I don't know about the WCS spces so can't comment at this stage but looks like a possibility.

          /Ulhas

          • 2. Re: Where can I find a swa (soap + attachments) contract first example
            marcelcasado

            Thanks for the info Ulhas but is there an example with wsdl first so I can use wsdl2java to generate the rest ?

             

            Thanks,

             

            -Marcel

            • 3. Re: Where can I find a swa (soap + attachments) contract first example
              ubhole

              Hi Marcel,

              Link in my last reply is the system test that uses wsdl first approach and you can find the wsdl for the test here

               

              Ulhas

              • 4. Re: Where can I find a swa (soap + attachments) contract first example
                marcelcasado

                Hi Ulhas,

                 

                I found errors on the wsdl when open on IDE (Oxigen)  :

                 

                <soap:operation soapAction="" style="literal" />

                 

                should be :   <soap:operation soapAction="" style="document" />

                 

                And when I tried to run wsdl2java I got an error :

                 

                ./wsdl2java  -server -impl -all -ant -validate -d ~/testSWA/ ~/Documents/swa-mime-nomime.wsdl

                 

                WSDLToJava Error: WSI-BP-1.0 R2717 violation: soapBody in the input/output of the binding operation 'echoDataRef' MUST have namespace attribute

                 

                On jira I found : https://issues.apache.org/jira/browse/CXF-1146 but it says is closed but does not work for me

                 

                Thanks,

                 

                -Marcel

                • 5. Re: Where can I find a swa (soap + attachments) contract first example
                  marcelcasado

                  Running wsdl2java without -validate runs fine.

                   

                  -Marcel