• Android WebService Does not support output


    问题:

    java.net.ProtocolException: Does not support output
    at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:1200)
    at com.ls.mobile.address.service.WebService.getMobileAddress(WebService.java:28)
    at com.ls.mobile.address.TestMobileAddress.testAddress(TestMobileAddress.java:14)
    at java.lang.reflect.Method.invokeNative(Native Method)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:169)
    at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:154)
    at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:520)
    at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1447)

    解决办法

    httpConn.setDoOutput(true);

     HttpURLConnection的签名setDoOutput(boolean);

  • 相关阅读:
    团队项目成员和题目
    最大联通子数组
    站立会议5
    关于jsp之间href传参(中文)乱码问题
    站立会议4
    典型用户和用户场景描述
    站立会议3
    站立会议2
    站立会议1
    第七周学习进度情况
  • 原文地址:https://www.cnblogs.com/liuhouhou/p/Android.html
Copyright © 2020-2023  润新知