简体   繁体   中英

How to set up stubby db for SOAP services

I am trying to stub SOAP services. I found that stubby4j and stubby-db both can stub SOAP services. But all the examples given are for RESTful services.

How to stub SOAP services?

Is there any advantage to use particular one? I have to stub SOAP & REST services both. Can they be stubbed in single repo? Or do I need to create 2 separate stub repos or 2 separate mapping files?

stubby4j and stubby-db both can be used to stub HTTP(s) calls. You can consider SOAP services as POST HTTP call with XML payload.

Whether you should use StubbyDB or Stubby4j, it completely depends on your need.

You need not to split into 2 projects. You can still have both stub calls in single repository. However if you go with stubby4j, you can't split mappings in two files. You can have any number of mapping files with stubby-db.

Edit

SOAP

-  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"]

REST

-  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"]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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