Search code examples
wcfvbscriptwsdlfiddlersoap-client

Why VB Script call to WCF works only when Fiddler is running


I have this strange behavior and I just can't figure it out. I have very simple VB Script using SoapClient and talks to a WCF Endpoint. Please see below.

Dim oPPWS As Object
Set oPPWS = CreateObject("MSSOAP.SoapClient30")

Const URL = "http://localhost:57660/Service1.svc?wsdl"
oPPWS.MSSoapInit URL

Dim strResp As String
strResp = oPPWS.GetData()

This code works perfectly "only" when Fiddler is running. Otherwise I get the below error on oPPWS.MSSoapInit URL

"WSDLReader:XML Parser failed at linenumber 0, lineposition 0, reason is: The download of the specified resource has failed. HRESULT=0x1: Incorrect function. - WSDLReader:Loading of the WSDL file failed HRESULT=0x80070057: The parameter is incorrect."

I think the Fiddler act as a proxy to the WCF call and make it somehow connect to the service. But I just don't know / can't explain exactly why. Has anyone seen this before? Also is there a way to get this code working without this behavior?

I'm also running on Windows 8.

Thanks.


Solution

  • Finally figure this out. It was my IE proxy settings causing it to not to work. Once I turn off the IE proxy settings, whether having the Fiddler opened or not, the above script works. I think the Fiddler ignore the IE proxy settings? May be but I don't know.

    The way I found this issue is using Wireshark It shows the request failed because the Proxy access id denied

    Spent few hours for nothing and hopefully this would save time for someone else :)