wcf service with params

你。 提交于 2019-12-25 00:47:04

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/7996956/wcf-service-with-params

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!