JAX-WS/WS-Addressing WAS 8.5.5 编译错误和无法访问WSDL错误

JAX-WS/WS-Addressing WAS 8.5.5 编译错误和无法访问WSDL错误

JAX-WS/WS-Addressing WAS 8.5.5 编译错误和无法访问WSDL错误 
I tried to develop a sample WS-Addressing application with WAS 8.5.5 but got failure all the times. 参照了一些例子,试着在WAS8.5.5上做了一个简单的WS-Addressing应用,几天下来,总是碰到一样的莫名其妙的错误 
错误1: 编译错误,W3CEndpointReference不能作为返回类型.
      仿照一些例子,写了一个简单的SEI接口    
@Addressing   
@WebService    
public interface ICalculator {  
       public W3CEndpointReference getToken();  
}

在Eclipse (kepler-SR2) + WAS8.5.5插件,错误信息是这么说的 "Class javax.xml.ws.wsaddressing.W3CEndpointReference may not be used as a return type or method parameter as it has inner types that are not public and static" 为了排除代码错误,我另建了一个应用,但是选择了Tomcat 7.0作为目标运行环境.结果同样的代码编译成功。 然后再试了RAD9+WAS8.5.5,结果同样编译成功。 究竟是什么导致的错误呢? 

 

错误2: WEB服务访问错误地址
  因为错误1,我决定跳过SEI接口,直接写实现类。有趣的是,这回,返回类型W3CEndpointReference就不报错了。  
public W3CEndpointReference getToken() {  
       ...       
  return (W3CEndpointReference)ctx.get    
} 

Web服务代码就一个类,把它打包发布到WAS8.5.5,

测试访问WSDL成功 http://localhost:9082/CalculatorWeb/CalculatorService/CalculatorService.wsdl 然后使用WAS8.5.5的wsimport工具(WAS_HOME/java/bin/wsimport)来生成客户端代码     wsimport -s .client_src http://localhost:9082/CalculatorWeb/CalculatorService/CalculatorService.wsdl 奇怪的事情发生了,生成的客户端代码居然报错“FileNotFoundException”,生成的Proxy居然莫名其妙地试图访问一个错误的URL     http://localhost:9082/CalculatorWeb/CalculatorService/?wsdl. 这个结尾的"CalculatorService/?wsdl"而不是"CalculatorService?wsdl". 在Eclipse和RAD9中都测试过了,一样的错误。                 

转载于:https://www.cnblogs.com/liqun-12345/p/5564600.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值