cxf configuration

XingKai 2013-03-19

cxf

1.serverside

@WebService

publicinterfaceServiceextendsRemote{

@WebMethod

publicList<Integer>getAll()throwsRemoteException;

}

@WebService(endpointInterface="package.Service",servicename="Service")

publicclassServiceImplimplementsService{

@Override

publicList<Integer>getAll()throwsRemoteException{

returnresultList;

}

<?xmlversion="1.0"encoding="UTF-8"?>

<beansxmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:aop="http://www.springframework.org/schema/aop"

xmlns:jaxws="http://cxf.apache.org/jaxws"

xsi:schemaLocation="http://www.springframework.org/schema/beans

http://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/aop

http://www.springframework.org/schema/aop/spring-aop-3.0.xsd

http://cxf.apache.org/jaxws

http://cxf.apache.org/schemas/jaxws.xsd">

<jaxws:serverid="jaxwservice"

serviceclass="package.Service"address="/Service">

<jaxws:serviceBean>

<beanid="serviceImpl"

class="package.ServiceImpl">

<propertyname="propertyName"ref="beanId"/>

</bean>

</jaxws:serviceBean>

</jaxws:server>

</bean>

2.clientside

<?xmlversion="1.0"encoding="UTF-8"?>

<beansxmlns="http://www.springframework.org/schema/beans"

xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:aop="http://www.springframework.org/schema/aop"

xmlns:jaxws="http://cxf.apache.org/jaxws"

xmlns:sec="http://cxf.apache.org/configuration/security"

xmlns:http="http://cxf.apache.org/transports/http/configuration"

xmlns:http-conf="http://cxf.apache.org/transports/http/configuration"

xsi:schemaLocation="http://www.springframework.org/schema/beanshttp://www.springframework.org/schema/beans/spring-beans-3.0.xsd

http://www.springframework.org/schema/aophttp://www.springframework.org/schema/aop/spring-aop-3.0.xsd

http://cxf.apache.org/configuration/security

http://cxf.apache.org/schemas/configuration/security.xsd

http://cxf.apache.org/transports/http/configuration

http://cxf.apache.org/schemas/configuration/http-conf.xsd

http://cxf.apache.org/jaxws

http://cxf.apache.org/schemas/jaxws.xsd">

<jaxws:clientid="service"

serviceclass="package.Service"

address="${webservice_url}"/>

<!--supperthttps-->

<http:conduitname="*.http-conduit">

<http:tlsClientParameterssecureSocketProtocol="${trustcerts.protocol}"disableCNCheck="${trustcerts.disableCN}">

<sec:trustManagers>

<sec:keyStoretype="${trustcerts.keystore.type}"password="${trustcerts.keystore.passwd}"file="${trustcerts.keystore.location}"/>

</sec:trustManagers>

</http:tlsClientParameters>

</http:conduit>

</bean>

相关推荐

tengmuxin / 0评论 2017-10-16