D
Dilip
Hello
This problem has been driving me mad for the past few days. I am
basically writing a generic utility in .NET/C# that can read any WSDL
file (over internet, intranet, localdir etc), generate dynamic proxy
on the fly and allow the user to invoke the methods.
It works perfectly *except* in these scenarios:
1) If I try to call a webservice deployed on another machine _within_
our network (LAN), WebResponse.GetResponse() fails with a Server
Unavailable Error (503).
2) To solve the above if I specify the correct proxy settings using
WebProxy.Address property, the WSDL file is retrieved alright.
2A) However if I assign WebRequest.Proxy with
WebProxy.GetDefaultProxy() then the WSDL retrieval fails again. But
lets for the moment ignore this and assume I am ok with step 2.
3) After I successfully create the dynamic proxy (using CodeDOM et
al), the MethodInfo.Invoke(objectinstance, argsforthemethod) blows up
with a WebException. I am attaching the stack trace in the bottom of
this mail.
4) I tried setting the Proxy property of SoapHttpClientProtocol
(objectinstance.GetProperty("Proxy") et al) but that has no effect.
5) Everything works PERFECTLY WELL if I access a public domain WSDL on
the internet (with or without the proxy settings -- it doesnt seem to
matter).
So bottom line is can somebody *please* tell me why this is not
working in the LAN scenario? and that too only when I invoke the
method and not when I retrieve the WSDL file?
Stacktrace follows:
==================
Exception has been thrown by the target of an invocation.
System.Net.WebException: The request failed with HTTP status 503:
Service Unavailable.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at WebServices.dynamicProxyGenerator.DynamicProxy.AMSWebService.echoHeartBeat(String
bstrEchoData)
Additional Info:
================
WebException.Response ---> System.Net.HttpWebResponse
WebException.Source ---> System.Web.Services
WebException.Status ---> ProtocolError
WebException.TargetSite.Name ---> ReadResponse
I ran Simon Fell's (www.pocketsoap.com) excellent tcpTrace utility.
In the LAN case I am able to see a GET request for my WSDL file (GET
/amswebservice/amswebservice.wsdl HTTP/1.1) and the subsequent
response. But when a method is invoked it doesn't even seem to hit
the webserver. Its intercepted somewhere in between and I can't
figure out where.
thanks a ton!
--Dilip
This problem has been driving me mad for the past few days. I am
basically writing a generic utility in .NET/C# that can read any WSDL
file (over internet, intranet, localdir etc), generate dynamic proxy
on the fly and allow the user to invoke the methods.
It works perfectly *except* in these scenarios:
1) If I try to call a webservice deployed on another machine _within_
our network (LAN), WebResponse.GetResponse() fails with a Server
Unavailable Error (503).
2) To solve the above if I specify the correct proxy settings using
WebProxy.Address property, the WSDL file is retrieved alright.
2A) However if I assign WebRequest.Proxy with
WebProxy.GetDefaultProxy() then the WSDL retrieval fails again. But
lets for the moment ignore this and assume I am ok with step 2.
3) After I successfully create the dynamic proxy (using CodeDOM et
al), the MethodInfo.Invoke(objectinstance, argsforthemethod) blows up
with a WebException. I am attaching the stack trace in the bottom of
this mail.
4) I tried setting the Proxy property of SoapHttpClientProtocol
(objectinstance.GetProperty("Proxy") et al) but that has no effect.
5) Everything works PERFECTLY WELL if I access a public domain WSDL on
the internet (with or without the proxy settings -- it doesnt seem to
matter).
So bottom line is can somebody *please* tell me why this is not
working in the LAN scenario? and that too only when I invoke the
method and not when I retrieve the WSDL file?
Stacktrace follows:
==================
Exception has been thrown by the target of an invocation.
System.Net.WebException: The request failed with HTTP status 503:
Service Unavailable.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage
message, WebResponse response, Stream responseStream)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String
methodName, Object[] parameters)
at WebServices.dynamicProxyGenerator.DynamicProxy.AMSWebService.echoHeartBeat(String
bstrEchoData)
Additional Info:
================
WebException.Response ---> System.Net.HttpWebResponse
WebException.Source ---> System.Web.Services
WebException.Status ---> ProtocolError
WebException.TargetSite.Name ---> ReadResponse
I ran Simon Fell's (www.pocketsoap.com) excellent tcpTrace utility.
In the LAN case I am able to see a GET request for my WSDL file (GET
/amswebservice/amswebservice.wsdl HTTP/1.1) and the subsequent
response. But when a method is invoked it doesn't even seem to hit
the webserver. Its intercepted somewhere in between and I can't
figure out where.
thanks a ton!
--Dilip