在我的问题ClassCastException (Vector > SoapPrimative)之后,有人可以提供如何使用以下WebService响应的示例吗,我一直在使用以下代码(来自Internet上的许多示例),但无法获取除了最简单的响应(例如w3schools Temperature Convert)之外,还可以使用其他任何方法
SoapSerializationEnvelope envelope = new SoapSerializationEnvelope(SoapEnvelope.VER11);
envelope.dotNet = true;
envelope.implicitTypes = true;
envelope.setOutputSoapObject(request);
HttpTransportSE httpTransportSE = new HttpTransportSE(URL);
httpTransportSE.call(NAMESPACE + methodName, envelope);
SoapPrimitive soapPrimitive = (SoapPrimitive) envelope.getResponse();
我的回复的简化版本:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<TestResponse xmlns="http://tempuri.org/">
<TestResult>
<CodeCheck>1234</CodeCheck>
<AccountBalance>101.25</AccountBalance>
<Company>BBC</Company>
<Books>
<Book>
<Title>Book Title 1</Title>
<Author>Mr A Smith</Author>
</Book>
<Book>
<Title>Book Title 2</Title>
<Author>Mr B Jones</Author>
</Book>
</Books>
</TestResult>
</TestResponse>
</soap:Body>
</soap:Envelope>