我正在使用 apache axis2 开发 Web 服务,并且我已经生成了所需的客户端代码。客户端请求应如下所示:
`<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:v2="http://www.huawei.com.cn/schema/common/v2_1"
xmlns:loc="http://www.csapi.org/schema/parlayx/sms/notification_manager/v2_3/local">
<soapenv:Header>
<RequestSOAPHeader xmlns="http://www.huawei.com.cn/schema/common/v2_1">
<spId>35000001</spId>
<spPassword>de96d901b3bad1db2aab76b7b0b202f2</spPassword>
<serviceId>0003062000001100</serviceId>
<timeStamp>20120731064245</timeStamp>
</RequestSOAPHeader>
</soapenv:Header>
<soapenv:Body>
<loc:startSmsNotification>
<loc:reference>
<endpoint>>http://10.138.30.153:9080/notify</endpoint>
<interfaceName>notifySmsReception</interfaceName>
<correlator>1232</correlator>
</loc:reference>
<loc:smsServiceActivationNumber>23424
</loc:smsServiceActivationNumber> <!--Optional: -->
<loc:criteria>Love</loc:criteria>
</loc:startSmsNotification>
</soapenv:Body>
</soapenv:Envelope>`
我已经能够将正文消息添加到我的请求中,但不能添加肥皂标题信息。请求的验证需要标头信息。如何在生成的客户端代码中将soap头信息添加到我的soap请求中?