title: OWASP ZAP - Unable to intercept SOAP API requests
body: <p>I am new to the ZAP and trying to pen test XML(SOAP) services. I already have Java based regression tests for the SOAP and trying to proxy them through ZAP, but unable to do so.</p>
  <p>I am looking for some guidance as how to successfully use my regression tests to perform security testing on SOAP services using ZAP?</p>
  <p><em><strong>Details:</strong></em></p>
  <p>I add following parameters to Java in my regression tests so that they may successfully connect to SOAP services:</p>
  <pre><code>System.setProperty(&quot;javax.net.ssl.trustStore&quot;, &quot;C:/standalone/configuration/app.keystore&quot;); // certificate
  System.setProperty(&quot;javax.net.ssl.trustStorePassword&quot;, &quot;somepassword&quot;); // password
  </code></pre>
  <p>ZAP is starting up with following command-line and able to intercept other browser calls proxying through localhost:8888:</p>
  <pre><code>zap.bat -host localhost -port 8888 -config api.addrs.addr.regex=true -config api.key=12345 -config connection.timeoutInSecs=60
  </code></pre>
  <p>But when I try to run regression tests with following proxy settings, they completely ignore ZAP as proxy and run just fine with or without ZAP server running:</p>
  <pre><code>System.setProperty(&quot;http.proxyHost&quot;, &quot;localhost&quot;);     System.setProperty(&quot;http.proxyPort&quot;, &quot;8888&quot;);          
  System.setProperty(&quot;https.proxyHost&quot;, &quot;localhost&quot;);     System.setProperty(&quot;https.proxyPort&quot;, &quot;8888&quot;);
  </code></pre>
  <p>Then I added SOCKs proxy settings in regression tests:</p>
  <pre><code>System.setProperty(&quot;socksProxyHost&quot;, &quot;localhost&quot;);
  System.setProperty(&quot;socksProxyPort&quot;, &quot;8888&quot;);
  </code></pre>
  <p>Now, I get following error in tests:</p>
  <pre><code>16:52:00.623 [main] ERROR com.dummy.client.ServiceClient - java.net.SocketException: Can't connect to SOCKS proxy:Connection refused: connect
  java.net.SocketException: Can't connect to SOCKS proxy:Connection refused: connect
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:428) ~[?:1.8.0_211]
      at java.net.Socket.connect(Socket.java:589) ~[?:1.8.0_211]
      at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:339) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:373) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83) ~[httpclient-4.5.5.jar:4.5.5]
      at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108) ~[httpclient-4.5.5.jar:4.5.5]
      at com.dummy.client.AppHttpClient.request(AppHttpClient.java:83) ~[appc3-ws-client-12.00.01.jar:?]
      at com.dummy.stub.ServiceStub.authorization(ServiceStub.java:89) ~[appc3-ws-client-12.00.01.jar:?]
      at com.dummy.client.ServiceClient.doAuthorization(ServiceClient.java:367) ~[appc3-ws-client-12.00.01.jar:?]
      at com.dummy.client.ServiceClient.doAuthorization(ServiceClient.java:397) ~[appc3-ws-client-12.00.01.jar:?]
      at com.dummy.ca.reusable.WebService.authorization(WebService.java:65) ~[main/:?]
      at com.dummy.ca.reusable.WebService.Change(WebService.java:657) ~[main/:?]
      at com.dummy.ca.StepsLibrary.T3_Poster.changeDevice(T3_Poster.java:238) ~[main/:?]
      at com.dummy.ca.stepDefinations.PosterUpdatePD.change(PosterUpdatePD.java:219) ~[main/:?]
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_211]
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_211]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_211]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_211]
      at io.cucumber.java.Invoker.doInvoke(Invoker.java:66) ~[cucumber-java-6.1.2.jar:6.1.2]
      at io.cucumber.java.Invoker.invoke(Invoker.java:24) ~[cucumber-java-6.1.2.jar:6.1.2]
      at io.cucumber.java.AbstractGlueDefinition.invokeMethod(AbstractGlueDefinition.java:44) ~[cucumber-java-6.1.2.jar:6.1.2]
      at io.cucumber.java.JavaHookDefinition.execute(JavaHookDefinition.java:59) ~[cucumber-java-6.1.2.jar:6.1.2]
      at io.cucumber.core.runner.CoreHookDefinition.execute(CoreHookDefinition.java:44) ~[cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.runner.HookDefinitionMatch.runStep(HookDefinitionMatch.java:21) ~[cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.runner.TestStep.executeStep(TestStep.java:92) ~[cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.runner.TestStep.run(TestStep.java:63) ~[cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.runner.TestCase.run(TestCase.java:102) ~[cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.runner.Runner.runPickle(Runner.java:71) ~[cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.runtime.Runtime.lambda$execute$5(Runtime.java:110) ~[cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.runtime.CucumberExecutionContext.runTestCase(CucumberExecutionContext.java:131) ~[cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.runtime.Runtime.lambda$execute$6(Runtime.java:110) ~[cucumber-core-6.1.2.jar:6.1.2]
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) ~[?:1.8.0_211]
      at java.util.concurrent.FutureTask.run(FutureTask.java:266) ~[?:1.8.0_211]
      at io.cucumber.core.runtime.Runtime$SameThreadExecutorService.execute(Runtime.java:233) ~[cucumber-core-6.1.2.jar:6.1.2]
      at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:112) ~[?:1.8.0_211]
      at io.cucumber.core.runtime.Runtime.lambda$run$2(Runtime.java:86) ~[cucumber-core-6.1.2.jar:6.1.2]
      at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193) [?:1.8.0_211]
      at java.util.stream.SliceOps$1$1.accept(SliceOps.java:204) [?:1.8.0_211]
      at java.util.ArrayList$ArrayListSpliterator.tryAdvance(ArrayList.java:1359) [?:1.8.0_211]
      at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126) [?:1.8.0_211]
      at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498) [?:1.8.0_211]
      at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485) [?:1.8.0_211]
      at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471) [?:1.8.0_211]
      at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708) [?:1.8.0_211]
      at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) [?:1.8.0_211]
      at java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499) [?:1.8.0_211]
      at io.cucumber.core.runtime.Runtime.run(Runtime.java:87) [cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.cli.Main.run(Main.java:78) [cucumber-core-6.1.2.jar:6.1.2]
      at io.cucumber.core.cli.Main.main(Main.java:33) [cucumber-core-6.1.2.jar:6.1.2]
  </code></pre>
  <p>And ZAP command-line shows below Socket timeout warning, whenever I fire regression:</p>
  <pre><code>6862 [ZAP-BootstrapGUI] INFO  org.parosproxy.paros.extension.ExtensionLoader - Initializing Tips and Tricks
  6868 [ZAP-BootstrapGUI] INFO  org.parosproxy.paros.extension.ExtensionLoader - Initializing Allows to fuzz WebSocket messages.
  7259 [ZAP-BootstrapGUI] INFO  org.zaproxy.zap.extension.callback.ExtensionCallback - Started callback server on 0.0.0.0:61252
  7260 [ZAP-BootstrapGUI] INFO  org.zaproxy.zap.extension.keyboard.ExtensionKeyboard - Initializing keyboard shortcuts
  9203 [AWT-EventQueue-0] INFO  org.parosproxy.paros.control.Control - New Session
  9212 [AWT-EventQueue-0] INFO  org.parosproxy.paros.control.Control - Create and Open Untitled Db
  9219 [AWT-EventQueue-0] INFO  hsqldb.db.HSQLDB379AF3DEBD.ENGINE - dataFileCache commit start
  9221 [AWT-EventQueue-0] INFO  hsqldb.db.HSQLDB379AF3DEBD.ENGINE - dataFileCache commit end
  9231 [AWT-EventQueue-0] INFO  hsqldb.db.HSQLDB379AF3DEBD.ENGINE - Database closed
  9398 [AWT-EventQueue-0] INFO  hsqldb.db.HSQLDB379AF3DEBD.ENGINE - dataFileCache open start
  9402 [AWT-EventQueue-0] INFO  hsqldb.db.HSQLDB379AF3DEBD.ENGINE - dataFileCache commit start
  9407 [AWT-EventQueue-0] INFO  hsqldb.db.HSQLDB379AF3DEBD.ENGINE - dataFileCache commit end
  9408 [AWT-EventQueue-0] INFO  hsqldb.db.HSQLDB379AF3DEBD.ENGINE - dataFileCache open end
  40538 [ZAP-ProxyThread-1] WARN  org.parosproxy.paros.core.proxy.ProxyThread - Socket timeout while reading first message.
  50575 [ZAP-ProxyThread-2] WARN  org.parosproxy.paros.core.proxy.ProxyThread - Socket timeout while reading first message.
  60604 [ZAP-ProxyThread-3] WARN  org.parosproxy.paros.core.proxy.ProxyThread - Socket timeout while reading first message.
  70630 [ZAP-ProxyThread-4] WARN  org.parosproxy.paros.core.proxy.ProxyThread - Socket timeout while reading first message.
  80679 [ZAP-ProxyThread-5] WARN  org.parosproxy.paros.core.proxy.ProxyThread - Socket timeout while reading first message.
  </code></pre>