简体   繁体   English

具有SSL的SoapUI REST模拟服务

[英]SoapUI REST Mock Service with SSL

I'm having an issue with SoapUI 5.0.0. 我在SoapUI 5.0.0中遇到问题。 while trying to Mock a RESTFul service using SSL. 尝试使用SSL模拟RESTFul服务时。 Everything works fine if I don't use SSL at all. 如果我根本不使用SSL,一切都会正常。

In SoapUI preferences : 在SoapUI首选项中:

  • I have enabled Mock SSL on port 8443 with the same keystores for Mock KeyStore and TrustStore. 我已经在端口8443上启用了具有用于Mock KeyStore和TrustStore的相同密钥库的Mock SSL。

In the mock service editor : 在模拟服务编辑器中:

  • path : /resource 路径:/资源
  • port : 8080 端口:8080
  • host : localhost 主机:本地主机

In the mock action editor : 在模拟动作编辑器中:

  • method : GET 方法:GET
  • resource path : /config 资源路径:/ config

What I'm doing then is creating new REST service from URI with the following parameters : 然后,我正在做的是使用以下参数从URI创建新的REST服务:

  • method : GET 方法:GET
  • endpoint : https://localhost:8443/resource 端点: https://localhost:8443/resource
  • resource : /config 资源:/ config

When I start the mock and call the request i get the following response generated by SoapUI instead of my mock content : 当我启动模拟并调用请求时,我得到了SoapUI生成的以下响应,而不是我的模拟内容:

<html>
   <head>
      <meta content="HTML Tidy for Java (vers. 26 sept. 2004), see www.w3.org" name="generator"/>
      <title/>
   </head>
   <body>
      <p>There are currently 1 running SoapUI MockServices</p>
      <ul>
         <li>
            <a href="/resource?WSDL">Mock</a>
         </li>
      </ul>
      <br/>
      <br/>
   </body>
</html>

Do you guys have an idea ? 你们有个主意吗?

Setup the SoapUI REST Mock using HTTP, then run a MockServer Proxy ( http://www.mock-server.com/ ) ahead of it to expose an HTTPS endpoint. 使用HTTP设置SoapUI REST Mock,然后在其前面运行MockServer代理( http://www.mock-server.com/ )以暴露HTTPS终结点。 If you need to simulate a corporate firewall, start another MockServer to act as the corporate proxy! 如果您需要模拟公司防火墙,请启动另一个MockServer充当公司代理!

eg. 例如。

SoapUI Mock on HTTP port 8003 HTTP端口8003上的SoapUI模拟

MockServer Proxy on HTTPS port 8002, redirects to HTTP on port 8003 HTTPS端口8002上的MockServer代理,重定向到端口8003上的HTTP

MockServer Proxy on HTTPS port 8001, redirects to HTTPS on port 8002 (simulates corporate proxy) HTTPS端口8001上的MockServer代理,重定向到端口8002上的HTTPS(模拟公司代理)

MockServer generates SSL certs or .jks which need to be added to your client application truststore to allow connection. MockServer生成SSL证书或.jks,需要将其添加到客户端应用程序信任库中以允许连接。

Unfortunately SSL is only implemented for SOAP mock services, not REST. 不幸的是,SSL仅针对SOAP模拟服务而不是REST实现。 There is a feature request for the latter. 后者有一个功能要求。 See: http://forum.soapui.org/viewtopic.php?f=2&t=25160 参见: http : //forum.soapui.org/viewtopic.php?f=2&t=25160

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

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