0
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Body>
        <s:Fault>
            <faultcode xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">
                a:DeserializationFailed
            </faultcode>
            <faultstring xml:lang="en-US">
                The formatter threw an exception while trying to deserialize the 
                message: There was an error while trying to deserialize parameter
                http://URI/v1:Input. The InnerException message was \'\'EndElement\' 
                \'Input\' from namespace \'http://URI/v1\' is 
                not expected. Expecting element \'Username\'.\'.  Please see 
                InnerException for more details.
            </faultstring>
        </s:Fault>
    </s:Body>
</s:Envelope>

那是我收到的错误,这是我发送的请求:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xmlns:tns="uri" xmlns:wsu="http://docs.oasisopen.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract">
    <soap:Header></soap:Header>
    <soap:Body>
        <tns:LogIn xmlns:tns="uri" xmlns="uri">
            <tns:Input>
                <tns:Username>user</tns:Username>
                <tns:Password>pass</tns:Password>
            </tns:Input>
        </tns:LogIn>
    </soap:Body>
</soap:Envelope>

请注意,两种情况下的“uri”都是出于隐私目的而插入的(真正的 uri 存在于请求/响应中)。我对 SOAP 了解不多——如果有人能指出我的请求是否存在明显错误的正确方向吗?

4

0 回答 0