Hi Thilina, Thank you very much for reply. >> > When we look at the WSDL generated from the source code, the data type >> of >method1Response is anyType. >> That's correct.. Axis2 couldn't figure out the actual schema when the >> parameters are OMElements. An OMElement can contain any arbitrary >> piece of XML. When using OMElements, it is advised to hand craft a >> WSDL for the service.. See here[1] for more info.
It is unlikely that our customer change the generated WSDL manually when the web service returns a complex data structure and attachmetns using AXIOM. The only possible way I can think about is the second way I mentioned in my previous email, see follows: public class Service1 { .... public Method1Response method1(....) { .... Method1Response res = new Method1Response(...); ..... return res; } ... } public class Method1Response { int var_i; double var_d; DATATYPE attachment1; .... } If the DATATYPE for the variable attachment1 in the class Method1Response is OMElement, it seems the binary data is sending by value, not by reference when I traced the SOAP message using TCPMonitor. <ns:echoResponse xmlns:ns="http://ws.apache.org/axis2/xsd"> <ns:return> <amount xmlns="http://ws.apache.org/axis2/xsd">20</amount> <attachment> dGhpcyBpcyB0ZXN0IHR4dGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRkZGRmYXNmYXNkZmFzZGZhc2ZkYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZhc2RmYXNkZmFzZGZh </attachment> <name xmlns="http://ws.apache.org/axis2/xsd">yang</name> </ns:return></ns:echoResponse> And it also seems that large portion of the attachment data was discarded as the size of the file is about 3M. May I know How I can set the data type of attachment variable in this approach? or there is any other alternative way to return complex data structure and attachment? Many thanks in advance. best regards yong --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]