我正在尝试开发一个Java程序,它将简单地调用目标URL上的Web服务。从Java调用Web服务
请求方法是POST,(GET不支持)。
对于这个在我的程序中我使用的是java.net.*
库。我想在发布请求中发送一个xml文件。每当我运行客户端程序,它给了我以下错误:
java.io.IOException:server returned response code 500
然后当我在服务器日志中检查有以下异常:
org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet [spring] in context with path [/targetdirectory] threw exception [Request processing failed; nested exception is org.springframework.oxm.UnmarshallingFailureException: JAXB unmarshalling exception; nested exception is javax.xml.bind.UnmarshalException - with linked exception:.....
在我使用jaxb2marshaller服务器端,框架春天3.0 mvc。
所有其他的客户端,如在PHP中都能够使用php cURL调用相同的webservice。