当客户端调用Web服务而不在SOAP Body中传递前缀时,我的Web服务无法处理客户端的请求,如下所示:
<soap:Body>
<GetPatientResultsRequest xmlns="http://urlA">
<PatientIdentification>
<PersonCivilRegistrationIdentifier xmlns="http://UrlB"/>
</PatientIdentification>
<Period>
<From>2012-05-26</From>
<To>2012-06-26</To>
</Period>
</GetPatientResultsRequest>
</soap:Body>
Run Code Online (Sandbox Code Playgroud)
错误是GetPatientResultsRequest与其他对应的Java对象为null.
似乎在Body中没有前缀时,反序列化没有正确发生.我的Web服务只有在SOAP Body有前缀时才能响应
<soap:Body>
<m:GetPatientResultsRequest xmlns:m="http://urlA">
<PatientIdentification>
<PersonCivilRegistrationIdentifier xmlns="http://UrlB"/>
</PatientIdentification>
<Period>
<From>2012-05-26</From>
<To>2012-06-26</To>
</Period>
</m:GetPatientResultsRequest>
</soap:Body>
Run Code Online (Sandbox Code Playgroud)
任何人都可以让我知道该怎么做,以便我的Web服务可以获取各种SOAP请求(即在Body中有和没有前缀)?
我正在使用JAX-WS(SOAP 1.1)