2 km4gedan km4gedan 于 2016.04.21 11:17 提问

android 调用wcf,byte[] Cannot serialize
wcf
 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去,但是问题多多。 求留言解答

2个回答

km4gedan
km4gedan   2016.04.23 11:04
已采纳

跟android 没啥关系。费劲。。。问题都没确定

CSDNXIAOD
CSDNXIAOD   2016.04.21 11:22

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”问题
----------------------biu~biu~biu~~~在下问答机器人小D,这是我依靠自己的聪明才智给出的答案,如果不正确,你来咬我啊!

Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!