使用KSOAP2在android中将Jagged Array作为参数发送到WCF服务

时间:2013-06-02 17:48:43

标签: ksoap2 android-ksoap2

我遇到了将锯齿状阵列发送到wcf webservice的问题。该方法期望studentId和jaggedArray与学生相关的信息。这是c#

中的方法签名
String[][] SearchStudent(string studentId, String[][] additionalInformation);

根据KSOAP维基页面,下面的代码应该有效。我也用Hashtable试过了;它返回了相同的错误消息。

SoapObject additionalInformation = new SoapObject(NAMESPACE, "SearchStudent");
    additionalInformation.addProperty("StudentFirstName", "John");
    additionalInformation.addProperty("StudentLastName", "Doe
    additionalInformation.addProperty("StudentDOB", "06101990");
    SoapObject request = new SoapObject(NAMESPACE, "Authenticate");
    request.addProperty("sessionId", params[0]);
    request.addProperty("additionalInformation ", AuthParams);


SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.bodyOut = request;
envelope.setOutputSoapObject(request);
HttpTransportSE androidHttpTransport = new HttpTransportSE(url);
androidHttpTransport.debug = true;
(new MarshalHashtable()).register(envelope);
androidHttpTransport.call(SOAP_ACTION + "SearchStudent", envelope);
SoapObject sResult = (SoapObject)envelope.getResponse();

我收到消息Invalid argument错误消息。 我在这里做错了什么?

1 个答案:

答案 0 :(得分:0)

我能够使用envelope.version 10而不是11.这是link到我的其他帖子,你可以找到解决方案。