webservice multiple configuration

apache axis client invoke test :
org.apache.axis.client.Service service=new org.apache.axis.client.Service();
org.apache.axis.client.Call call=(org.apache.axis.client.Call)service.createCall();       
call.setTargetEndpointAddress(new java.net.URL(actionUrl));
call.setOperationName(new javax.xml.namespace.QName("http://payat.ips.com.cn/WebService/CATPayment","SubmitOrder"));
call.addParameter("orderInfo", org.apache.axis.encoding.XMLType.XSD_STRING, javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.encoding.XMLType.XSD_STRING);
call.setUseSOAPAction(true);
call.setSOAPActionURI("http://payat.ips.com.cn/WebService/CATPayment/SubmitOrder");
String orderXml="<?xml version=\"1.0\" encoding=\"utf-8\"?><OrderInfo></OrderInfo>";                   
String retXml=(String)call.invoke(new Object[]{orderXml});
org.w3c.dom.Document doc=javax.xml.parsers.DocumentBuilderFactory.newInstance().newDocumentBuilder().parse(new java.io.ByteArrayInputStream(retXml.getBytes("UTF-8")));
if (doc.getElementsByTagName("pSucc").item(0).getTextContent().equalsIgnoreCase("S"))


xfire server configuration (integration spring ):
<beans>
    <import resource="classpath:org/codehaus/xfire/spring/xfire.xml"/>
    <bean name="hotelBookService1" class="org.codehaus.xfire.spring.ServiceBean">
        <property name="serviceBean" ref="hotelBookService" />
        <property name="serviceClass" value="com.bbc.bureau.webservice.HotelBookService"/>
    </bean>
    <bean id="hotelBookService" class="com.bbc.bureau.webservice.impl.HotelBookServiceImpl"/>
</beans>

 

web.xml
<servlet>
<servlet-name>XFireServlet</servlet-name>
<servlet-class>org.codehaus.xfire.spring.XFireSpringServlet</servlet-class>
<load-on-startup>4</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>XFireServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>



xfire default configuration (without spring):

services.xml
<beans xmlns="http://xfire.codehaus.org/config/1.0">
    <service>
        <name>SyncFaxGetData</name>
        <namespace>http://service.bbcmart.com</namespace>
        <serviceClass>com.bbcmart.service.ISyncFaxGetData</serviceClass>
        <implementationClass>com.bbcmart.service.SyncFaxGetData</implementationClass>
    </service>
</beans>

 

web.xml

  <servlet>
    <servlet-name>XFireServlet</servlet-name>
    <servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
  </servlet>
  <servlet-mapping>
        <servlet-name>XFireServlet</servlet-name>
        <url-pattern>/servlet/XFireServlet/*</url-pattern>
    </servlet-mapping>
  <servlet-mapping>
    <servlet-name>XFireServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>




rest style jersey:
<context:component-scan base-package="com.linkmed.webservices"/>
<servlet-class>com.sun.jersey.spi.spring.container.servlet.SpringServlet</servlet-class></servlet>

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值