Click here to Skip to main content
15,884,948 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
Hi,

I am trying to extract the data from server . As per API Documents

To fetch new regions, use “GetRegionCodesVR1”.
This is used to request the full list of region codes on the server. To request, post the text “GetRegionCodesVR1”. No XML is needed to request.

I tried using below below method
C#
XMLRequest="";
WebServiceURL =http://torix2test.entertainme.co.uk/
  public string fnSendandReceiveXML(string XMLRequest, string WebServiceURL)
        {
            string rawResponse = "";
            try
            {
                WebRequest req = null;
                WebResponse rsp = null;
                StringBuilder strRequest = new StringBuilder();
                req = WebRequest.Create(WebServiceURL);
                req.Method = "POST";
                req.ContentType = "text/xml";
                StreamWriter writer = new
                StreamWriter(req.GetRequestStream());
                writer.WriteLine(XMLRequest);
                writer.Close();
                rsp = req.GetResponse();
                var sr = new StreamReader(rsp.GetResponseStream());
                string responseText = sr.ReadToEnd();
                return responseText;

            }
            catch (Exception ex)
            {
                string strerr = ex.Message;
                return strerr;
            }
            return rawResponse;
        }

How to pass the value without XML, can any one advise me

Yours

Sheethal
Posted
Updated 9-Feb-15 11:03am
v2
Comments
Sergey Alexandrovich Kryukov 9-Feb-15 17:49pm    
"No XML is needed to request", req.ContentType = "text/xml"; in your code and the question title contradict, so the question makes little sense.
It all depends on real server behavior.
—SA

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