当前位置: 代码迷 >> Web前端 >> Webservices手记客户端调用
  详细解决方案

Webservices手记客户端调用

热度:102   发布时间:2012-11-15 15:16:14.0
Webservices手写客户端调用
客户端调用
 
            // 实例化ISM Web Service
            org.codehaus.xfire.service.Service ISMserviceModel = new ObjectServiceFactory().create(IsmWebService.class,
                null,
                Constants.ISM_SERVERDNS,
                null);
 // ISM
            IsmWebService ismService = (IsmWebService) serviceFactory.create(ISMserviceModel, Constants.ISM_SERVERURL);

服务端web.xml
<servlet>
		<servlet-name>XFireServlet</servlet-name>
		<servlet-class>
			org.codehaus.xfire.transport.http.XFireConfigurableServlet
		</servlet-class>
		<init-param>
	     	<param-name>config</param-name>
	     	<param-value>services.xml</param-value>
		</init-param>
		<load-on-startup>2</load-on-startup>
  	</servlet>  

    <servlet-mapping>
	    <servlet-name>XFireServlet</servlet-name>
		<url-pattern>/services/*</url-pattern>
	</servlet-mapping>

servcies.xml
<beans>
<service xmlns="http://xfire.codehaus.org/config/1.0">  
	    <name>saas</name>
	    <namespace>http://www.saas.com/saasService</namespace>
	    <serviceClass>com.server.saas.SaasService</serviceClass>
	    <implementationClass>com.server.saas.SaasServiceImpl</implementationClass> 
  	</service>  
</beans>