Hello,

I've seen that archiva 1.2-M1 has now web service interface so I checked out
the codes since no documentation is available yet.

I successfully executed SampleClient in archiva-xmlrpc-client module by
providing these parameters

http://localhost:9091/xmlrpc user pass


Now I tried editing SampleClient cause I'm interested in SearchService and
not AdminstrationService but I got exceptions.

Here's my code:

    public static void main( String[] args )
    {
        Binder binder = new DefaultBinder();
        try
        {
            AuthenticationInfo authnInfo = new AuthenticationInfo( "user",
"pass" );

            SearchService service =
                binder.bind( SearchService.class, new URL(
"http://localhost:9091/xmlrpc"; ),
                             authnInfo );

            service.quickSearch( "junit" );

        }
        catch ( Exception e )
        {
            System.out.println( e.getMessage() );
            e.printStackTrace();
        }
    }


And here's the exception:

java.lang.RuntimeException: Could not execute RPC method quickSearch
        at
com.atlassian.xmlrpc.RPCCallMethodInterceptor.invoke(RPCCallMethodInterceptor.java:67)
        at $Proxy4.quickSearch(Unknown Source)
        at org.apache.archiva.web.xmlrpc.client.App.main(App.java:27)
Caused by: org.apache.xmlrpc.XmlRpcException: No such handler:
Search.quickSearch
        at
org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:186)
        at
org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:145)
        at
org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:94)Could
not execute RPC method quickSearch

        at
org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:44)
        at
org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:53)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:166)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:157)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:146)
        at
com.atlassian.xmlrpc.RPCCallMethodInterceptor.invoke(RPCCallMethodInterceptor.java:62)
        ... 2 more


Is the code correct? If not can I ask for a sample code on how to use
SearchService?
-- 
View this message in context: 
http://www.nabble.com/How-to-use-Archiva-Search-Service-tp21328318p21328318.html
Sent from the archiva-users mailing list archive at Nabble.com.

Reply via email to