Hello Dinesh, thanks for reply.

Iam using soapui (client) and axis2c server. I can save file to server
successfully.

Now I try to upload file from server. Client sends fileName to server:

<Load><fileName>/tmp/test.jpg</fileName><optimize>1</optimize></wsdl:Load>

on server I parse fileName, create response using data handler and sending
it to client (as in mtom client sample).

source code:

-------------------------------------------
axiom_data_handler_t *data_handler = NULL;
mtom_om_ele = axiom_element_create(env, NULL, "LoadResponse", NULL,
&mtom_om_node);
image_om_ele = axiom_element_create(env, mtom_om_node, "image", NULL,
&image_om_node);

data_handler = axiom_data_handler_create(env, image_name, "image/jpeg");
data_text = axiom_text_create_with_data_handler(env, image_om_node,
data_handler, &data_om_node);
AXIOM_TEXT_SET_OPTIMIZE(data_text, env, optimized);

AXIS2_MSG_CTX_SET_DOING_MTOM(msg_ctx,env,AXIS2_TRUE);

return mtom_om_node;
-----------------------------------------

client gets response :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
  <soapenv:Header/>
  <soapenv:Body>
     <LoadResponse>
        <image>
           <xop:Include href="cid:
[EMAIL PROTECTED]" xmlns:xop="
http://www.w3.org/2004/08/xop/include"/>
        </image>
     </iterity:LoadResponse>
  </soapenv:Body>
</soapenv:Envelope>


but no data follows.
The second Problem I have is defining the above response in wsdl. In
XMLSchema I cant define parameter differing from base type.

Here is my wsdl:

<xsd:schema elementFormDefault="unqualified"
       xmlns="http://www.w3.org/2001/XMLSchema";
       xmlns:apachesoap="http://xml.apache.org/xml-soap";
       xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/";
       xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/";
       xmlns:xsd="http://www.w3.org/2001/XMLSchema";
       xmlns:xmime="http://www.w3.org/2005/05/xmlmime";>

           <xsd:complexType name="TYPE_MTOM">
               <xsd:all>
                   <xsd:element name="fileName" type="xsd:string"/>
                   <xsd:element name="image" type="xmime:base64Binary"/>
               </xsd:all>
           </xsd:complexType>
           <xsd:complexType name="TYPE_MTOM_RESPONSE">
               <xsd:all>
                   <xsd:element name="SaveResponse" type="xsd:string"/>
               </xsd:all>
           </xsd:complexType>
           <xsd:complexType name="TYPE_LOAD">
               <xsd:all>
                   <xsd:element name="fileName" type="xsd:string"/>
                   <xsd:element name="optimize" type="xsd:boolean"/>
               </xsd:all>
           </xsd:complexType>
           <xsd:complexType name="TYPE_LOAD_RESPONSE">
               <xsd:all>
                   <xsd:element name="fileName" type="xsd:string"
minOccurs="0"/>
                   <xsd:element name="image" type="xmime:base64Binary"
minOccurs="0" />
                   <xsd:element name="EXCEPTION" type="impl:TYPE_EXCEPTION"
minOccurs="0"/>
               </xsd:all>
           </xsd:complexType>

           <xsd:element name="Save" type="impl:TYPE_MTOM"/>
           <xsd:element name="SaveResponse" type="xsd:string"/>
           <xsd:element name="Load" type="impl:TYPE_LOAD"/>
           <xsd:element name="LoadResponse"
type="impl:TYPE_LOAD_RESPONSE"/>
       </xsd:schema>

Thanks for your response.

Filip



2007/7/9, Dinesh Premalal <[EMAIL PROTECTED]>:

Hi Filip,
       Please find my comments inline.
"Filip Pekarek" <[EMAIL PROTECTED]> writes:

> Hello, I've problem uploading file from axis2C server using MTOM. I
create on
> server data Handler as in example of mtom client :
>
>     image_om_ele = axiom_element_create(env, mtom_om_node, "image",
NULL, &
> image_om_node);
>     data_handler = axiom_data_handler_create(env, image_name,
"image/jpeg");
>     data_text = axiom_text_create_with_data_handler(env, image_om_node,
> data_handler, &data_om_node);
>     AXIOM_TEXT_SET_OPTIMIZE(data_text, env, optimized);
Are you sure that request message went to server side? Please get
confirm using TCPMonitor tool.
>
> , then on server call
>
>     AXIS2_MSG_CTX_SET_DOING_MTOM(msg_ctx,env,AXIS2_TRUE) and then return
> created xml with <Include href=cid:....> tag.
How about your server side code. Did you wrote it as in mtom service?
>
> But no binary data folows the response xml from server. What do I wrong?
Do I
> have set message context or do more settings?
could you please send us axis2.log and mtom client log?

thanks,
Dinesh

--
Dinesh Premalal
http://xydinesh.wordpress.com/
GPG ID : A255955C
GPG Key Finger Print : C481 E5D4 C27E DC34 9257  0229 4F44 266E A255 955C

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Reply via email to