我正在试图使用ksoap2-android进行肥皂调用服务器期望看起来像下面这样的肥皂请求。KSOAP2-Android SoapEnvelope错误/问题
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<hilo:getHLPredAndMetadata xmlns:hilo="http://opendap.co-ops.nos.noaa.gov/axis/webservices/highlowtidepred/wsdl">
<stationId xmlns="">8454000</stationId>
<beginDate xmlns="">20060920 00:00</beginDate>
<endDate xmlns="">20060922 23:59</endDate>
<datum xmlns="">0</datum>
<unit xmlns="">0</unit>
<timeZone xmlns="">0</timeZone>
</hilo:getHLPredAndMetadata>
</soapenv:Body>
</soapenv:Envelope>
但是,增加的属性,我得到以下输出后:
<?xml version="1.0" encoding="UTF-8" ?>
<v:Envelope xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:d="http://www.w3.org/2001/XMLSchema" xmlns:c="http://schemas.xmlsoap.org/soap/encoding/" xmlns:v="http://schemas.xmlsoap.org/soap/envelope/">
<v:Header />
<v:Body>
<n0:getHLPredAndMetadata id="o0" c:root="1" xmlns:n0="http://opendap.co-ops.nos.noaa.gov/axis/webservices/highlowtidepred/wsdl">
<stationId i:type="d:string">8722669</stationId>
<beginDate i:type="d:string">20101101 00:00</beginDate>
<endDate i:type="d:string">20101101 23:00</endDate>
<datum i:type="d:int">0</datum>
<unit i:type="d:int">0</unit>
<timeZone i:type="d:int">0</timeZone>
</n0:getHLPredAndMetadata>
</v:Body>
</v:Envelope>
来源是相当平直盼着。打出电话后,我得到以下错误:
11-02 03:01:01.151: ERROR/NoaaTideSoap(389): unexpected type (position:END_DOCUMENT [email protected]:0 in [email protected])
11-02 03:01:01.151: ERROR/NoaaTideSoap(389): org.xmlpull.v1.XmlPullParserException: unexpected type (position:END_DOCUMENT [email protected]:0 in [email protected])
11-02 03:01:01.151: ERROR/NoaaTideSoap(389): at org.kxml2.io.KXmlParser.exception(KXmlParser.java:245)
11-02 03:01:01.151: ERROR/NoaaTideSoap(389): at org.kxml2.io.KXmlParser.nextTag(KXmlParser.java:1365)
11-02 03:01:01.151: ERROR/NoaaTideSoap(389): at org.ksoap2.SoapEnvelope.parse(SoapEnvelope.java:126)
11-02 03:01:01.151: ERROR/NoaaTideSoap(389): at org.ksoap2.transport.Transport.parseResponse(Transport.java:63)
11-02 03:01:01.151: ERROR/NoaaTideSoap(389): at org.ksoap2.transport.HttpTransportSE.call(HttpTransportSE.java:100)
我不知道天气我得到,因为KSOAP问题的这个错误。我看不到从我打来的服务回来的回复。
我的想法是,该服务expecing前缀“希洛”像他们指定的位置:
,并和那里我的电话是这样的:
此外,在性能,他们预计:
,并再次attibutes不同
有谁知道如何使用KSOAP设置这些值?
下面是一个代码剪断:
SoapObject request = new SoapObject(NAMESPACE, METHOD_NAME);
request.addProperty("stationId","8722669");
request.addProperty("beginDate","20101101 00:00");
request.addProperty("endDate","20101101 23:00");
request.addProperty("datum",0);
request.addProperty("unit",0);
request.addProperty("timeZone",0);
SoapSerializationEnvelope soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
//soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(request);
AndroidHttpTransport aht = new AndroidHttpTransport(URL);
aht.setXmlVersionTag("<?xml version=\"1.0\" encoding= \"UTF-8\" ?>");
aht.debug = true;
在此先感谢