cancel
Showing results for 
Search instead for 
Did you mean: 

Not able to refresh the report with Parameters.

0 Kudos

I am not able to refresh the report with simple parameters. Error message is "The Remote Server returned error : (400) Bad Request.

If I mention Request type "POST" then I get this error "The Remote Server returned error: (405) Method not Allowed.

Below is my code snippet. Please help me.

Accepted Solutions (1)

Accepted Solutions (1)

eric_festinger
Contributor
0 Kudos

hello

Can you please cut/paste:

  1. the error message returned by the server, not only the HTTP return code
  2. the output of the "GET .../documents/5864/parameters" call

?

Regards,

eric

0 Kudos

the only error message I get is this

"The Remote Server returned error : (400) Bad Request for "PUT" request

"The Remote Server returned error:  (405) Method not Allowed for "POST" request

daniel_paulsen
Active Contributor
0 Kudos

Hi Sivaraman,

POST is not a valid method for refreshing parameters, which explains the second error above.  Use PUT to refresh the parameters.

To enable a full stack trace, as Eric requested, you can enable this in the properties of the Web Application Container Server in the CMS.  Select the checkbox for: "Show Error Stack", restart the server and a full error message will be returned rather than a simple HTTP error.

The first error: "Bad Request" suggest a problem with the XML that you are sending to the server.  Rather than escaping the double quotes for the parameter attributes, try using single quotes in that string:

         string promptxml = "<parameters><parameter type='prompt'><id>0</id><answer type='text'><values>....</parameters>";

Additionally, when converting the xml to an array of bytes, specify the encoding as UTF8 and pass in your string

         byte[] dataByte = System.Text.Encoding.UTF8.GetBytes(promptxml);

I believe this should fix it up.  If not, get the full error stack as Eric mentioned,

Dan

0 Kudos

Hi Dan,

I tried passing single quote and didn't help. Also enabled "Show Error Stack" option and didn't get full error message.

Can you please let me know where can I check the error log? Any other suggestion regarding the issue will be very helpful.

Thanks,

Sivaraman

eric_festinger
Contributor
0 Kudos

[ edited message as I didn't see your previous answer... oops ]

hi Sivaraman,

You need to read the response stream when the server returns a HTTP code different from 200 OK. See for example:

http://stackoverflow.com/questions/692342/net-httpwebrequest-getresponse-raises-exception-when-http-...

Regards,

eric

former_member197386
Active Contributor
0 Kudos

Hi Sivaraman,

Is it working now?

Regards,

Anthony

0 Kudos

Hi Anthony,

Thanks for the follow-up. Unfortunately I was not able to find any solutions

Below is the error message I get as web exception. I really appreciate your help on this request.

Code:

GET PARAM:

Web Error Message

daniel_paulsen
Active Contributor
0 Kudos

Hi Sivaraman,

The code image is not readable.  Can you paste it as text?

Dan

0 Kudos
daniel_paulsen
Active Contributor
0 Kudos

Thanks,

I'm having a difficult time piecing it together.

Your code screenshot is code for creating a new document in a specific folder.  The issue I see here is that you use a PUT instead of a POST.

The parameter screenshot appears to be correct XML but I'm not sure this is what is causing your problem as its not related to the source code you posted.

The Error screenshot suggests you are passing XML with a lower case "text" attribute rather than a case sensitive "Text" attribute, but the Parameter XML posted looks fine.

Can you point to the exact line of code throwing the exception as well as any XML body being sent when the error occurs?

Dan

0 Kudos

I am sorry about that, It is my mistake. Below is the right Code. As per your suggestion I changed the "text" to "Text" solved the issue. I really appreciate your help.

Answers (0)