WebSphere brand IBM WebSphere XML Document Management Server, Version 7.0

Searching documents

Use the xcap_post.sh request to search documents from the command line interface.

Before you begin
Before using the XDMS client and XCAP requests, make sure that you:
About this task

As defined in the OMA XDM v2.0 specification, IBM XDMS supports the ability to search within stored documents using XQuery. To perform an XQuery search, the client sends a search document to an OMA XDM v2.0 capable search proxy or directly to IBM XDMS by means of an HTTP POST.

Before performing the search, IBM XDMS extracts the AUID from the search document. If the AUID is supported, it verifies if the XQuery in the search document matches XQuery templates defined by the application usage. If the XQuery matches a defined template, the search is then performed.

It is important to note that URIs used for XCAP and XQuery differ. XQuery URIs have the following form:

XCAP Root/org.openmobilealliance.search

XCAP Root: identifies the HTTP request host, port, and context root.
 http://myhost.ibm.com:9080/services/
Create or edit an XDM document of your choice, or use one of the documents located in the was_root/installableApps/xdms/client/ directory.
Note: was_root is the installation root directory for WebSphere® Application Server Network Deployment. By default, this directory is:
  • AIX /usr/IBM/WebSphere/AppServer
  • Linux /opt/IBM/WebSphere/AppServer
  1. Reach the command client by typing the following from the command line:cd was_root/installableApps/xdms/client/
  2. Type the XCAP Post request.
    ./xcap_post.sh -user user_id -password password -filename file_name -content_type mime-type XCAP_URI
    For example, to post the sample TestSearchResourceList.xml to the XDMS server for example.com, type the following parameters on a single line.
    Note: In order for this sample to work, insert the TestResourceList.xml file by following the steps in the topic Adding and editing documents.
    ./xcap_post.sh -user admin -password adminpassword -filename samples/TestSearchResourceList.xml -content_type application/vnd.oma.search+xml -verbose http://example.com:9080/services/org.openmobilealliance.search
  3. Press Enter to send the request. The TestSearchResourceList.xml search file is sent as an HTTP Post to IBM XDMS. The search results are then returned to the XDMS client.



Terms of use
(C) Copyright IBM Corporation 2009. All Rights Reserved.