Tomcat5.5\conf\server.xml
<Connector port="8443"
maxHttpHeaderSize="8192"
maxThreads="150"
minSpareThreads="25"
maxSpareThreads="75"
enableLookups="true"
disableUploadTimeout="true"
acceptCount="100"
scheme="https"
SSLEnabled="true"
secure="true"
clientAuth="false"
keystoreFile="C:/keystore/server.keystore"
keystorePass="123456"
sslProtocol="TLS" />
<bean id="baseWebService" class="org.codehaus.xfire.spring.remoting.XFireExporter" lazy-init="false" abstract="true">
<property name="serviceFactory" ref="xfire.serviceFactory" />
<property name="xfire" ref="xfire" />
</bean>
<bean id="helloWorldService" parent="baseWebService">
<property name="serviceBean" ref="helloWorld" />
<property name="serviceClass" value="com.xiajs.demo.webservice.HelloWorld" />
</bean>
<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
<property name="urlMap">
<map>
<entry key="/helloWorld.ws">
<ref bean="helloWorldService" />
</entry>
</map>
</property>
</bean>
public static void main(String[] args) {
System.setProperty("javax.net.ssl.trustStore", "C:/keystore/clientstore");
System.setProperty("javax.net.ssl.trustStorePassword", "123456");
String helloWorldURL_http = "http://192.168.22.25:81/SSHDemo/helloWorld.ws";
String helloWorldURL_https = "https://192.168.22.25:8443/SSHDemo/helloWorld.ws";
Service srvcModel = new ObjectServiceFactory().create(HelloWorld.class);
XFireProxyFactory factory = new XFireProxyFactory(XFireFactory.newInstance().getXFire());
try {
HelloWorld srvc = (HelloWorld) factory.create(srvcModel, helloWorldURL_http);
System.out.println("调用函数 sayHello得到结果 :" + srvc.sayHelloWorld("============="));
} catch (MalformedURLException e) {
e.printStackTrace();
}
}