In short: Trying to write a wcf service for a winform-app that invokes a stored procedure on a webserver.
So far no problem – my service exposes the method “execStp(string nameOfStoredProcedure, stpParamList parameterList)”
[OperationContract]
int execStp(string stpName, srsWcfLib.Utilities.stpParamList paramList);
where stpParamList is another class holding of a third class stpParams (which basically holds a name/value pair of an SqlParameter
To add parameters to the list, I wrote a method in the second class
public void addParameter(string ParamName, object ParamValue)
{
this._Parameters.Add(new stpParam(ParamName, ParamValue));
}
List<stpParam> _Parameters = new List<stpParam>();
[DataMember]
public List<stpParam> Parameters
{
get { return _Parameters; }
set { _Parameters = value; }
}
When instantiating the List-class in the win-app
stpParamList stpParams = new stpParamList();
I can access stpParams.Parameters, but NOT stpParams.addParameter (name, value);
What am I missing (obviously)…?
Thank you,
Reinhard
WCF only brings over the properties to the client, not the functions. I forget the term they use, but it is basically just a property/field dump that gets sent through.
To solve this, reference the same Entity library in the client, and under “configure WCF Service” check “reuse reference” for that library.