on 04-06-2012 9:47 AM
Hi,
Lately I've been developing web service for SAP Portal. It supposed to return String[][], but instead it gives me a message:
An error has occurred. Maybe the request is not accepted by the server:
null (row:-1, col:-1)
See <a href="http://img809.imageshack.us/img809/4383/webservicenavigatorerro.jpg">print screen</a>
Full Response:
An error has occurred. Maybe the request is not accepted by the server:
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<SOAP-ENV:Body><rpl:businessMethodResponse xmlns:rpl='urn:DanielTestWSVi'><rpl:Response xmlns:pns='urn:java/lang'>
<pns:String>
<pns:String>OK1333700034238</pns:String>
<pns:String>x</pns:String>
<pns:String>x</pns:String>
<pns:String>x</pns:String>
</pns:String>
<pns:String>
<pns:String>prop1</pns:String>
<pns:String>1</pns:String>
<pns:String>1</pns:String>
<pns:String>1</pns:String>
</pns:String>
<pns:String>
<pns:String>prop3</pns:String>
<pns:String>abc</pns:String>
<pns:String>one</pns:String>
<pns:String>two</pns:String>
</pns:String>
<pns:String>
<pns:String>prop2</pns:String>
<pns:String>1</pns:String>
<pns:String>y</pns:String>
<pns:String>y</pns:String>
</pns:String>
</rpl:Response></rpl:businessMethodResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
XML structure looks just fine. (text formated for clarity)
Part of Java code that generates String[][] result:
(please notice comment)
String[][] result = new String[resultRows.size()][columnCount];
for (int r=0; r<resultRows.size(); r++) {
String[] tmp = (String[])resultRows.get(r);
for (int c=0; c<tmp.length; c++) {
if (tmp[c]!=null) {
result[r][c] = tmp[c]; // if instead of tmp[c] i put here null or String "whatever" - web service returns expected array
} else {
result[r][c] = "y";
}
}
Strange, isn't it? I would appriciate any help.
Hello everyone,
I got this: it turned out one of Strings in tmp[] was built like this:
tmp[c] = "blah" + myChar + "blah".
myChar was not initialized and that was the problem.
Topic closed.
Regards,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.