简体   繁体   English

将外部Web服务存储在web.xml中

[英]store external web service in web.xml

if I want to store a external web service url in the web.xml file, how I must proceed?, in this way?: 如果我要将外部Web服务URL存储在web.xml文件中,该如何继续?

<service-ref>
<service-ref-name>PublicApiService</service-ref-name>
 <service-interface>
</service-interface>
<wsdl-file>
    http://nxxxx/example/Services/PublicApiService.wsdl
</wsdl-file>

What I should put on the service-interface if the web service is external?. 如果Web服务是外部的,我应该在服务接口上放什么? I use eclipse 我用日食

Thanks so much 非常感谢

You have to generate the client stubs of the service. 您必须生成服务的客户端存根。 You can use ws-import for generating the client stubs: 您可以使用ws-import生成客户端存根:

wsimport -p your.package.name -s gen -d bin http://nxxxx/example/Services/PublicApiService.wsdl

This will generate the needed Java source files. 这将生成所需的Java源文件。 Execute it in your project root dir. 在您的项目根目录下执行它。

After that you have to change your web.xml file: 之后,您必须更改您的web.xml文件:

<service-ref>
    <service-ref-name>PublicApiService</service-ref-name>
    <service-interface>
        your.package.name.PublicApiService
    </service-interface>
    <wsdl-file>
        http://nxxxx/example/Services/PublicApiService.wsdl
    </wsdl-file>
</service-ref>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM