Send/Receive image or XML file via KSOAP

帅比萌擦擦* 提交于 2020-01-03 04:20:09

问题


it may sounds stupid but i would like to know whether is it possible send and receive. maybe image/XML file vai kSOAP?


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/7337157/send-receive-image-or-xml-file-via-ksoap

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!