小编use*_*629的帖子

SOAPFaultException.getFault().getDetail()为null

我使用JAX WS 2.0调用SOAP Web服务.如果出现错误,我收到以下回复:

<?xml version="1.0"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://www.w3.org/2003/05/soap-   envelope">
    <soap:Header/>
    <soap:Body>
        <soap:Fault  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://www.w3.org/2003/05/soap- envelope" xmlns:xml="http://www.w3.org/XML/1998/namespace">
            <soap:Code>  
                <soap:Value>soap:Receiver</soap:Value>
            </soap:Code>
            <soap:Reason>
                <soap:Text  xml:lang="en">Exception of type 'blah blah' was thrown.
                </soap:Text>
            </soap:Reason>
            <soap:Node>{SOME URL}</soap:Node>
            <detail>
                <error>345</error>
                <message>Cannot find user. Blah  blah</message>
            </detail>
        </soap:Fault>
    </soap:Body>
</soap:Envelope>
Run Code Online (Sandbox Code Playgroud)

您可以在详细信息节点中看到有用的错误:

<soap:Envelope>  
    <soap:Body>  
        <soap:Fault>  
            <detail>
Run Code Online (Sandbox Code Playgroud)

在我的客户端,我得到一个SOAPFaultException,它有一个SOAPFault对象.SOAPFault对象似乎缺少我上面发布的节点.SOAPFaultException.getFault().getDetail()为null.但是,它包含所有其他节点,包括soap:Reason.知道为什么它缺少细节节点吗?

谢谢.

java soap jax-ws soapfault

5
推荐指数
1
解决办法
3908
查看次数

标签 统计

java ×1

jax-ws ×1

soap ×1

soapfault ×1