【发布时间】:2015-04-15 00:49:16
【问题描述】:
目前,我正在使用注解来指定绑定类型,特别指出我的 Web 服务应该使用 SOAP 1.2,但我想修改我的 Web 服务以同时接受 SOAP 1.1 和 SOAP 1.2 请求。
如果有办法,您能帮忙吗?
@WebService
public interface ExternalService {
@WebMethod
public WebTx getTxByTxRefNum(@WebParam(name="txRefNumber") String txRefNumber,
@WebParam(name="applicationName") String applicationName);
}
@WebService(endpointInterface = "com.abc.cde.service.ExternalService", serviceName ="ExternalService")
@BindingType(value = SOAP12HTTP_BINDING)
@WSDLDocumentation(value="ABC SOAP 1.2 Services for External Applications", placement = WSDLDocumentation.Placement.TOP)
public class ExternalServiceImpl implements ExternalService {
@Autowired
private TxService txService = null;
public WebTx getTxByTxRefNum(String txRefNumber, String applicationName) {
try {
---
---
Tx tx = this.txService.getTransactionByTxRefNum(txRefNumber, applicationName);
} catch(RuntimeException runtimeException) {
---
----
---
}
}
}
<bean id="externalService" class="com.abc.cde.service.ExternalServiceImpl"/>
<jaxws:endpoint id="ExternalService" implementor="#externalService" address="/ExternalService">
<jaxws:inInterceptors>
<bean class="org.apache.cxf.binding.soap.saaj.SAAJInInterceptor" />
<bean class="org.apache.cxf.ws.security.wss4j.WSS4JInInterceptor">
<constructor-arg>
<map>
<entry key="action" value="UsernameToken" />
<entry key="passwordType" value="PasswordText" />
<entry key="passwordCallbackRef">
<ref bean="serverPasswordCallback" />
</entry>
</map>
</constructor-arg>
</bean>
<!-- <ref bean="logInbound" />
<ref bean="logOutbound" /> -->
</jaxws:inInterceptors>
</jaxws:endpoint>
【问题讨论】:
标签: web-services soap cxf jax-ws ws-security