次のように私のSOAP要求とSOAP応答は次のとおりです。AndroidアプリケーションにSOAPリクエストからJSONファイルに応答を解析する方法
Test
To test the operation using the HTTP POST protocol, click the 'Invoke' button.
Parameter Value
accessCode: xxxxxx
Invoke
SOAP 1.1
次は、サンプルのSOAP 1.1の要求および応答です。表示されるプレースホルダは実際の値に置き換える必要があります。
POST /UI/WebServices/CalManager.asmx HTTP/1.1
Host: login.nediso.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://nediso.com/add/login"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<add_x002F_login xmlns="http://nediso.com/">
<accessCode>string</accessCode>
</add_x002F_login>
</soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<add_x002F_loginResponse xmlns="http://nediso.com/">
<add_x002F_loginResult>string</add_x002F_loginResult>
</add_x002F_loginResponse>
</soap:Body>
</soap:Envelope>
ここで私は、例えば、accesscodeと上記のSOAPリクエストの形式で指定され、それは聞かせてxxxxx
をSOAPリクエストを送信しています。以下では、レスポンスを文字列として取得しています。私がアクセスコードを入力してSOAPリクエストのすぐ上のInvokeボタンをクリックするときは、私は.Json
というファイルをレスポンスとして受け取ります。ここでの問題は、レスポンスとしてStringを取得するのか、.Json
をレスポンスとして取得するのかです。それは.Json
ファイルの場合、それを処理し、解析する方法ですか?
その簡単にあなたは間違ってやっていることを伝えるためにあなたはいくつかのコードを含める必要があります。 – Femi