Can't connect to WCF service on Android

前端 未结 2 1936
广开言路
广开言路 2020-12-29 16:49

I am trying to connect to a .NET WCF service in Android using kSOAP2 (v 2.1.2), but I keep getting a fatal exception whenever I try to make the service call. I\'m having a b

相关标签:
2条回答
  • 2020-12-29 16:56

    Got this working. There were some issues as mentioned above with the Manifest file. On top of that the NAMESPACE, SOAP_ACTION, and URL parameters were incorrect. The NAMESPACE required "uri:" to be pre-pended to it, as did SOAP_ACTION. The URL needed to have an endpoint specified so instead of http://192.168.1.2:8002/WebService.Mobile.svc it needed to be http://192.168.1.2:8002/WebService.Mobile.svc/Mobile. Connection issues resolved, just need to figure out the data transport thing now.

    0 讨论(0)
  • 2020-12-29 17:06

    Had the same issue and found this: http://code.google.com/p/ksoap2-android/issues/detail?id=35

    See Comments 15 and 17.

    They suggest that you wrap the call to "androidHttpTransport.call(SOAP_ACTION, envelope);" in try/catch and try again in case of an error.

    OR

    Set the system property "http.keepAlive" to "false".

    Later on in that issue someone suggests usage of "KeepAliveHttsTransport".

    For me, the (I admit it's dirty) try/catch worked just fine.

    EDIT typo

    0 讨论(0)
提交回复
热议问题