xfire 问题
魔都 2013-09-22 02:40:14 2013-9-22 14:36:05 org.codehaus.xfire.transport.http.HttpChannel sendViaClient
严重: Server returned error code = 404 for URI : http://localhost:9999/WebServiceProject/services/MyService. Check server logs for details
Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Server returned error code = 404
上网找了一圈无解求指导。
http://localhost:9999/WebServiceProject/services/MyService 访问是没问题的。
客户端代码:
public static void main(String[] args) {
Service srvcModel = new
ObjectServiceFactory().create(IIMyService.class);
XFireProxyFactory factory =
new XFireProxyFactory(XFireFactory.newInstance().getXFire());
String helloWorldURL =
"http://localhost:9999/WebServiceProject/services/MyService";
try {
IIMyService srvc = (IIMyService)factory.create( srvcModel, helloWorldURL);
String result = srvc.example("hello world");
System.out.print(result);
} catch (MalformedURLException e) {
e.printStackTrace();
}
}