problem in using the webservice.htc file to call webservice method

Last post 07-09-2008 1:42 AM by Sidewinder2. 1 replies.

Sort Posts:

  • problem in using the webservice.htc file to call webservice method

    07-08-2008, 6:43 AM
    • Member
      607 point Member
    • Sidewinder2
    • Member since 06-24-2008, 7:46 AM
    • Chennai (Incredible INDIA)
    • Posts 459

    Hello Mate,

                       The webservice method is not getting called . COULD U PLEASE HELP ME ON THIS PROBLEM?              

                       First of all i have a folder called "Masters" in my project.

                       In that folder i am having two webpages ( one as master page and other as a pop up page) and a webservice.htc file which i had downloaded from the internet.

                       I have specified the htc file (which is nothing but webservice's behavior file) in webpage's source code as

                      <div id="service" style="behavior:url(webservice.htc)"></div

                        i have a webservice file and also a jscript file.

    in the jscript file i have coded as

    (in this i have specified "FillTable" which is nothing but the webservice method. it is used to fill a datatable from the parameters passed and stored in a session variable. after that the succeededcall back function will refresh the parent form in which i will fill a datagrid using the datatable in the session variable) function init()

    {

    service.useService(
    "Webservices/GridTasks.asmx?WSDL","GridTasks");

    }

    function CreateAndFillTable()

    {

    alert("in create and fill table");

    var strtxtCust_cp_code = document.getElementById("Table1_txtCust_cp_code").value;

    var strtxtCust_cp_name = document.getElementById("Table1_txtCust_cp_name").value;

    var strtxtCust_cp_desig = document.getElementById("Table1_txtCust_cp_desig").value;

    var strtxtcust_cp_ph_no = document.getElementById("Table1_txtCust_cp_phone_no").value;

    var strtxtCust_cp_mobile_no = document.getElementById("Table1_txtCust_cp_mobile_no").value;

    var strtxtCust_cp_email_id = document.getElementById("Table1_txtCust_cp_email").value;

    var strtxtCust_cp_rmks = document.getElementById("Table1_txtCust_cp_rmks").value;

     

    init();

    var iCallID; iCallID = service.GridTasks.callService(SucceededCallback,"FillTable",strtxtCust_cp_code,strtxtCust_cp_name,strtxtCust_cp_desig,strtxtcust_cp_ph_no,strtxtCust_cp_mobile_no,strtxtCust_cp_email_id,strtxtCust_cp_rmks);

    }

    function SucceededCallback()

    {

    opener.document.forms[
    "aspnetForm"].submit();

    window.close();

    }

     

    WebService method:

    <WebMethod(True)> _

    Public Sub FillTable(ByVal strtxtCust_cp_code As String, ByVal strtxtCust_cp_name As String, ByVal strtxtCust_cp_desig As String, ByVal strtxtcust_cp_ph_no As String, ByVal strtxtCust_cp_mobile_no As String, ByVal strtxtCust_cp_email_id As String, ByVal strtxtCust_cp_rmks As String)

    MsgBox("filltable/webservices") Dim Table6 As New DataTable

    Try

    Dim Delete As New DataColumn Delete.ColumnName = "Delete"

     

    Dim Modify As New DataColumnModify.ColumnName = "Modify"

     

     

    Dim Code As New DataColumn Code.ColumnName = "Code"

     

    Dim Name As New DataColumn Name.ColumnName = "Name"

     

    Dim Designation As New DataColumn Designation.ColumnName = "Designation"

     

    Dim Phone As New DataColumn Phone.ColumnName = "Phone"

     

    Dim Mobile As New DataColumn Mobile.ColumnName = "Mobile"

     

    Dim Email As New DataColumn Email.ColumnName = "Email"

     

    Dim Remarks As New DataColumnRemarks.ColumnName = "Remarks"

     

     

    Table6.Columns.Add(Delete)

    Table6.Columns.Add(Modify)

    Table6.Columns.Add(Code)

    Table6.Columns.Add(Name)

    Table6.Columns.Add(Designation)

    Table6.Columns.Add(Phone)

    Table6.Columns.Add(Mobile)

    Table6.Columns.Add(Email)

    Table6.Columns.Add(Remarks)

    If Session("CUST_Info") Is Nothing Then

    Table6.Rows.Add(0)

    Table6.Rows(0).Item("Delete") = "Delete.png"

    Table6.Rows(0).Item("Modify") = "Modify.png"

    Table6.Rows(0).Item("Code") = strtxtCust_cp_code

    Table6.Rows(0).Item("Name") = strtxtCust_cp_name

    Table6.Rows(0).Item("Designation") = strtxtCust_cp_desig

    Table6.Rows(0).Item("Phone") = strtxtcust_cp_ph_no

    Table6.Rows(0).Item("Mobile") = strtxtCust_cp_mobile_no

    Table6.Rows(0).Item("Email") = strtxtCust_cp_email_id

    Table6.Rows(0).Item("Remarks") = strtxtCust_cp_rmks

    Else

    Table6 = Session("CUST_Info")

    Dim i As Integer

    i = Table6.Rows.Count

    Table6.Rows.Add(i)

    Table6.Rows(i).Item("Delete") = "Delete.png"

    Table6.Rows(i).Item("Modify") = "Modify.png"

    Table6.Rows(i).Item("CODE") = strtxtCust_cp_code

    Table6.Rows(i).Item("Name") = strtxtCust_cp_name

    Table6.Rows(i).Item("Designation") = strtxtCust_cp_desig

    Table6.Rows(i).Item("Phone") = strtxtcust_cp_ph_no

    Table6.Rows(i).Item("Mobile") = strtxtCust_cp_mobile_no

    Table6.Rows(i).Item("Email") = strtxtCust_cp_email_id

    Table6.Rows(i).Item("Remarks") = strtxtCust_cp_rmks

    End If

    Session("CUST_Info") = Table6Catch ex As Exception

    MsgBox(ex.ToString)

    End Try

    MsgBox("filltable/webservices over")

    End Sub

    Much Obliged & Thanks a Lot,
    Myself
  • Re: problem in using the webservice.htc file to call webservice method

    07-09-2008, 1:42 AM
    Answer
    • Member
      607 point Member
    • Sidewinder2
    • Member since 06-24-2008, 7:46 AM
    • Chennai (Incredible INDIA)
    • Posts 459

    Hello There!,

       Actually My code was correct .Mistakenly i ran some other application instead of this application.

     

     

    Much Obliged & Thanks a Lot,
    Myself
Page 1 of 1 (2 items)