簡體   English   中英

使用Spring WS Test測試CXF客戶端

[英]Testing CXF Client with Spring WS Test

根據文檔,您可以使用http://docs.spring.io/spring-ws/site/apidocs/org/springframework/ws/test/client/MockWebServiceServer.html服務器很好地測試WS客戶端。

但是您的客戶必須具備一個先決條件

   // MyWebServiceClient extends WebServiceGatewaySupport, and is configured in applicationContext.xml
   @Autowired
   private MyWebServiceClient client;

擴展WebServiceGatewaySupport。

我的問題是,如果我正在使用另一個實現(例如CXF),該怎么辦。 是否有支持CXF客戶端的現有模擬服務器實現?

不能。spring-ws-test模塊特定於Spring-WS,不能與其他框架一起使用。 例如,您可以為此使用SoapUI。

我創建了一個簡單的JUnit規則 ,使您可以在CXF中模擬服務器。 基本上,使用屬性配置客戶端,然后將其指向委托給模擬對象的Web服務實例。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM