axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Hawkins <HAWKI...@uk.ibm.com>
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 
http://xml.apache.org/xml-soap namespace. WS-I allows either. Axis C++ 
currently only supports elements under the http://xml.apache.org/xml-soap 
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="http://xml.apache.org/xml-soap"/>
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
Mark Whitlock




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


To
<axis-c-user@ws.apache.org>
cc

Subject
Question about Soap Message with Attachment






Hi,

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 
<mime:multipartRelated>,
example below:

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

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

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

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

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:
http://svn.apache.org/repos/test/webservices/axis1/trunk/c/tests/auto_build/

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

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

Also does WSDL2WS handle multiple Attachments as output?

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

Thanks in Advance.

Regards,
Yuan

--
Yuan Liu
Yuan.liu@formtrap.com




Mime
View raw message