通过cxf+srping实现ws调用客户端代码

背景:简单的一个调用WS的客户端测试小程序.
描述:
1. 自己写的WS服务http://192.168.2.5:8080/ws-demo/ws/soap/agent?wsdl,
在浏览器中可以正常打得开.
2.Jax动态客户端可以正常实现

JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance();
Client client = factory.createClient("http://192.168.2.5:8080/ws-demo/ws/soap/agent?wsdl");
Object[] results = client.invoke("getAgent", "001");
System.out.println(JSON.toJSONStringWithDateFormat(results, "yyyy-MM-dd"));

提问:
1. 我看别人用例时 WS服务发布后的路径可以不包含项目路径, 怎么实现?
2. 基于上面代码实现spring+cxf的客户端代码如下

 spring.xml
 <jaxws:client id="agentWsService" serviceClass="cn.hyx.ws.cxf.AgentWsService"
    address="http://192.168.2.5:8080/ws-demo/ws/soap/agent" />

    client 代码: 怎么写? 
    我看了别人写的照着的该如下
    ApplicationContext context = new ClassPathXmlApplicationContext("spring.xml");
AgentWsService agentService = context.getBean("agentWsClient", AgentWsService.class);
String result = agentService.getAgent("001");
System.out.println(result);

但AgentWsService 这个类明明是服务端的类, 客户端怎么直接写呢? 难道是wsimport这个方式还得导入的吗?

没有实际开发过WS, 希望详细描述 . 非常感谢

不太清楚,你一定要加油啊

直接使用你的上边的客户端代码就可以了

是不是生成本地映射类了?