开发者

Send/Receive image or XML file via KSOAP

开发者 https://www.devze.com 2023-04-03 01:51 出处:网络
it may sounds stupid but i would like to know whether is it possible send and receive开发者_如何学JAVA. maybe image/XML file vai kSOAP?I have been able to transmit WebRowSet XML documents using kSOAP2

it may sounds stupid but i would like to know whether is it possible send and receive开发者_如何学JAVA. maybe image/XML file vai kSOAP?


I have been able to transmit WebRowSet XML documents using kSOAP2.

http://roderickbarnes.com/blog/droid-chronicles-web-services-handling-complex-parameters

In this example I am sending an XML document from the web service to my Android based client. I hope this helps bro.


It is possible to send image via ksoap by following steps:

  • convert the Image into byte[]
  • add byte[] of the image as property
  • register SoapSerializationEnvelope with MarshalBase64() like this : new MarshalBase64().register(envelope);
  • call your web service which takes byte[] as parameter

Then receiving the message you can convert the receieved byte[] into image file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号