我正在尝试在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);
我现在用软糖替换了各种属性,因为我希望它不相关。我的错误显示格式错误的IPV6为:https:%2F%2Fmy.url.com
答案 0 :(得分:0)
使用此格式
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/";