簡體   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