java技术调用xfire webService服务客户端代码

import类:

import java.net.MalformedURLException;
import java.net.URL;
import org.codehaus.xfire.client.Client;

 

public String xfireInvokenClient(String wsdURl, String methodName,
	Object[] paramsValue) {
	Client client;
	try {
	    client = new Client(new URL(wsdURl));
	    if (client != null) {
		client.setTimeout(0);
		Object[] reponseDoc = client.invoke(methodName, paramsValue);
		if (reponseDoc != null) {
		    String message = reponseDoc[0].toString();
		    System.out.println("返回的结果是:+\n" + message);
		}
	     }
	  } catch (MalformedURLException e) {
	    e.printStackTrace();
	} catch (Exception e) {
	    e.printStackTrace();
	}
	return "";
}

 

axisClient.xfireInvokenClient("http://localhost:8086/mims/services/sourceWs?wsdl",
"get_Province", new String[] {"test", "test" });

 

相关文章:

  • 2021-11-05
  • 2021-11-27
  • 2021-10-22
  • 2021-12-30
  • 2021-11-27
  • 2021-11-27
猜你喜欢
  • 2021-12-20
  • 2021-05-15
  • 2022-12-23
  • 2022-01-02
  • 2022-12-23
  • 2021-04-09
  • 2022-12-23
相关资源
相似解决方案