Je tente de faire un appel de savon en utilisant ksoap2-android le serveur s'attend à une demande de savon pour ressembler à ceci ci-dessous.KSOAP2-Android SoapEnvelope Erreurs/Questions
<?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>
Mais après avoir ajouté des propriétés que je reçois la sortie suivante:
<?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>
La Source est assez foward droite. Après avoir fait l'appel que je reçois une erreur ci-dessous:
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)
Je ne sais pas temps que je reçois cette erreur en raison d'un problème de KSOAP. Je ne vois pas de réponse du service que j'appelle.
Ma pensée est que le service est expecing un préfixe « hilo » comme ils précisent ici:
et et où mon appel ressemble à:
De plus dans les propriétés qu'ils attendent:
et encore les attibutes sont différents
Est-ce que quelqu'un sait comment définir ces valeurs en utilisant KSOAP?
est Ci-dessous un petit bout de code:
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;
Merci à l'avance