问题描述
- android 调用wcf,byte[] Cannot serialize
-
public class UpLoadService implements ISoapService { private static final String NameSpace = "http://tempuri.org/"; private static final String URL = "http://www.xxx.com/PhotoUp.svc"; private static final String SOAP_ACTION = "http://tempuri.org/IPhotoUp/GetPic"; private static final String MethodName = "GetPic"; private byte[] updata; public UpLoadService(byte[] updata) { this.updata = updata; } public SoapObject LoadResult() { SoapObject soapObject = new SoapObject(NameSpace, MethodName); soapObject.addProperty("data", updata); SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); // 版本 envelope.bodyOut = soapObject; envelope.dotNet = true; envelope.setOutputSoapObject(soapObject); HttpTransportSE trans = new HttpTransportSE(URL); trans.debug = true; // 使用调试功能 try { trans.call(SOAP_ACTION, envelope); System.out.println("Call Successful!"); } catch (IOException e) { System.out.println("IOException"); e.printStackTrace(); } catch (XmlPullParserException e) { System.out.println("XmlPullParserException"); e.printStackTrace(); } SoapObject result = (SoapObject) envelope.bodyIn; return result; }
错误: java.lang.RuntimeException: Cannot serialize: [B@426abe90
我就是想把图片搞成byte[] 提交到wcf去,但是问题多多。 求留言解答
解决方案
跟android 没啥关系。费劲。。。问题都没确定
解决方案二:
Astyle Cannot convert to multi-byte string, reverting to English 问题解决办法-重新编译
Cannot serialize Object to ViewState only Session
解决Java“type mismatch cannot convert from byte[] to string”问题
时间: 2024-09-13 08:24:02