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:
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.
Thanks for the info Ulhas but is there an example with wsdl first so I can use wsdl2java to generate the rest ?
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
Running wsdl2java without -validate runs fine.