简体   繁体   中英

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?:

<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?. 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:

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

This will generate the needed Java source files. Execute it in your project root dir.

After that you have to change your web.xml file:

<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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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