xfire 动态客户端

xfire 动态客户端


import  java.net.URL;

import  org.codehaus.xfire.client.Client;

public  class  XfireClient
{

    
public  static  void  main(String[] args)
    {
        DyClient();
    }

    
/**
     * You get a DynamicClient when you create a Client with the URL of a WSDL
     
*/
    
public  static  void  DyClient()
    {
        
try
        {
            Client client 
=  new  Client(
                    
new  URL(
                            
" http://www.webxml.com.cn/webservices/qqOnlineWebService.asmx?wsdl " ));
            Object[] results 
=  client.invoke( " qqCheckOnline " ,
                    
new  Object[] {  " 31506173 "  });
            System.out.println((String) results[
0 ]);

        }
        
catch  ( Exception e)
        {
            e.printStackTrace();
        }
    }
}




必须jar:
commons-codec-1.3.jar
commons-httpclient-3.0.jar
commons-logging-1.0.4.jar
jdom-1.0.jar
wsdl4j-1.6.1.jar
xfire-all-1.2.6.jar
XmlSchema-1.1.jar

你可能感兴趣的:(xfire 动态客户端)