Click here to Skip to main content
15,072,348 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
Type = "GET";
            // Url = "http://localhost:12344/SecondaryToPrimaryRESTful.svc/JSON/GetClientDetailFromPrimary/" + $("#txtTokenNumber").val() + "/" + $("#txtMobileNo").val();
             //Url = "http://localhost:12344/SecondaryToPrimaryRESTful.svc/JSON/GetClientDetailFromPrimary/MobileID/09898345474";
            Url = "http://localhost:12344/SecondaryToPrimaryRESTful.svc/JSON/GetClientDetailFromPrimary";
            //  Data = '{"tokenid": "' + TokenID + '","MobileNo":"' + MobileNo + '"}';
            //  Data = '{"MobileNo":"' + MobileNo + '"}';
            var Data = { "GetClientDetailFromPrimary": { "tokenid": "" + TokenID + "", "MobileNo": "" + MobileNo + ""} };
            Data = JSON.stringify(Data);

            ContentType = "application/json; charset=utf-8";
            DataType = "json";
            ProcessData = true;
            CallService();


[WebInvoke(Method = "GET", RequestFormat =WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json, UriTemplate = "/GetClientDetailFromPrimary/{tokenid}/{MobileNo}", BodyStyle = WebMessageBodyStyle.WrappedRequest)]
public Stream GetClientDetailFromPrimary(string tokenid, string MobileNo)
{

WebClient proxy = new WebClient();
byte[] abc = proxy.DownloadData((new Uri("http://localhost:12346/PrimaryRestfulToDb.svc/JSON/GetClientData" + "/" + MobileNo)));
Stream strm = new MemoryStream(abc);
//DataContractSerializer obj = new DataContractSerializer(typeof(string));
//string result = obj.ReadObject(strm).ToString();
return strm;
}
Posted

1 solution

   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900