I have a web service that works exactly as expected when on the host machine, invoked in a web browser. When I try to consume it from my client application, it fails, and fails oddly.
When the service gets called from the application, I get a SQL Exception that for the parameterized query I don't provide a value for the parameter '@SITE'. In the code I clearly set this parameter. When I consume the service from my client I always provide a default value, so I know that a value is provided. When I run it from a web browser I type in the two parameters & they clearly are accepted and processed correctly.
Any insight would be greatly appreciated.
The first few lines of the web service are:
public System.Xml.XmlDocument To_PDA_ProductCategories(string Group, string Site )
AppSettingsReader ASR = new AppSettingsReader();
string connstr = ASR.GetValue("UrWayConnectionString", typeof(string)).ToString();
conn = new SqlConnection( connstr );
string sql = "Select * from Major_Category where Major_Category > 0 ";
" and [Group] = @GRP and Site = @SITE ";
" order by Major_Category";
SqlCommand cmd = new SqlCommand( sql, conn );
Hello Phil. Well obviously (assuming they are both on the same server/application that your application is passing null as Site. I would probably start off by debugging your client application and see what value is being passed. If that fails I would debug your web service either with a debugger or with a logging/tracing mechanism and see waht is actually being passed.
Thursday, June 08, 2006 7:38 PM
Microsoft is conducting an online survey to understand your opinion of the Msdn Web site. If you choose to participate, the online survey will be presented to you when you leave the Msdn Web site.