How do I pass multiple parameters to a WCF Restful service from a c# client? -


i have wcf restful service call expects multiple parameters.

consider following data , service contracts.

public class classa {    public string astring{ get; set;}    public int aint {get; set;} }  public class classb {    public string bstring{ get; set;}    public int bint {get; set;} }  [servicecontract] public interface isampleservice {    [operationcontract(isoneway = false)]    classc getsomedata(classa classa, string svalue, classb classb); } 

i have c#/winform based test application. know these parameters need wrapped before calling service. i'm having difficulty figuring out c# code call service on client side.

can show me example of how structure code on client side call above defined service?

thanks, jb

you should able call service normal method after setting endpoint isampleservice.

var result = isampleservice.getsomedata(     new { astring = "a string" },      "somevalue",      new b() ); 

wcf magic transform remote procedure call. make sure parameters want pass serializable.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -