OS WebService的Soap请求无法获取参数的解决方法

本文只针对本人自己碰到的WebService服务器

之前参照网上广泛使用的soap头,在连接以CXF搭建的WebService碰到无法解析参数的情况

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<getOffesetUTCTime(方法名) xmlns="http://www.Nanonull.com/TimeService/(命名空间)”>
<hoursOffset(参数名)>GTM+8</hoursOffset>
</getOffesetUTCTime>
</soap:Body>
</soap:Envelope>


修改为如下的soap请求头就正常获取

<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="webservice命名空间">
    <soap:Body>
        <ns1:方法名>
            <参数名1>参数值1</参数名1>
            <参数名2>参数值2</参数名2>
        </ns1:方法名>
    </soap:Body>
</soap:Envelope>


你可能感兴趣的:(OS WebService的Soap请求无法获取参数的解决方法)