There is support for document/literal attachments. You can have multiple parts as long as there is only one part bound to the soap body. So attachments and headers can also be included. The jaxrpc-mapping.xml file doesnt have a way to indicate attachments, so the way this is determined is by the binding section in the wsdl file.
How about the mapping of the attachment to the parameters of the method on the SEI?
At the moment on the server side the only way I see to get access to the attachment is to use the SOAPMessage class and call the getAttachments method.
On the client side it apears that the only way to send the attachments is to use the 'org.jboss.ws.core.jaxrpc.StubExt' interface as described in JBWS-1384.
At the moment in the class JAXRPCMetaDataBuilder there is a comment: -
// we don't support swa binding parameters in document style
Is this something we will support? At the moment deployments created using wscompile can not be deployed because we do not process the mapping defined.
That's wrong. This has been supported before, it's supposed to work.
I reopened the issue.
That's good, my understanding matches yours - I thought we had full support for attachments and it was just tools that needed enhancing then I found that comment.
I will revert the patch that disabled this, and take a look and see if there are any bugs with doc/lit attachments, but the use case that that jira issue was testing was using an invalid WSDL file, so this may have been the real problem.
I think the original WSDL at the top of the user post is correct, the basic profile only specifies that the part must reference elements if the part is referenced from a soapbind:body element, it doesn't specify a requirement for mime:content parts.
R2204 A document-literal binding in a DESCRIPTION MUST refer, in each of its soapbind:body element(s), only to wsdl:part element(s) that have been defined using the element attribute.
The attachments profile also contains the following parts defined in a document/literal example: -
<wsdl:message name="ClaimIn"> <wsdl:part name="body" element="types:ClaimDetail"/> <wsdl:part name="ClaimPhoto" type="xsd:base64Binary"/> </wsdl:message>
Yes, you are right R2910 in AP 1.0 explicitly allows both. I was mixing swa ref requirements. Anyway I will make sure this is handled correctly.
I just fixed support for this in trunk. See the JBWS-1384 test case.
I am just trying to deploy another example I was looking at based on the original test for JBWS-1384. My WSDL defines the attachment but it is not mapped to any parameters on the SEI - The endpoint accesses the attachment through the SOAPMessage class.
However deployment now fails with the following error: -
20:07:03,480 ERROR [ServiceEndpointDeployer] Cannot create service endpoint
org.jboss.ws.WSException: Cannot obtain method parameter mapping for message part 'mimepart' in wsdl operation: publishPhoto
Does this now mean that all attachments need to be mapped or should we be allowing them to be unmapped so if no mapping is found the attachment can just be retrieved using the SOAPMessage class? I can take a look if it is the latter, I am just really trying to build up a picture of all the ways attachments can be mapped so I can this into account in wstools.
Related to my last post should we be able to support complex types that contain elements of type swaRef?
Taking the following extract from my WSDL: -
<schema targetNamespace='http://www.jboss.org/support/photoalbum/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://www.jboss.org/support/photoalbum/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <complexType name='Photo'> <sequence> <element name='caption' nillable='true' type='string'/> <element name='image' nillable='true' type='string'/> </sequence> </complexType> <element name='publishPhoto' type='tns:Photo'/> <element name='publishPhotoResponse' type='int'/> </schema> </types> <message name='AlbumEndpoint_publishPhoto'> <part element='ns1:publishPhoto' name='publishPhoto'/> <part name='mimepart' type='xsd:hexBinary'/> </message>
If swaRef is supported I would have though that mapping the attachment to a parameter on the SEI should be mandatory as in this case the swaRef can reference the attachment instead.
Forget that, that is the wrong WSDL extract.
Here is the correct extract: -
<schema targetNamespace='http://www.jboss.org/support/photoalbum/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:tns='http://www.jboss.org/support/photoalbum/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:ref='http://ws-i.org/profiles/basic/1.1/xsd'> <complexType name='Photo'> <sequence> <element name='caption' nillable='true' type='string'/> <element name='image' type='ref:swaRef'/> </sequence> </complexType> <element name='publishPhoto' type='tns:Photo'/> <element name='publishPhotoResponse' type='int'/> </schema> </types> <message name='AlbumEndpoint_publishPhoto'> <part element='ns1:publishPhoto' name='publishPhoto'/> <part name='mimepart' type='xsd:hexBinary'/> </message>