Webサービスの呼び出しにksoapライブラリを使用しています。以下は、webseriveを呼び出すための簡単な関数です。
try {
METHOD_NAME = method;
SOAP_ACTION = "http://tempuri.org/"+method;
URL = "http://172.27.212.2:8080/services/"+serviceName;
request = new SoapObject(NAMESPACE, METHOD_NAME);
soapEnvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
soapEnvelope.dotNet = true;
soapEnvelope.setOutputSoapObject(request);
androidHttpTransport = new HttpTransportSE(URL);
androidHttpTransport.call(SOAP_ACTION, soapEnvelope);
SoapPrimitive resultString = (SoapPrimitive) soapEnvelope.getResponse();
return resultString.toString();
} catch (Exception e) {
throw e;
}
Webサービスメソッドはjson文字列を返します。しかし、日食では、この文字列は切り捨てられます。
デバッグして切り捨てたresultStringは次のとおりです
。OutPut:
{"menu":{ "Arrival": [
{
"traveldeskdetailid": 1968,
"traveldeskid": 4,
"AirlineName": "United Airlines",
"AirlineLogo": "UA1.gif",
"FlightNumber": "1239",
"Codeshare": "",
"City": "Newark",
"AirportName": "Newark Liberty International Airport",
"Delayed": "T",
"ScheduledTime": "8:29 PM",
"Remarks": "126 minutes late",
"RemarksWithTime": "Estimated 10:35 PM",
"Terminal": "3",
"Gate": "85",
"path": "http://dem5xqcn61lj8.cloudfront.net/logos/UA1.gif"
},
{ .. },{ .. },
{
"traveldeskdetailid": 1983,
"traveldeskid": 4,
"AirlineName": "Air Canada",
"AirlineLogo": "AC.gif",
"FlightNumber": "564",
"Codeshare": "",
"City": "Vancouver",
"AirportName": "Vancouver International Airport",
"Delayed": "T",
"ScheduledTime": "10:45 PM",
"Remarks": "19 minutes late",
"RemarksWithTime": "Estimated 11:04 PM",
"Terminal": "I",
"Gate": "73",
"path": "http://dem5xqcn61lj8.cloudfront.net/logos/AC.gif"
},
{
"traveldeskdetaili...
応答文字列は次のように切り捨てられます
{"traveldeskdetaili..。
どうすれば完全な応答を得ることができますか?