Quantcast
Channel: SCN : Popular Discussions - RESTful Web Services SDK
Viewing all articles
Browse latest Browse all 1088

C#: PUT to Save a Webi Doesn't Return

$
0
0

BO 4.1 SP4

VS 2010

 

I'm working on a utility that will change the universe in one or more data providers in a Webi report using the RESTful web services.  Here's the basic logic:

 

1.  Get the list of data providers in the webi  whose dataSourceId is the same as the SI_ID of the universe we're switching from.

2.  Using the list from step 1 and the SI_ID of the "to" universe, get the element mappings.  If there are any elements that are not successfully mapped, the report is not processed.

3.  For each report that is successfully mapped, do the following:

     a.  Purge the data providers.

     b.  Switch the universe.

     c.  Save the report.

 

Everything is working great up to step 3c - Save the report.  When I try to get the response from the HTTP PUT to save the report, it times out.  After this when I check the report that it was saving in BI Launchpad, it appears to have saved correctly - the universe has been switched in the new one even though a "success" message is never returned.

 

The URL that I'm going to to save the report is this:

 

http://<server>:6405/biprws/raylight/v1/documents/96436

 

And the code that I'm using is this:

 

private string putResponse(string url)
{
  clearErr();
  string result = string.Empty;
  HttpWebRequest putRequest = (HttpWebRequest)WebRequest.Create(url);
  putRequest.Method = "PUT";
  putRequest.Accept = "application/xml";
  putRequest.ContentType = "application/xml";
  putRequest.Headers.Add("X-SAP-LogonToken", RESTToken);

  HttpWebResponse wr = (HttpWebResponse)putRequest.GetResponse();  <--This is where it hangs and times out.

  if (wr.StatusCode == HttpStatusCode.OK)
  {
    result = "Success";
  }
  else
  {
    ErrMsg = "HTTP Status: " + wr.StatusCode.ToString() + "-" + wr.StatusDescription;
    result = ErrMsg;
  }
  return result;
}

 

NOTE:  This code DOES work successfully for the PUT to purge a data provider - it's just not working to save the report.

 

Does anyone have any thoughts?

 

Thanks!

 

-Dell


Viewing all articles
Browse latest Browse all 1088

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>