在浏览器的 url 中输入什么来将对象传递给网络服务

What to type in browser's url to pass an object to webservice

有没有一种方法可以在浏览器中输入 url,使其也具有所需的对象作为 wcf 网络服务的参数?用简单的话来说。我有一个接收对象的网络服务操作合同。我应该在浏览器中输入什么 url 来调用该函数?谢谢!

I've a webservice's operation contract which receives an object. What url should I type in browser to call that function?

不,这是错误的做法;相反,让您的操作接受该对象作为参数并在调用它时传递它

[OperationContract]
public void Operation1(Student stu) { ... };

通话中

Student stu = new Student();
wcfproxy.Operation1(stu);

这个post可能会有帮助

Passing complex objects into a WCF Rest Service