获取Spring webservice错误无效请求[UnmarshallingFailureException]

获取Spring webservice错误无效请求[UnmarshallingFailureException],exception,jaxb,unmarshalling,spring-ws,Exception,Jaxb,Unmarshalling,Spring Ws,我试图调用SpringWeb服务,但遇到以下异常 org.springframework.ws.soap.client.SoapFaultClientException: Invalid request[UnmarshallingFailureException] 这是我的spring配置 <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSche

我试图调用SpringWeb服务,但遇到以下异常

org.springframework.ws.soap.client.SoapFaultClientException: Invalid request[UnmarshallingFailureException]
这是我的spring配置

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:oxm="http://www.springframework.org/schema/oxm"
xmlns:sws="http://www.springframework.org/schema/web-services"
xsi:schemaLocation="http://www.springframework.org/schema/beans
                    http://www.springframework.org/schema/beans/spring-beans-4.1.xsd
                    ...
                    http://www.springframework.org/schema/web-services
                    http://www.springframework.org/schema/web-services/web-services-2.0.xsd">

    <util:list id="packagesToScanList" list-class="java.util.ArrayList">
        <value>webservice.messages.lmsapi.serviceoperations</value>
        <value>webservice.messages.lmsapi.types.user</value>
        <value>webservice.messages.lmsapi.types.customer</value>
        <value>webservice.messages.lmsapi.types.enrollment</value>
        <value>webservice.messages.lmsapi.types.orggroup</value>
        <value>webservice.messages.lmsapi.types.securityroles</value>
        <value>webservice.messages.lmsapi.types.trainingplan</value>
        <value>webservice.messages.lmsapi.types.usergroup</value>
        <value>org.w3._2001.xmlschema</value>
    </util:list>

    <!-- Configure Spring Web Services -->
    <bean id="lmsApiWebServiceTemplate" class="org.springframework.ws.client.core.WebServiceTemplate"
        p:defaultUri="${lmsapi.uri}"
        p:marshaller-ref="lmsApiJaxbMarshaller"
        p:unmarshaller-ref="lmsApiJaxbMarshaller" />

    <bean id="lmsApiJaxbMarshaller" class="org.springframework.oxm.jaxb.Jaxb2Marshaller"
        p:packagesToScan-ref="packagesToScanList"/>
这意味着webservice正在调用

为什么我会出现这个解组错误?我有没有办法看到spring发送和接收的请求,以及我从哪里得到这个异常


谢谢

解组错误包含在SOAP错误中。因此,它发生在服务器端,而不是客户端。您应该检查服务器端日志,看看那里发生了什么


至于您关于日志记录的问题:将向您展示如何记录。

啊,谢谢。我做了日志记录,然后看到了我发送的SOAP请求。然后我将该请求与SOAPUI创建的请求进行匹配。然后我注意到,在创建用户密码时,我没有设置一个mandotory元素。这就是为什么我会出现解组错误。设置该变量后,一切正常。谢谢你的帮助,伙计;):)
public AddUserResponse createUser(AddUserRequest addUserRequest) {

    System.out.println();
    JAXBElement<AddUserResponse> response = (JAXBElement<AddUserResponse>)lmsApiWebServiceTemplate.marshalSendAndReceive(addUserRequest);
    AddUserResponse addUserResponse = (AddUserResponse)response.getValue();
    return addUserResponse;
}
[org.springframework.ws.client.MessageTracing.sent] - Sent request [SaajSoapMessage {http:/webservice/message/lmsapi/serviceoperations}AddUserRequest]
[org.springframework.ws.client.MessageTracing.received] - Received response     [SaajSoapMessage {http://schemas.xmlsoap.org/soap/envelope/}Fault] for request [SaajSoapMessage {http://webservice/message/lmsapi/serviceoperations}AddUserRequest]
[org.springframework.ws.client.core.WebServiceTemplate] - Received Fault message for request [SaajSoapMessage {http://webservice/message/lmsapi/serviceoperations}AddUserRequest]