【发布时间】:2016-06-20 12:15:01
【问题描述】:
嗨,我有一个肥皂请求
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<ns2:TrackRequest xmlns:ns4="namespace4" xmlns:ns3="namespace3" xmlns:ns2="namespace2" xmlns="namespace1">
<Request>
<RequestOption>BB</RequestOption>
</Request>
<ns2:InquiryNumber>AA</ns2:InquiryNumber>
</ns2:TrackRequest>
</soap:Body>
我要这样
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<ns3:MYSecurity xmlns:ns3="namespace3">
<ns3:UsernameToken>
<ns3:Username>5</ns3:Username>
<ns3:Password>N</ns3:Password>
</ns3:UsernameToken>
<ns3:ServiceAccessToken>
<ns3:AccessLicenseNumber>AC</ns3:AccessLicenseNumber>
</ns3:ServiceAccessToken>
</ns3:MYSecurity>
</soap:Header>
<soap:Body>
<soap:Body>
<ns2:TrackRequest xmlns:ns4="namespac4" xmlns:ns3="namespace3" xmlns:ns2="namespace2" xmlns="namespace1">
<Request>
<RequestOption>BB</RequestOption>
</Request>
<ns2:InquiryNumber>AA</ns2:InquiryNumber>
</ns2:TrackRequest>
</soap:Body>
我如何使用 mule SOAP CXF 组件来做到这一点?我们可以使用
public class SecurityHeaderInterceptor extends AbstractSoapInterceptor {
//java代码 }
class 文件使用 Java 来完成这项任务?如果可以,那是怎么回事?添加标题后需要输入。
【问题讨论】:
-
您是否尝试过使用 log4j2.xml 日志记录配置?
,添加CXF的包即可。 -
不行.. 怎么做?
-
你用的是什么版本的mule?
-
我正在使用 mule 3.6.1
标签: header namespaces mule cxf interceptor