【问题标题】:Getting ERROR com.intuit.karate - http request failed: org.apache.http.conn.HttpHostConnectException收到错误 com.intuit.karate - http 请求失败:org.apache.http.conn.HttpHostConnectException
【发布时间】:2020-04-18 20:24:29
【问题描述】:
I am trying to run a demo scenario for Soap XML request . Have used the sample calculator web service . I works fine when i trigger the request from Soap UI .But the connection fails on trying to access the request from IntelliJ using Karate .
@SoapTest
    Feature:   
    Background:
    * url 'http://www.dneonline.com'
    * path 'calculator.asmx'
      * configure ssl = true

    Scenario: soap 1.1
        Given url apiURL
    And request
        """
        <?xml version="1.0" encoding="utf-8"?>
        <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
          <soap:Body>
            <Add xmlns="http://tempuri.org/">
              <intA>2</intA>
              <intB>3</intB>
            </Add>
          </soap:Body>
        </soap:Envelope>
        """
        When soap action 'http://tempuri.org/Add'
        Then status 200
        And match /Envelope/Body/AddResponse/AddResult == 5
        And Print response

**下面是正在使用的空手道配置文件**

 function() {   
          var config = {
            apiURL: 'http://www.dneonline.com/calculator.asmx'
          };

          karate.configure('connectTimeout', 5000);
          karate.configure('readTimeout', 5000);
          karate.configure('ssl', { trustAll: true });
          return config;
        }

错误详情: 12:38:56.822 [ForkJoinPool-1-worker-1] 错误 com.intuit.karate - org.apache.http.conn.ConnectTimeoutException:连接到 www.dneonline.com:80 [www.dneonline.com/45.40.165.23 ] 失败:连接超时,http 调用在 5068 毫秒后失败 URL:http://www.dneonline.com/calculator.asmx/calculator.asmx 12:38:56.822 [ForkJoinPool-1-worker-1] 错误 com.intuit.karate - http 请求失败: org.apache.http.conn.ConnectTimeoutException:连接到 www.dneonline.com:80 [www.dneonline.com/45.40.165.23] 失败:连接超时

I am not quite sure if i need to configure any proxy setting in Intellij or in the karate framework. 
or if it is something to do with the firewall as i am using my company's system.

Thanks .

【问题讨论】:

    标签: http intellij-idea soap karate


    【解决方案1】:

    是的,也许你必须设置一个代理:https://github.com/intuit/karate#configure

    * configure proxy = 'http://my.proxy.host:8080'
    

    【讨论】:

      【解决方案2】:

      感谢彼得的及时回复...您提供的解决方案效果很好。非常感谢:)

      【讨论】:

      • 只想评论时不要添加答案。
      猜你喜欢
      • 2015-04-10
      • 1970-01-01
      • 1970-01-01
      • 2022-10-02
      • 2012-04-08
      • 1970-01-01
      • 1970-01-01
      • 2013-07-21
      • 2019-12-22
      相关资源
      最近更新 更多