Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-34256

Remote API Search for Word Document that contains a Field Generates IllegalArgumentException

    XMLWordPrintable

Details

    Description

      Steps to Reproduce

      1. Create a Word Document that contains a CREATEDATE field, using this guide: http://wordribbon.tips.net/T009299_Inserting_the_Document_Creation_Date.html
        The document must look like this:
        <text-to-search>
        
        <CREATEDATEFIELD>
        

        OR

        <CREATEDATEFIELD>
        
        <text-to-search>
        

        Where <text-to-search> is the text that you will search in the RemoteAPI search call, and <CREATEDATEFIELD> is the field that you insert using this guide. Checkout the attached testdoco.doc for an example of such a document

      2. Attach the document to any page in Confluence
      3. Search for the document using this SOAP client:
        import com.atlassian.confluence.rpc.soap.beans.RemoteSearchResult;
        import localhost.c543.plugins.servlet.soap_axis1.confluenceservice_v2.*;
        import java.util.*;
        import java.net.URL;
         
        public class Search {
         
        public static void main (String args[]) {
            ConfluenceSoapService confluenceService	= null;
            		String confluenceToken = null;
        
            		try
            		{
            			ConfluenceSoapServiceServiceLocator confluenceServiceLocator = new ConfluenceSoapServiceServiceLocator();
            			confluenceService = confluenceServiceLocator.getConfluenceserviceV2(new URL("http://localhost:8543/c543/rpc/soap-axis/confluenceservice-v2"));
        
            			confluenceToken = confluenceService.login("admin", "admin");
            			String query = "hillert";
            			HashMap searchParameters = new HashMap();
            			RemoteSearchResult[] results = confluenceService.search(confluenceToken, query, searchParameters, 100);
            			for (int i=0; i<results.length; i++)
            			{
            				System.out.println("URL: " + results[i].getUrl());
            				System.out.println("Title: " + results[i].getTitle());
            				System.out.println("-----------------");
            			}
        
            			System.out.println("Ready23...");
            		}
            		catch (Exception e)
            		{
            			System.out.println(e.toString());
            		}
            		finally
            		{
            			try
            			{
            				if ((confluenceService != null) && (confluenceToken != null))
            					confluenceService.logout(confluenceToken);
            			}
            			catch (Exception e)
            			{
            				System.out.println(e.toString());
            			}
            		}
        }
        } 
        

        Where "hillert" is the <text-to-search> defined earlier.

      Observation

      If you search for this document using the same keyword (hillert) in the Confluence browser UI search, the document is retrieved successfully, without any errors.

      If you run the SOAP Client above though, you will realize that you will hit into a "(500)Internal Server Error", with the following error in the Confluence logs:

      2014-07-14 17:01:44,691 ERROR [http-8543-7] [axis.encoding.ser.BeanSerializer] serialize Exception:
       -- url: /c543/rpc/soap-axis/confluenceservice-v2 | userName: anonymous
      java.lang.IllegalArgumentException: The char '0x13' in 'hillert  CREATEDATE  \ MERGEFORMAT 7/14/2014 4:20:00 PM' is not a valid XML character.
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fsim Foo Sim (Inactive)
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: