on 01-27-2015 6:56 AM
Hello,
we are trying to refresh a document (set prompts) that contains a date sapVariable but get back a "(400) Bad Request.":
In the document are two parameters (one datetime and one LOV) - the datetime parameter is causing the "Bad Request" behavior.
The WebI is a 4.1SP2 system.
response to/biprws/raylight/v1/documents/.../parameters (GET):
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<parameters>
<parameter dpId="DP4" type="sapVariable" optional="false">
<id>0</id>
<technicalName>ZBXKDT</technicalName>
<name>Key Due Date</name>
<answer type="Date" constrained="false">
<info cardinality="Single">
<previous><value>2015-01-20T01:00:00.000+01:00</value></previous>
</info>
<values>
<value>2015-01-20T01:00:00.000+01:00</value>
</values>
</answer>
</parameter>
- <parameter dpId="DP4" type="sapVariable" optional="false">
... other parameter that works
</parameter>
</parameters>
I try to set the parameter with the following XML. the type="sapVariable" is not documented in the REST API docs, I tried it without type but it did not work either.
<parameters>
<parameter optional="false" type="sapVariable">
<id>0</id>
<answer type="DateTime"><values><value id="1">2015-01-20T01:00:00.000+01:00</value></values></answer>
</parameter>
<parameter optional="false" type="sapVariable">
<id>1</id>
<answer type="Text"><values><value id="1">M Bags Steti</value></values></answer>
</parameter>
</parameters>
I can't see any error in my request nevertheless i do get the "Bad Request" response.
Has anybody an idea what i could change to get that working?
Best regards,
Rainer
hello Rainer,
Answering with the following XML:
<parameters>
<parameter>
<id>0</id>
<answer><values><value>2015-01-20T01:00:00.000+01:00</value></values></answer>
</parameter>
<parameter>
...
</parameters>
.. should be enough.
Please note that I removed the id from the given values (...<value id="1">2015-0...), as it seems from the GET answer that your values are not indexed.
However, as Saritha previously wrote, we'd need more information, like at least the error message from the answer, or even better, the stack trace (you may activate it, and the logs as well through CMC -> Servers -> Web Application Container Server -> properties).
Regards,
eric festinger
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
i tried it with the following value (as suggested):
<parameters><parameter><id>0</id><answer><values><value id="1">2015-01-20T01:00:00.000+01:00</value></values></answer></parameter><parameter><id>1</id><answer><values><value id="1">M Bags Steti</value></values></answer></parameter></parameters>
I get the same exception (I'm using C# as programming language)
System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.HttpWebRequest.GetResponse()
...
I try to get any server logfiles i can get - but since this a client production machine it might take a while to get the rights for that.
As additional info: The same C# code is used to update a lot of reports on a
daily basis - but it's the first time we try to update an report accessing BW and
containing a prompt thats an 'sapVariable' - which is also not specified
in the REST docs.
Thank you,
Rainer
My suggestion was to remove the id from the given values (...<value id="1">2015-0...)...
Meanwhile you try to get the rights to activate the log files and stack trace, can you copy/paste the textual error returned (not only the HTTP value).
Something like:
<error>
<error_code>
xxx
</error_code>
<message>xxx
</message>
</error>
Thanks,
eric festinger
Hello,
the response content is:
<error>
<error_code>102</error_code>
<message>Illegal argument (Invalid answers. System "FW3": "ERROR BRAIN (629): Specify a value for variable Company Code (Multiple Values)
MSGV1: Company Code (Multiple Values)
".)</message>
</error>
That seems to indicate that it is the other parameter that is not working. I will investigate that - and come back if I have any issues.
Thank for the help - the tip that even with an HTTP 400 error there is a content associated was very helpfull.
Best regards,
Rainer
Hello,
thanks for your effort - the tip with the error message in the response content was great.
It turned out that the problem was the other parameter (not the date parameter as i initially
thought). We submitted an invalid value there.
Now everything runs fine!
Thank you all for contributing to the solution.
Rainer
Yes... the "Company Code" 😉
Great you find it!
eric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Rainer,
Could you please share a few more details - error message, trace, etc which will be of help???
Thanks,
Saritha
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.