With the Web Services Client wizard, you can create stub (client proxy) files
that directly call a Web Service using the Simple
Object Access Protocol. The code stubs use a Web Service Descriptor
Language (WSDL) file and implement the
Web Services Specification.
Before you begin, you must already have a WS-I compliant, WSDL file available
on your system or at a location that can be reached through the HTTP protocol.You must also have a device or device emulator that supports the
JSR-172 specification to successfully run and deploy the project.
To create the Web Services Client:
Right-click on a project node and choose New - Mobile to Client Web Application.
In the Web Application filed choose the location of the Web Project you want to use.
Identify the .wsdl file location for the Web service to be
added to the project.
If the WSDL service is on the Web:
Choose Running Web Service and enter a URL for the .wsdl
file and enter a local filename for the retrieved .wsdl
file.
If you are behind a firewall, click Proxy Settings to designate
the appropriate HTTP host and port.
Click Retrieve WSDL to get a local copy of the .wsdl
file.
The IDE downloads the .wsdl file.
If you have a .wsdl file on your system, select Existing
WSDL File and enter a file name.
The WSDL file is retrieved and the rest of the fields on the page are filled
with default names derived from the WSDL file name.
The message "WSDL file is not WS-I compliant as required by the specification,"
indicates that the client cannot be generated with the selected WSDL file.
To solve this problem, you can change the style of the WSDL file (see the
website). Another option is to use the Mobile
Client to Web Application Generator to create a "three-tier"
Web services connection.
Press Finish.
The IDE creates an opened settings file and generates the client stubs.
In some situations, you might need to convert CLDC 1.1 types to CLDC 1.0
types, which means Float and Double types are converted to String variables.
To make the conversion, select the “Convert floating point to String”
checkbox on the Settings file and click
the Generate Stubs button.
If you are behind a firewall, there is no public setting available for the
HTTPS proxy within NetBeans. To work around this, run the IDE from the command
line with the command -J-DhttpsProxy.host and -J-DhttpsProxy.port,
or add the proxy settings into the /etc/netbeans.conf
file.
The generated files should not be edited. Any changes made to the files
are lost when you update them with the Settings
file.