问题
I have an application that is written with the NetBeans Platform 5.5. I'm having trouble consuming a web service.
If I create a Java SE application in NetBeans, I can add a web service reference without problem.
Since my application is using the NetBeans Platform, many of the menu choices change. So, I cannot figure out how to add a reference to the web service. I've googled this topic a number of ways but haven't found any pages that deal with consuming a service through the platform. They all talk about consuming a service with a Java SE application.
Changing the application from the Platform architecture is not an option.
回答1:
Here is a good tutorial for setting up a Feed Reader on NetBeans Platform. It covers some of the configuration issues for using web services
Blog with an entry about making a web services client
I'd be happy to try and give you a more specific answer if you can give information about the service you want to access.
回答2:
Found this:
- Create web service and client using this tutorial
- Create library wrapper module for web service client (you don't need to include JAX-WS libs, only your client jar)
- In your wrapper module add following dependencies (important):
- JAX-WS 2.1 API
- JAX-WS 2.1 and JAXB 2.1 Library (for this you have to check Show Non-API Modules in "Add Module Dependency" window)
- If you try to build module after these steps it will fail telling you that your module is not friend of "
path-to-netbeans"/java2/modules/org-netbeans-modules-websvc-jaxws21.jar
. Right click on JAX-WS 2.1 and JAXB 2.1 Library and choose Edit. Select Implementation Version.
from here.
来源:https://stackoverflow.com/questions/470098/consuming-a-web-service-with-the-netbeans-platform