软件是对质量的不懈追求

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

posted on 2010-03-08 16:00 BlakeSu 阅读(334) 评论(0)  编辑  收藏


只有注册用户登录后才能发表评论。


网站导航: