Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access_asp thread: About Web Services (pls: Urgent)


Message #1 by =?iso-8859-1?q?shyam=20sedamkar?= <shysed@y...> on Thu, 29 Aug 2002 13:49:40 +0100 (BST)
 
  Hi!,
  
  i am a novice to ASP.Net and developing a simple Web Service application.
  it is an intranet Web Service application.
  i have compiled the Web Service using .Net Compiler and using the proxy
  class and have added the appropriate Web Reference in a ASP.net Web form.
  Also i have added a reference for the "Proxy dll" using 'Add Reference'
  
  i am able to use the Web Service if i give the URL of the ".asmx" web
  sevice in a Web Browser.
  i am able to create the instance of the Web Serice class and trying to 
  call the Web Service method 'SelEmployee' in a ASP.Net Web Form.
----------------------------------------------------------------------------------
  Now my problem is:
   
         When i call the web method 'SelEmployee' through the ASP.net
    Web form, i get the runtime error:  
         "The request failed with HTTP status 425: 
   Refused.System.Web.ServicesSystem.Object[]                   
ReadResponse(System.Web.Services.Protocols.SoapClientMessage,
   System.Net.WebResponse, System.IO.Stream)" 
-----------------------------------------------------------------------------------

  i am including the WebService and ASP.net application code below:
  
  The Web Service code is as follows: 
  Imports System.Web.Services
  <WebService(Namespace:="http://BAS/WebService24/")> _
  Public Class wcsEmployee
    Inherits System.Web.Services.WebService
    <WebMethod()> Public Function SelEmployee() As DataSet
        
 Dim Cn As SqlClient.SqlConnection
        Dim Adp As SqlClient.SqlDataAdapter
        Dim Ds As DataSet

        Cn = New SqlClient.SqlConnection("server=BAS\NetSDK;uid=sa;pwd=;database=employee;")
        Cn.Open()
       
 Adp = New SqlClient.SqlDataAdapter("Select * from emp_info", Cn)
        Adp.SelectCommand.CommandType = CommandType.Text
        Ds = New DataSet()
        Adp.Fill(Ds)
        
 cn.close()
        Return Ds
    End Function
  End Class

-------------------------------------------------------------------------------------------

  The ASP.net Web Form application is:
  Imports GUIwsEmployee1.BAS.wcsEmployee
  Public Class WebForm1
    Inherits System.Web.UI.Page
    
    Private Sub cmdselect_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles    
  cmdselect.Click
        
 Dim ds As DataSet
        Dim retStr As String
        Try
            Dim WSObj As New GUIwsEmployee1.BAS.wcsEmployee()
            WSObj.Credentials = System.Net.CredentialCache.DefaultCredentials
            ds = WSObj.SelEmployee()
            
     txtName.Text = ds.Tables(0).Rows(0)(0)
            
        Catch ex As Exception
            Response.Write(ex.Message)
            
        Finally
        End Try
    End Sub
  End Class

------------------------------------------------------------------------------------------------
  
 > Eagerly waiting for your earliest responce.
 > Advance Thanks!!
  


---------------------------------
 Sell you car, by placing a classified ad on Yahoo India Autos . It's Free!!   

  Return to Index