作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 SOAP 消息调用正在我的soapUI 上运行
<soapenv:Envelope xmlns:cen="http://netadmin.ghl.com/centralizedconfig" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-21">
<wsse:Username>admin</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">secret</wsse:Password>
<wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">xo6ADfFZ5aqvukQZjUb6IQ==</wsse:Nonce>
<wsu:Created>2013-10-01T06:59:20.202Z</wsu:Created>
</wsse:UsernameToken>
<wsu:Timestamp wsu:Id="TS-20">
<wsu:Created>2013-10-01T06:58:47.521Z</wsu:Created>
<wsu:Expires>2013-10-01T07:10:47.521Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</soapenv:Header>
<soapenv:Body>
<cen:GetXMLRequest>
<cen:IpAddress>10.36.28.211</cen:IpAddress>
</cen:GetXMLRequest>
</soapenv:Body>
</soapenv:Envelope>
每当我在 SOAP UI 上运行它来测试我的 Web 服务时,它都工作得很好,我在使用 webServiceTemplate.sendSourceAndReceiveToResult 调用翻译此 SOAP 消息时遇到困难,我是 Web 服务新手我不知道如何将标题消息合并到我的代码中。有人可以帮我弄这个吗?
客户电话:
webServiceTemplate.sendSourceAndReceiveToResult (网址、来源、结果);
我似乎无法在源参数中包含安全 header
最佳答案
我在我的 Spring 客户端应用程序上下文中添加了一个拦截器
<bean id="wss4jSecurityInterceptor"
class="org.springframework.ws.soap.security.wss4j.Wss4jSecurityInterceptor">
<property name="securementActions" value="UsernameToken" />
<property name="securementUsername" value="user" />
<property name="securementPassword" value="password" />
<property name="validationCallbackHandler" ref="callbackHandler" />
</bean>
关于java - 如何将SOAP消息转换为SPRING WS的webServiceTemplate.sendSourceAndReceiveToResult,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19110914/
我有一个 SOAP 消息调用正在我的soapUI 上运行 admin
关闭。此题需要details or clarity 。目前不接受答案。 想要改进这个问题吗?通过 editing this post 添加详细信息并澄清问题. 已关闭 8 年前。 Improve th
我是一名优秀的程序员,十分优秀!