I am new to WCF. My question is how to pass a long JSON( here I am converting a data table into JSON string) string as parameter for WCF method?
Here is my code:
[OperationContract] [WebInvoke(Method = "GET",ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.WrappedRequest, UriTemplate = "initiateConnection/{jsonData}/{sessionId}")]
void testMethod(string jsonData, string sessionId);
public void testMethod(string jsonData, String sessionId) { }
When I call the testMethod
with jsonData
string which very long, it is showing
Invalid URI: The Uri string is too long
So in this case should I pass the JSON result using POST method? If yes then how to pass it?