Hello,

I`m not sure, but what if just use SerializableEntity(
http://developer.android.com/reference/org/apache/http/entity/SerializableEntity.html
) instead of StringEntity?
Create a serializable wrapper class for your request parameters,
implement

 private void writeObject(java.io.ObjectOutputStream out) throws
IOException

private void readObject(java.io.ObjectInputStream in) throws
IOException, ClassNotFoundException

in "writeObject" write in out first your binary request, than append
an xml string.


On Jan 14, 3:14 pm, Daniel <[email protected]> wrote:
> hi,
>
> How can I handle the request/reponse combined with binary and text/xml
> data in the message boday?
>
> I need send a HTTP POST request, the message body is:
> [20 bytes binary header][ UTF 8 XML's text string ]
>
> And response's body is
> [18 bytes binary header][ UTF 8 XML's text string ]
>
> I found some example in the forum, for example:
> ===========================================
> DefaultHttpClient httpClient = new DefaultHttpClient();
> HttpPost req = new HttpPost("http://111.111.11.11/post";);
> String xmlString = "<req>.... </req>";
>
> StringEntity stringEntity = new StringEntity(xmlString);
> req.setEntity(stringEntity);
>
> HttpResponse rsp = httpClient.execute(req);
> ===========================================
> this can send request with XML string body,
> but how to add binary before XML string? use which Entity?
>
> Thanks
-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to