Quantcast
Channel: Discussion Forum > Connect Data Services
Viewing all articles
Browse latest Browse all 2504

QueryObjects internal server error () (7 Comments)

$
0
0

Topic by Salvatore

Hello,

I'm trying to dump the list of ServiceProduct objects for all service products in the RightNow CX platform with SELECT ServiceProduct FROM ServiceProduct (as shown in the "ROQL object query" documentation), 
but the following code leads to an internal server error:

publicvoid DumpRNProducts()
        {
                    List<RNProduct2> RNproducts = newList<RNProduct2>();
                    ClientInfoHeader clientInfoHeader = newClientInfoHeader();
                    clientInfoHeader.AppID = "Test!";
 
                    ServiceProduct prod = newServiceProduct();
 
                    RNObject[] prodObj = newRNObject[] { prod };
 
                    try
                    {
                      QueryResultData[] queryResult = _rnclient.QueryObjects(clientInfoHeader, "select ServiceProduct from ServiceProduct", prodObj, 10000);
                      if (queryResult[0] != null&& queryResult[0].RNObjectsResult.Count() > 0)
                        {
                            foreach (RNObject p in queryResult[0].RNObjectsResult)
                            {
                                ServiceProduct product = (ServiceProduct)p;
                                RNproducts.Add(CreateProduct(product));
                            }
 
                            SerializeProducts(queryResult, RNproducts);
 
                        }
                    }
                    catch (Exception ex)
                    {
                        _errorMessage = ex.Message;
                    }
        }

 

Exception:

 

"The content type text/html; charset=UTF-8 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 389 bytes of the response were: '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\"\n\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n<html xmlns=\"http://www.w3.org/1999/xhtml\">\n<head>\n    <title>There is a an error with your request</title>\n    <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\" />\n</head>\n\n<body>\n  <p>There has been an error with your request.</p>\n</body>\n</html>\n\n'."

 

{System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
   at System.Net.HttpWebRequest.GetResponse()
   at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout)}

 

Is this an expected behavior?

 

Thanks,

Salvatore

 

 


Viewing all articles
Browse latest Browse all 2504

Trending Articles