cxf调用axis如何调用啊?

独孤小败 发布于 2013/05/30 20:14
阅读 2K+
收藏 0
JaxWsDynamicClientFactory  dcf = JaxWsDynamicClientFactory.newInstance();
		Client client = dcf.createClient(URL+"?wsdl");
		try {
			client.invoke("sayHello", "job");
		} catch (Exception e) {
			e.printStackTrace();
		}
这样会报错:
Exception in thread "main" org.apache.cxf.wsdl11.WSDLRuntimeException: Part Body defined with no element and no type.
 at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildMessage(WSDLServiceBuilder.java:874)
 at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterfaceOperation(WSDLServiceBuilder.java:604)
 at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterface(WSDLServiceBuilder.java:571)
 at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:347)
 at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:196)
 at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:172)
加载中
0
BLUE-魏晓峰
BLUE-魏晓峰
用axis自带的包调用自己多好啊。不过看你的代码,估计有问题,按你的这行代码client.invoke("sayHello","job"); 你的本意是调用sayhello方法,但是你知道的,JAVA一个方法可以多态,你没有告诉它你的这个方法参数是什么
BLUE-魏晓峰
BLUE-魏晓峰
@独孤小败 我的意思是你的代码中没告诉sayHello的参数类型,打个比方,你的类有3个sayhello方法,参数都不一样,它拿知道该调用哪个?
独孤小败
独孤小败
参数是后面的job啊
返回顶部
顶部