本文主要是介绍Exception in thread main AxisFault,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
AxisFault faultCode: {http://xml.apache.org/axis/}HTTP faultSubcode: faultString: (400)Bad Request faultActor: faultNode: faultDetail: {}:return code: 400 {http://xml.apache.org/axis/}HttpErrorCode:400 (400)Bad Request
下面代码红色部分一定要正确填写!否则会报上面的错误!
//webService访问地址
//String url = "http://localhost:8080/axis/HelloWorldService.jws";
String url = "http://localhost:8090/axis/HelloWorldService.jws";
//创建服务
Service service = new Service();
//创建调用句柄
Call call = (Call) service.createCall();
//设置请求地址
call.setTargetEndpointAddress(url);
/**
* * 设置调用的方法和方法的命名空间;
* * 因为这里是手动发布到webroot目录下的,所以命名空间和请求地址一致
* * 当然null也可以,因为本身它就没有设置命名空间,一般方法的命名空间是
* * 包名倒写组成,如com.hoo.service,ns=http://service.hoo.com
* */
call.setOperationName(new QName("", "sayHello"));
/**
* * 用call调用sayHello方法,设置请求的参数,返回的就是返回值了
* */
String result = (String) call.invoke(new Object[] { "jack", new Integer(99) });
System.out.println(result);
这篇关于Exception in thread main AxisFault的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!