2016-07-26 91 views

回答

0

string SAP_ODATA_URL = @「http://ApplicationURL」; string SAP_ODATA_QUERY =「MethodName?$ filter = Parameter eq'」+ extensionAttribute13 +「'」; string requestUrl = SAP_ODATA_URL + SAP_ODATA_QUERY; WebRequest請求= WebRequest.Create(requestUrl); request.Method = WebRequestMethods.Http.Get; request.ContentType =「application/json; charset = utf-8」; request.Credentials = new NetworkCredential(「XXX」,「XXX」); WebResponse response = request.GetResponse(); (((HttpWebResponse)響應).StatusCode == HttpStatusCode.OK) { Stream receiveStream = response.GetResponseStream(); StreamReader reader = new StreamReader(receiveStream); string responseFromServer = reader.ReadToEnd(); XmlTextReader xmlReader = new XmlTextReader(new StringReader(responseFromServer)); xmlReader.Read(); DataSet ds = new DataSet(); ds.ReadXml(xmlReader,XmlReadMode.Auto); }