axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hawkins <>
Subject Re: Question about Soap Message with Attachment
Date Tue, 18 Oct 2005 16:46:23 GMT
Response from Mark Whitlock cc'd ->

Hi Yuan,
There are at least 2 possible ways of describing attachments in the WSDL. 
Attachments can be described using the WSDL MIME extensions (like 
mime:multipartRelated) or using elements under the namespace. WS-I allows either. Axis C++ 
currently only supports elements under the 
namespace. The Attachment1.wsdl should be correct. 

I don't know why you are having the "DataHandler not defined" problem. The 
Attachment1.wsdl has the line 
<import namespace=""/>
which should pull in the DataHandler definition. What level of code are 
you running? Does the problem happen on the latest level?

In the client, request attachments are supported, but response attachments 
are not. I added in the attachment support in the client, and I would have 
liked to support response attachments, WSDL MIME extensions, etc, but 
unfortunately I did not have sufficient time.

I am not able to spend much time on Axis C++, so I may not respond 
immediately to any further questions.
Mark Whitlock

"yuan" <> 
18/10/2005 01:34
Please respond to
"Apache AXIS C User List"


Question about Soap Message with Attachment


I have been looking at how to write a WSDL file to use Soap Message with
Attachment. I have found examples on the web using 
example below:

<message name="Request">
                                 <part name="photo" type="xsd:hexBinary"/> 
<message name="Response">
                                 <part name="status" type="xsd:string"/> 

<wsdl:operation name="addPhoto">
            <soap:body use="literal"/>
            <mime:content part="photo" type="image/jpeg"/>

            <soap:body use="literal"/>
            <mime:content part="status" type="text/plain"/>

NOTE: I am not sure this is how you describe parts relate to mime 
types, But without this, there will be NULLPointerException in 
<message name="Request">
                                 <part name="photo" type="xsd:hexBinary"/> 

This seems to describe the structure of the soap message correctly with
respect to the documentation on W3C. SoapAttachment* files uses similar
structure as well. 
I tried using this with WSDL2WS, but the generated skeleton and stub don't
use Attachments at all. It will just have a function (in this case
addPhoto), it just treats it as having input xsd:hexBinary and output
xsd:string, no attachment functions used.

I have also found the file under tests directory in the repository:

testcases/wsdls/Attachment1.wsdl which also uses attachments. When I try 
run WSDL2WS on it, it returns the following error: "Type
{}DataHandler is referenced but not 
(basically for all types using namespace). 

I am not sure how this works but is there suppose to be a schema defined 
the DataHandler or any other attachment type? Am I supposes to define it

Also does WSDL2WS handle multiple Attachments as output?

Can anyone point me in the right direction? Any help is greatly 

Thanks in Advance.


Yuan Liu

View raw message