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. Advertisements

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. manish
    Replies:
    1
    Views:
    2,147
    Christopher Benson-Manica
    Apr 2, 2004
  2. Replies:
    0
    Views:
    518
  3. =?Utf-8?B?RWNobw==?=
    Replies:
    0
    Views:
    537
    =?Utf-8?B?RWNobw==?=
    Oct 24, 2006
  4. Tony Johansson
    Replies:
    0
    Views:
    576
    Tony Johansson
    Aug 13, 2005
  5. jobs
    Replies:
    1
    Views:
    2,078
    Scott Roberts
    Nov 16, 2007
  6. Bill Youngman
    Replies:
    1
    Views:
    356
    Bill Youngman
    Oct 11, 2005
  7. friend
    Replies:
    1
    Views:
    352
    Thomas 'PointedEars' Lahn
    May 12, 2008
  8. johannes falcone
    Replies:
    2
    Views:
    212
    Kevin Walzer
    Feb 1, 2014
Loading...