Welkom. Uw laatste bezoek was vrijdag 18 mei 2012 02:58.
Dit onderwerp heeft 1 reactie, en bestaat uit 1 pagina.
De laatste reactie is geplaatst op 27-03-2009 14:51.
[Java] Hints & How-to
- Geplaatst op maandag 06 februari 2006 15:50Webservices.nl crewHere are some hints for using Webservices.nl with Java
IBM: Simple SOAP Client
Low-level SOAP Client. Good reading material if you're new to SOAP, but not really useful for use with Webservices.nl since you have to bother about all the little details yourself, while there are a lot of tools available which can make your life easier.
Apache Web Services - Axis
SOAP implementation, follow-on to the Apache Soap Project. Site provides a lot of starting points. WSDL2Java is also documented here. WSDL2Java is a great tool to create the source for a stub based on a WSDL file.
(Note: This how-to was written using Axis 1)
Apache WS Project WSIF (Web Services Invocation Framework)
Framework claiming a more abstract, high level way of working. With WSIF you can dynamically call web services using their WSDL files (take a look at their samples). For web services using complex soap types as input, a stub has to be generated first. Since we use complex types as input for a lot of our methods and because of performance reasons and predictability I advice you to always use a pre-compiled stub.
How-to guide for creating a Webservices.nl client using WSIF- Make sure you have a properly installed Java platform (incl. classpaths)
- Download the WSIF distribution you like from the WSIF site (home >downloads > releases)
- Unpack the distribution. From this point, this how-to assumes the wsif-x.y directory as the working directory.
- Take a look at the simple soap and complexsoap samples (readme links at bottom of page).
- Choose a Webservices.nl WSDL file and store it (this how-to assumes the use of the soapnoheaders WSDL)
- Build the stub with
java org.apache.axis.wsdl.WSDL2Java
- Adopt the provided build.xml file (or create your own compile script) to let it compile the stub. You can also choose to just move the stub source files to the src/ dir
- Create a copy of samples/complexsoap/, for now, let's call the copy samples/webservices/
- Edit samples/webservices/client/stub/Run.java Take a look at our sample Java listing which demonstrates a few of our services. If you use our sample listing, please note that you have to set vars username and passwords to your login credentials. Output of the sample program is included in comments in the listing.
- Build everything (if you use another compile script, use that script)
build
- Run the program. If you copied the provided example:
java webservices.client.stub.Run 2011VM 18
- If there is a problem with https, certificates and the like, check the note below.
- Remove unwanted code, samples and directories and adopt Run.java to your own needs
Note concerning https
A lot of Java platforms include an outdated keystore file. Please check Trust issue when accessing data through SSL/HTTPS using Java if you're having problems connecting with https. Please make sure that you update the right keystore(s) if you have multiple versions of Java installed.
Only edit the URL set with variable WebservicesNlPort_address in WebservicesNlLocator (one of the files generated by WSDL2Java) to "http://ws1.webservices.nl:80/{endpointOfYourChoice}" as a last resort. - Geplaatst op vrijdag 27 maart 2009 14:51Webservices.nl crewNote: This how-to was written using Axis 1.
We've not tested version 2 yet, but one of our clients did report a problem generating and compiling stubs using version 2.
Dit onderwerp heeft 1 reactie, en bestaat uit 1 pagina.
De laatste reactie is geplaatst op 27-03-2009 14:51.