繁体   English   中英

如何为 SOAP 服务设置 stubby db

[英]How to set up stubby db for SOAP services

我正在尝试存根 SOAP 服务。 我发现stubby4j和 stubby-db 都可以存根 SOAP 服务。 但是给出的所有示例都是针对 RESTful 服务的。

如何存根 SOAP 服务?

使用特定的有什么好处吗? 我必须同时存根 SOAP 和 REST 服务。 它们可以在单个回购中存根吗? 还是我需要创建 2 个单独的存根存储库或 2 个单独的映射文件?

stubby4j 和stubby-db都可用于存根 HTTP(s) 调用。 您可以将 SOAP 服务视为带有 XML 负载的 POST HTTP 调用。

您应该使用 StubbyDB 还是 Stubby4j,这完全取决于您的需要。

您无需拆分为 2 个项目。 您仍然可以在单个存储库中进行两个存根调用。 但是,如果您使用 stubby4j,则无法将映射拆分为两个文件。 您可以使用 stubby-db 拥有任意数量的映射文件。

编辑

肥皂

-  request:
      method: POST
      url: /soap-simulator/services/ServiceName
      post: actionName[\s\S]*mobile.([0-9]+)

   response:
      status: 200
      latency: 0
      headers:
            content-type: text/xml
      strategy: "first-found"
      files: ["stubs/<% post.1 %>/response.xml","stubs/ServiceName/actionName/default.xml"]

休息

-  request:
      method: POST
      url: /soap-simulator/services/ServiceName/actionName
      post: mobile.([0-9]+)

   response:
      status: 200
      latency: 0
      headers:
            content-type: text/xml
      strategy: "first-found"
      files: ["stubs/<% post.1 %>/response.xml","stubs/ServiceName/actionName/default.xml"]

暂无
暂无

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

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