我试图在 Ksoap 中使用 HttpsTransportSE,但我收到 URISyntaxException,说我有一个格式错误的 IPV6 地址 - 我想这是有道理的,因为我正在传递一个 URL...但我该如何修复它?
我找到了一个类似的查询 here但这涉及到 Http 而不是 Https 类,我没有描述的重载方法。
我是 SOAP 的新手,但到目前为止我的代码是这样的:
String SOAP_ACTION = "http://url.to.thingy";
String METHOD_NAME = "methodNameFromAsmx";
String NAMESPACE = "http://the.namespace";
String URL = ServerName;
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("Address", UserName);
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet=true;
envelope.setOutputSoapObject(request);
HttpsTransportSE androidHttpTransport = new HttpsTransportSE(URL, 443, "/relative/pathToAsmx", 5000);
androidHttpTransport.call(SOAP_ACTION, envelope);
我现在已经用 fudge 替换了各种属性,因为我希望它不相关。我的错误显示格式错误的 IPV6 为:https:%2F%2Fmy.url.com
最佳答案
使用这种格式,
private static final String NAMESPACE = "http://tempuri.org/";
private static final String URL = "192.168.30.8";
private static final String SERVICE = "/Wcf.WCF_.svc?wsdl";
private static String SOAP_ACTION = "http://tempuri.org/iWCF/";
关于android - KSoap 和 HttpsTransportSE 返回 URISyntaxException(格式错误的 IPV6 地址)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9077003/