Hello everyone, this problem has been bugging me since yesterday.
I have written a webservice that basically gets data from a weatherapi provider in the form of xml. I have referenced this webservice in a class library and used the dll of this library in another project that i am working on.
At first, the usercontrol(i've used the methods in a usercontrol in asp.net) worked fine and showed the results...but after few runs, my website generated an exception
as follows:
No connection could be made because the target machine actively refused it 127.0.0.1:5230
Exception Details: System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:5230
Source Error:
Line 81: [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://tempuri.org/GetWeatherCondition", RequestNamespace="http://tempuri.org/", ResponseNamespace="http://tempuri.org/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
Line 82: public System.Xml.XmlElement GetWeatherCondition(string strLocation) {
Line 83: object[] results = this.Invoke("GetWeatherCondition", new object[] {
Line 84: strLocation});
Line 85: return ((System.Xml.XmlElement)(results[0]));
when i use the webreference without the classlibrary in the same solution this works fine. Am i doing something wrong while referencing it in the class library??...And if so why did it work the first few times??
I actually built the webservice in vs2010 and consumed it in an aspx file...it runs perfectly...but one thing i noticed is that...it uses port localhost:5230, now when i use the classlibrary in vs2008 that contains the webservice reference built in vs2010, i'm getting the above exception...the thing that interested me was that the target machine....localhost:5230 was actively refused...the same port vs2010 was using?? is there a way i can change which port the localhost listens to?