![]() |
Error when consuming a web service
Using a Windows client to consume a web service throws this error:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.NullReferenceException.....etc I'm using Visual Studio 2008 and my VB code for the WS (which is connected to a SQL Server 2005 Express) is: <WebMethod()> _ Public Sub GetFee(ByVal brokerName As String, ByRef brokerFee As Single) Dim strSQL As String strSQL = "SELECT @Fee = dbo.OnlineBrokers.TransactionFee FROM dbo.OnlineBrokers WHERE dbo.OnlineBrokers.Name = @BName" Dim cmd As New SqlCommand(strSQL, sqlConn) 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() Any hint as to how to resolve this issue? Is this a permission issue? If so, how can I resolve it? Thanks for any suggestions. |
Re: Error when consuming a web service
Did you look up any of these exceptions in the MSDN Library to see what they
mean? Do that, then get back to us here. -- John Saunders | MVP - Connected System Developer |
Re: Error when consuming a web service
I have fixed this problem. Sending an empty output paramter (argument) to a
called procedure generated that error. The problem was fixed when I turned the procedure into a fucntion that receives just one argument. This problem thought did not arise when I used VB2005!! I don't know why. -- UK "John Saunders" wrote: > Did you look up any of these exceptions in the MSDN Library to see what they > mean? Do that, then get back to us here. > > -- > John Saunders | MVP - Connected System Developer > > |
| All times are GMT. The time now is 01:44 AM. |
Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.