web exception error

Discussion in 'ASP .Net Web Services' started by Nab, Sep 18, 2006.

  1. Nab

    Nab Guest

    I have a web service connected to a sql server 2005 express. The service has
    a web method and information is extracted from the database through a stored
    procedure that has two parameter:input and output. So for example some one
    could supply a stock brokers name and in turn one gets the stock broker's
    charging commission. Here's the code for that (connection established through
    the gui):

    <WebMethod()> _
    Public Sub GetFee(ByVal brokerName As String, ByRef brokerFee As Single)

    Dim cmd As New SqlCommand("GetDealingFee", sqlConn)
    cmd.CommandType = CommandType.StoredProcedure
    cmd.Parameters.Add("@BName", SqlDbType.VarChar, 50)
    cmd.Parameters("@BName").Direction = ParameterDirection.Input
    cmd.Parameters("@BName").Value = brokerName
    cmd.Parameters.Add("@Fee", SqlDbType.Real)
    cmd.Parameters("@Fee").Direction = ParameterDirection.Output
    If cmd.Connection.State <> ConnectionState.Open Then
    cmd.Connection.Open()
    End If
    cmd.ExecuteNonQuery()
    brokerFee = cmd.Parameters("@Fee").Value
    cmd.Connection.Close()

    When I consume the service by a pocket pc (through activesync) i get a
    system.net.webexception erro and this is stack trace:


    at System.Web.Services.Protocols.SoapHttpClientProtocol.doInvoke()
    at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke()
    at DeviceApplication_Stockbrokers.localhost.Service.GetFee()
    at DeviceApplication_Stockbrokers.Form1.Button1_Click()
    at System.Windows.Forms.Control.OnClick()
    at System.Windows.Forms.Button.OnClick()
    at System.Windows.Forms.ButtonBase.WnProc()
    at System.Windows.Forms.Control._InternalWnProc()
    at Microsoft.AGL.Forms.EVL.EnterMainLoop()
    at System.Windows.Forms.Application.Run()
    at DeviceApplication_Stockbrokers.Form1.Main()


    At this stage my knowledge is limited and any help of what's happening and
    how to fix this error will be appreciated.

    I use win2003 server and Visual Studio 2005 Prof (using VB) and published
    the web service to a local IIS.

    Thanks.



    --
    UK
     
    Nab, Sep 18, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jeff
    Replies:
    0
    Views:
    1,535
  2. jeff
    Replies:
    3
    Views:
    1,691
    Scott
    Jun 26, 2003
  3. Kerri
    Replies:
    2
    Views:
    13,035
    Kevin Spencer
    Oct 27, 2003
  4. jobs
    Replies:
    1
    Views:
    1,896
    Scott Roberts
    Nov 16, 2007
  5. friend
    Replies:
    1
    Views:
    211
    Thomas 'PointedEars' Lahn
    May 12, 2008
Loading...

Share This Page