这个问题应该是一年半前联调发现的,当时解决了就没再管了,昨天同事问起来,突然东西都没了,找了半天才找到,记录下
错误已经没了,大概就是xfire的客户端调用cfx的时候报参数之类的错误
解决方案如下:
cfx在发布webservice的时候需要写如下注解
@WebService(targetNamespace = "http://hello/",name = "IHelloWorldService", serviceName = "IHelloWorldService", endpointInterface = "hello.IHelloWorld")
public class HelloWorldImpl implements IHelloWorld {
@WebResult(name="return",targetNamespace="http://hello/")
@WebMethod
public String sendDocXmlToDealSystem1(@WebParam(name="name",targetNamespace = "http://hello/") String name,@WebParam(name="name",targetNamespace = "http://hello/")String flag) {
System.out.println("sayHello is called by " + name);
return "Hello " ;
}
}
其中这个参数后面的targetNamespace必须得写的
没办法,之前有想去看xfire为啥会报错,后来翻了翻也没翻到具体的,大概就是xfire的客户端接收的东西和cfx服务器端返回的不咋匹配,同时建议别用xfire了,当时也是啥也不懂,感觉xfire的客户端好简单,直接引两个包就完了,后来才发现好多坑的,而且xfire都不维护了,大部分现在外面用的都是cfx,就跟随大流用cfx吧