Skip to main content
 
developerWorks
AIX and UNIX
Information Mgmt
Lotus
New to Lotus
Products
How to buy
Downloads
Live demos
Technical library
Training
Support
Forums & community
Events
Rational
Tivoli
WebSphere
Java™ technology
Linux
Open source
SOA and Web services
Web development
XML
My developerWorks
About dW
Submit content
Feedback



developerWorks  >  Lotus  >  Forums & community  >  Lotus Quickr Forum

Lotus Quickr Forum

developerWorks

  

Sign in to participate PreviousPrevious NextNext


Samuel Thiriot 28.Oct.11 01:42 PM a Web browser
Application development 8.5 (WebSphere Portal) Linux


Hi,

I'm using the REST API for querying a Quickr for Websphere. After many attempts, I still obtain the famous 415 (Unsupported media type) error when executing the POST query.

I use "Content-Type = quickr/query+xml" as an header for the query, but this does not solves the problem. I also tried various combinations for Accept-encoding, Accept-Charset, with or without cookies, etc. Tested Abdera and HttpQuery, same effect.

I wonder if the problem couldn't be a malformed XML instead of a content-type problem ?

Any help welcomed, I've no more ideas for solving this problem :-/ Thanks !


Here is the code using HttpQuery (the query comes from example code).

HttpClient httpClient = new HttpClient();
httpClient.getState().setCredentials(
new AuthScope(getParamServerHost(), getParamServerPort(), AuthScope.ANY_REALM),
new UsernamePasswordCredentials(
"username",
"pwd"
)
);
httpClient.getParams().setAuthenticationPreemptive(true);
PostMethod postMethod = new PostMethod("http://myserver:10040");
postMethod.setPath("/dm/atom/query/feed");
postMethod.setRequestHeader("Content-Type", "quickr/query+xml");
postMethod.setRequestBody("<?xml version=\"1.0\" encoding=\"UTF-8\"?><qkr:query xmlns:qkr=\"http://query.quickr.content.ibm.com/1.0\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"><qkr:predicate conditionalOperator=\"and\" /><qkr:condition dataOperator=\"equal\" caseInsensitive=\"false\"><qkr:leftAttribute multivalue=\"true\" attributeName=\"creator\" /><qkr:rightValue value=\"uid=wpsadmin,o=default organization\" dataType=\"person:dn\" /></qkr:condition></qkr:query>");

try {
int res = httpClient.executeMethod(postMethod);
System.err.println("!!! result: "+res);
// returns 415
} catch (HttpException e) { e.printStackTrace();
} catch (IOException e) {e.printStackTrace();
}


Here are the detailed logs from HttpQuery:
16975 DEBUG [org.apache.commons.httpclient.params.DefaultHttpParams] - Set parameter http.authentication.preemptive = true
16976 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] - Preemptively sending default basic credentials
16976 DEBUG [org.apache.commons.httpclient.HttpMethodDirector] - Authenticating with BASIC <any realm>@myserver:10040
16976 DEBUG [org.apache.commons.httpclient.params.HttpMethodParams] - Credential charset not configured, using HTTP element charset
16976 DEBUG [org.apache.commons.httpclient.HttpConnection] - Open connection to myserver:10040
16977 DEBUG [httpclient.wire.header] - >> "POST /dm/atom/query/feed HTTP/1.1[\r][\n]"
16977 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - Adding Host request header
16979 DEBUG [httpclient.wire.header] - >> "Content-Type: quickr/query+xml[\r][\n]"
16979 DEBUG [httpclient.wire.header] - >> "Authorization: Basic YWRtaW5pc3RyYXRvcjphZG1pbg==[\r][\n]"
16979 DEBUG [httpclient.wire.header] - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
16979 DEBUG [httpclient.wire.header] - >> "Host: myserver:10040[\r][\n]"
16979 DEBUG [httpclient.wire.header] - >> "Transfer-Encoding: chunked[\r][\n]"
16979 DEBUG [httpclient.wire.header] - >> "[\r][\n]"
16980 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - Default charset used: ISO-8859-1
16982 DEBUG [httpclient.wire.content] - >> "1b0[\r][\n]"
16982 DEBUG [httpclient.wire.content] - >> "<?xml version="1.0" encoding="UTF-8"?><qkr:query xmlns:qkr="http://query.quickr.content.ibm.com/1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><qkr:predicate conditionalOperator="and" /><qkr:condition dataOperator="equal" caseInsensitive="false"><qkr:leftAttribute multivalue="true" attributeName="creator" /><qkr:rightValue value="uid=wpsadmin,o=default organization" dataType="person:dn" /></qkr:condition></qkr:query>"
16982 DEBUG [httpclient.wire.content] - >> "[\r][\n]"
16982 DEBUG [httpclient.wire.content] - >> "0"
16982 DEBUG [httpclient.wire.content] - >> "[\r][\n]"
16982 DEBUG [httpclient.wire.content] - >> "[\r][\n]"
16982 DEBUG [org.apache.commons.httpclient.methods.EntityEnclosingMethod] - Request body sent
16983 DEBUG [httpclient.wire.header] - << "HTTP/1.1 415 Unsupported Media Type[\r][\n]"
16984 DEBUG [httpclient.wire.header] - << "HTTP/1.1 415 Unsupported Media Type[\r][\n]"
16984 DEBUG [httpclient.wire.header] - << "Content-Type: application/xml; charset=UTF-8[\r][\n]"
16984 DEBUG [httpclient.wire.header] - << "Server: Teamspace Documents 8.5[\r][\n]"
16984 DEBUG [httpclient.wire.header] - << "Content-Language: en-US[\r][\n]"
16985 DEBUG [httpclient.wire.header] - << "Set-Cookie: LtpaToken2=YJwj9GUYgmPjV2972W/LaLXR1HUB6u/fJohqGbR4RCCGNKR5Czac91/tqtrEzcOr5aj9d0+GmsF+iFv4qrXFqT0LGo1JXesxrzM9PyR325sX2+Xtb16LerxY6q8KcfecKMzQiLkz7PBxkNkrdJ56RG04VvramPpbiGriodSfjuEIEFSb/tGG8ka6osNKPqH3K3N4jxrMGA+dG2jYyoCl0LH1vDBNr29ysxontP4BgarvHnbIKMwj6/70jaSF92Dv/3MBCSyd5PouOTyVlv5ebKap7KCYjv3a/mAb/9+R5TYlFXDr8WhwuTIFoxgbooztiqFL/skgpA+xbdkqB/92DggPYuSwzw102rpNhUJ1y3jtHLdYWhszyl6uTGXkSzK8KrE3J41CcUz5lJ4a1cHVXWvmxBKVT8JRw1HsJGoi+aQ7NyBb0CNQMtXtbX4Pn5jnCAPQOKcyAPArX4ZCmPHPb9d3sfNcB9VCcQE8WP8vyRvscbKk91hfOWxZLTVU4JR5Hm6R/F8FqkHjKX24ezhg7+RjEbKcwgnVosUlCIqqQTJRMj2BD5fsyeuMPrpiA/xlJDEzaj66TkVCcjGLjnJJUnDmfzYPwkVQknl3glMqqVBDTbCVNL87vEZlZVRoBOO95giD1kPFQs9pPnzncQRTdtBxtYOlwbt23P20T+CJsdoGSE3Ynh/sEm42IkLzVS0RYAXmoGKgFQFWPAkk7+3YWA==; Path=/[\r][\n]"
16985 DEBUG [httpclient.wire.header] - << "Set-Cookie: LtpaToken=ASdIeFxbEUEOYTUD3ZK5GvmCWGSh+x63xP5z84d5V5OHGgdeT7RxzUFpu1dl6vvSyZS0u7FwS5aKbC4xOKPUsqXiuiYgRXiEfVuP+tqR9SslTfjrlHl8vVulCJkdnEr1SUGECE5nu6WShVTIVrl0d0ixR9xXYNLlRsKUDnS6t9qgPUQ0eoiBdlXlV7/Zwq4UT8IR5QO6XweKloB+cWw3w6RH2tO0QHE6UVKP//+uxEjfWgduVvUqvUIAGs+BKvYDccn9+B5xbHvOTjKKnzjf4D1VIBDOK5VewINmxLdYvMGKJ+ybRHECIHt8xkDmUE8TBVkE46p9B9hwoei+w0R/ACX71x2JltxZtQnNMzni6Ec=; Path=/[\r][\n]"
16986 DEBUG [httpclient.wire.header] - << "Set-Cookie: JSESSIONID=0000KKkDuh50urgtFfBLWgh7UqG:-1; Path=/[\r][\n]"
16986 DEBUG [httpclient.wire.header] - << "Transfer-Encoding: chunked[\r][\n]"
16986 DEBUG [httpclient.wire.header] - << "Connection: Close[\r][\n]"
16986 DEBUG [httpclient.wire.header] - << "Date: Fri, 28 Oct 2011 17:23:55 GMT[\r][\n]"
16986 DEBUG [httpclient.wire.header] - << "[\r][\n]"
16987 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - Cookie accepted: "$Version=0; LtpaToken2=YJwj9GUYgmPjV2972W/LaLXR1HUB6u/fJohqGbR4RCCGNKR5Czac91/tqtrEzcOr5aj9d0+GmsF+iFv4qrXFqT0LGo1JXesxrzM9PyR325sX2+Xtb16LerxY6q8KcfecKMzQiLkz7PBxkNkrdJ56RG04VvramPpbiGriodSfjuEIEFSb/tGG8ka6osNKPqH3K3N4jxrMGA+dG2jYyoCl0LH1vDBNr29ysxontP4BgarvHnbIKMwj6/70jaSF92Dv/3MBCSyd5PouOTyVlv5ebKap7KCYjv3a/mAb/9+R5TYlFXDr8WhwuTIFoxgbooztiqFL/skgpA+xbdkqB/92DggPYuSwzw102rpNhUJ1y3jtHLdYWhszyl6uTGXkSzK8KrE3J41CcUz5lJ4a1cHVXWvmxBKVT8JRw1HsJGoi+aQ7NyBb0CNQMtXtbX4Pn5jnCAPQOKcyAPArX4ZCmPHPb9d3sfNcB9VCcQE8WP8vyRvscbKk91hfOWxZLTVU4JR5Hm6R/F8FqkHjKX24ezhg7+RjEbKcwgnVosUlCIqqQTJRMj2BD5fsyeuMPrpiA/xlJDEzaj66TkVCcjGLjnJJUnDmfzYPwkVQknl3glMqqVBDTbCVNL87vEZlZVRoBOO95giD1kPFQs9pPnzncQRTdtBxtYOlwbt23P20T+CJsdoGSE3Ynh/sEm42IkLzVS0RYAXmoGKgFQFWPAkk7+3YWA==; $Path=/"
16987 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - Cookie accepted: "$Version=0; LtpaToken=ASdIeFxbEUEOYTUD3ZK5GvmCWGSh+x63xP5z84d5V5OHGgdeT7RxzUFpu1dl6vvSyZS0u7FwS5aKbC4xOKPUsqXiuiYgRXiEfVuP+tqR9SslTfjrlHl8vVulCJkdnEr1SUGECE5nu6WShVTIVrl0d0ixR9xXYNLlRsKUDnS6t9qgPUQ0eoiBdlXlV7/Zwq4UT8IR5QO6XweKloB+cWw3w6RH2tO0QHE6UVKP//+uxEjfWgduVvUqvUIAGs+BKvYDccn9+B5xbHvOTjKKnzjf4D1VIBDOK5VewINmxLdYvMGKJ+ybRHECIHt8xkDmUE8TBVkE46p9B9hwoei+w0R/ACX71x2JltxZtQnNMzni6Ec=; $Path=/"
16988 DEBUG [org.apache.commons.httpclient.HttpMethodBase] - Cookie accepted: "$Version=0; JSESSIONID=0000KKkDuh50urgtFfBLWgh7UqG:-1; $Path=/"
!!! result: 415






415 error using the REST Query API (Samuel Thiriot 28.Oct.11)
. . RE: 415 error using the REST Query ... (Samuel Thiriot 31.Oct.11)
. . . . RE: 415 error using the REST Query ... (Samuel Thiriot 31.Oct.11)





  Document options
Print this pagePrint this page

 Search this forum

  Forum views and search
Date (threaded)
Date (flat)
With excerpt
Author
Category
Platform
Release
Advanced search

 Sign In or Register
Sign in
Forgot your password?
Forgot your user name?
Create new registration

 RSS feedsRSS
All forum posts RSS
All main topics RSS
More Lotus RSS feeds

Resources

 Resources
Forum use and etiquette
Native Notes Access
Web site Feedback

Lotus Support

 Lotus Support
IBM Support Portal - Lotus software
Lotus Support documents
Lotus support by product
Lotus support downloads
Lotus support RSS feeds

Wikis

 Wikis
IBM Composite Applications
IBM Mashup Center
IBM Connections
IBM Docs
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud for Social Business
IBM Web Experience Factory
Lotus Domino
Lotus Domino Designer
Lotus Expeditor
Lotus Foundations
Lotus iNotes
Lotus Instructor Community Courseware
Lotus Notes
Lotus Notes & Domino Application Development
Lotus Notes Traveler
Lotus Protector
Lotus Quickr
Lotus Symphony
IBM Web Content Manager
WebSphere Portal

Lotus Forums


 Lotus Forums
Notes/Domino 9.0
Notes/Domino 8.5 + Traveler
Notes/Domino XPages development forum
Notes/Domino 8
Notes/Domino 6 and 7
Notes/Domino 4 and 5
IBM Connections
IBM Forms
IBM Mobile Connect
IBM Sametime
IBM SmartCloud Notes
IBM Web Content Manager
Lotus Domino Document Manager
Lotus Enterprise Integration
Lotus Expeditor
Lotus Protector
Lotus Quickr
Lotus SmartSuite
Lotus Symphony
Lotus Symphony Developer Toolkit Support
Lotus Workflow