System.Net.Sockets.SocketException+webservice+Sour abh Das

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sd1978
    New Member
    • Jun 2007
    • 5

    System.Net.Sockets.SocketException+webservice+Sour abh Das

    Hi,
    I have placed a webservice in the webserver. When I access it from a webpage, default.aspx on a click of a button i get the following error:

    No connection could be made because the target machine actively refused it
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.


    Exception Details: System.Net.Sock ets.SocketExcep tion: No connection could be made because the target machine actively refused it

    Source Error:

    Line 91: [System.Web.Serv ices.Protocols. SoapDocumentMet hodAttribute("h ttp://tempuri.org/getProducts", RequestNamespac e="http://tempuri.org/", ResponseNamespa ce="http://tempuri.org/", Use=System.Web. Services.Descri ption.SoapBindi ngUse.Literal, ParameterStyle= System.Web.Serv ices.Protocols. SoapParameterSt yle.Wrapped)]
    Line 92: public System.Data.Dat aSet getProducts(int productid) {
    Line 93: object[] results = this.Invoke("ge tProducts", new object[] {
    Line 94: productid});
    Line 95: return ((System.Data.D ataSet)(results[0]));


    Source File: c:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \Temporary ASP.NET Files\root\6dce cb27\a382a372\A pp_WebReference s.lgdo8f58.0.cs Line: 93

    Stack Trace:


    [SocketException (0x274d): No connection could be made because the target machine actively refused it]
    System.Net.Sock ets.Socket.DoCo nnect(EndPoint endPointSnapsho t, SocketAddress socketAddress) +1002082
    System.Net.Sock ets.Socket.Inte rnalConnect(End Point remoteEP) +33
    System.Net.Serv icePoint.Connec tSocketInternal (Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketSt ate state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) +431

    [WebException: Unable to connect to the remote server]
    System.Net.Http WebRequest.GetR equestStream() +1504461
    System.Web.Serv ices.Protocols. SoapHttpClientP rotocol.Invoke( String methodName, Object[] parameters) +103
    localhost.Produ ctsService.getP roducts(Int32 productid) in c:\WINDOWS\Micr osoft.NET\Frame work\v2.0.50727 \Temporary ASP.NET Files\root\6dce cb27\a382a372\A pp_WebReference s.lgdo8f58.0.cs :93
    _Default.btnCat egory_Click(Obj ect sender, EventArgs e) in D:\users\Padmaj amvl\arete\www\ Default.aspx.vb :40
    System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +105
    System.Web.UI.W ebControls.Butt on.RaisePostBac kEvent(String eventArgument) +107
    System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring eventArgument) +7
    System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler sourceControl, String eventArgument) +11
    System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
    System.Web.UI.P age.ProcessRequ estMain(Boolean includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +5102

    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET Version:2.0.507 27.210

    Please tell me what is the error. Its urgent.
    Regards.
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    No connection could be made because the target machine actively refused it
    This is the error given when the client can find the computer it wants to connect to but there is no one listening on that port.

    Possible causes:
    The port on the client does not match the port on the server
    The server is set to listen on localhost and not IPANY
    Misconfiguratio n of the service/client

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      Plater has basically covered all the bases here but I'm just going to double check...
      Have you provided the correct credentials to connect to that web service?

      -Frinny

      Comment

      • sd1978
        New Member
        • Jun 2007
        • 5

        #4
        I will tell you what i have done.

        1. I have created the webservice in vs2005.

        2. On the solution>right click> add webreference>ur l=www.arete.in> select webservice>rena me webservice reference name="areteweb" >click - add web refenrece.

        3. Disco file, discomap file and wsdl file added to the solution.

        4. the opened the following path: www.arete.in/default.aspx which is giving the error. You can also check this link and see the live error. if you select By Category OPtion enter Seafood, else if you select By Products option enter 1 in the textbox. this is nothing but a dummy that i have made and connected to my machine. the webservice is placed in the webserver. the database is northwind. once this webservice works fine I will only need to change the sql string.

        Regards,

        Comment

        • Plater
          Recognized Expert Expert
          • Apr 2007
          • 7872

          #5
          I get a sql error (it times out trying to reach the sql server)

          Comment

          Working...