简体   繁体   English

Mule Esb Web服务中的模拟更新

[英]Mock ups in Mule Esb web services

I have some web service (CXF) on Mule Esb (3.4). 我在Mule Esb(3.4)上有一些Web服务(CXF)。 At the current moment I try to find the simple way to set up web service response that I need for UAT. 目前,我尝试找到一种简单的方法来设置UAT所需的Web服务响应。 I read a lot of information in the internet and as I understood there is a special framework Munit for all types of testing. 我在互联网上阅读了很多信息,据我了解,有一个适用于所有类型测试的特殊框架Munit。 But, it seems, this framework is used for more complex things than I need. 但是,似乎该框架用于比我需要的更复杂的事情。 So, could anybody recommend me a simple way to force Mule Esb return predefined xml response. 因此,有人可以推荐我一种强制Mule Esb返回预定义的xml响应的简单方法。 It will be fine if I create an xml response as xml document, upload it in any folder and Mule will send it as response when I call a web service. 如果我将xml响应创建为xml文档,将其上传到任何文件夹中,当我调用Web服务时,Mule会将其作为响应发送,那就很好了。 Thank you for any info for solving my task. 感谢您提供解决我的任务的任何信息。

You could probably upload the example responses to the classpath and then, in your flows just load that file and set it as payload. 您可能将示例响应上传到类路径,然后在流中仅加载该文件并将其设置为有效负载。

See this other stackoverflow question around how to accomplish this. 请参阅有关如何实现此目标的另一个stackoverflow 问题

You could use 2 flows. 您可以使用2个流。

1 flow for production with the Webservice implementation and 1 flow for UAT testing which returns you just a predefined XML (for example via the http endpoint). 1个使用Webservice实现的生产流程和1个UAT测试的流程,该流程仅返回预定义的XML(例如,通过http端点)。

Put both files in a seperate file and make a mule-deploy.properties file for both UAT and Production where you include the corect flows respectivly. 将两个文件放在一个单独的文件中,并为UAT和Production制作一个mule-deploy.properties文件,在其中分别包含corect流。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM