JAX-WS Loading WSDL from jar

前端 未结 13 948
予麋鹿
予麋鹿 2020-11-28 04:40

I\'m writing a fat client that makes use of a SOAP service for some features (bug reporting etc.)

I\'ve got JAX-WS working fine, but by default (in netbeans at least

13条回答
  •  情歌与酒
    2020-11-28 05:38

    Maybe a bit late, but I found a quite simple solution which worked to solve this problem, but this involved a change in the generated code of the Service class:

    If the following line in the Service class

    baseUrl = net.example.ApplicationService.class.getResource(".");
    

    is changed to

    baseUrl = net.example.ApplicationService.class.getResource("");
    

    it works fine even with a WSDL that is packed within a JAR. Not sure about the exact supposed behaviour of getResource() in either of this cases, but I didn't experience any problems with this approach so far, on multiple OS and Java versions.

提交回复
热议问题