【发布时间】:2018-02-16 12:28:54
【问题描述】:
我对 Fuse 和 WebServices 比较陌生。
我用 BasicAuthAuthorizationInterceptor 做了一个 SOAP WebService,这是实际的上下文,它正在工作:
<cxf:cxfEndpoint address="/SampleEp" id="insertSomethingToDB" serviceClass="com.example.sample_ep.SampleEp" wsdlURL="wsdl/SampleEP.wsdl">
<cxf:inInterceptors>
<ref component-id="securityInterceptor"/>
</cxf:inInterceptors>
</cxf:cxfEndpoint>
<bean
class="com.example.middleware.BasicAuthAuthorizationInterceptor" id="securityInterceptor">
<property name="users">
<map>
<entry key="user" value="password"/>
</map>
</property>
</bean>
所以,为了增加安全性,我会尝试将用户放在项目外部的属性文件中,这是这个想法:
<cxf:cxfEndpoint address="/SampleEp" id="insertSomethingToDB" serviceClass="com.example.sample_ep.SampleEp" wsdlURL="wsdl/SampleEP.wsdl">
<cxf:inInterceptors>
<ref component-id="securityInterceptor"/>
</cxf:inInterceptors>
</cxf:cxfEndpoint>
<bean
class="com.example.middleware.BasicAuthAuthorizationInterceptor" id="securityInterceptor">
<property name="users">
<map>
<entry key="${cxf.user}" value="${cxf.password}"/>
</map>
</property>
</bean>
<bean> add some code to add a *.properties file outside the project </bean>
这可能吗? 还是我真的不擅长这个?
【问题讨论】:
-
您使用的是 blueprint.xml 还是 spring.xml 文件?
-
我正在使用 Blueprint.xml 上下文
标签: java maven web-services apache-karaf fuseesb