Kumar
Kumar

Reputation: 11359

wcf service with params

the contract def is

    [OperationContract]
    DataSet myfunc(string a, params object[] args);

but the proxy is generated like so by the add service ref wizard

    public System.Data.DataSet myfunc(string a, object[] args) {
        return base.Channel.GetDataSet(a, args);
    }

what gives ? both are .net 4.0 projects

I can change the proxy but the changes will be lost on update

Upvotes: 0

Views: 2383

Answers (1)

Tad Donaghe
Tad Donaghe

Reputation: 6588

Not sure what your question is, but I'm guessing you're seeing problems because of your use of params there.

WSDL doesn't deal with optional parameters like that.

Is that what you're getting at?

If that's the case, then your best bet may be to do what the proxy generated code is doing instead. Pass an array of objects (though you may run into trouble trying to pass just any old object since some won't be serializable or interoperable).

I'm not really sure what you're trying to do with the optional parameters though, so I can't tell you exactly what to do instead.

Upvotes: 1

Related Questions