如何在JAX-WS中更改响应xml

时间:2023-01-31 20:14:43

I have the following XML as my JAX-WS web service response:

我有以下XML作为我的JAX-WS Web服务响应:

<soapenv:Envelope>
    <soapenv:Header/>
    <soapenv:Body>
        <QueryRBTReqMsgResponse>
            <QueryRBTRspMsg>
                <resultHeader>
                    <resultCode>0</resultCode>
                    <resultDesc>Successful</resultDesc>
                </resultHeader>
                <!--Optional:-->
                <QueryRBTResponse>
                    <part>1</part>
                </QueryRBTResponse>
            </QueryRBTRspMsg>
        </QueryRBTReqMsgResponse>
    </soapenv:Body>
</soapenv:Envelope>

But this is what I want:

但这就是我想要的:

<soapenv:Envelope>
    <soapenv:Header/>
    <soapenv:Body>
        <QueryRBTRspMsg>
            <resultHeader>
                <resultCode>0</resultCode>
                <resultDesc>Successful</resultDesc>
            </resultHeader>
            <!--Optional:-->
            <QueryRBTResponse>
                <part>1</part>
            </QueryRBTResponse>
        </QueryRBTRspMsg>
    </soapenv:Body>
</soapenv:Envelope>

How can I remove the <QueryRBTReqMsgResponse> tag from my response? I tried too many changes but none of them did the job!!!

如何从响应中删除 标记?我尝试了太多的改变,但他们都没有完成这项工作!

1 个解决方案

#1


3  

Finally I found the solution. We have to use following annotation:

最后我找到了解决方案。我们必须使用以下注释:

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)

#1


3  

Finally I found the solution. We have to use following annotation:

最后我找到了解决方案。我们必须使用以下注释:

@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)