I am very new to SOAP, so was looking into some programs online, this is what I came up with but I get a null response, must be some silly thing, but need little help
Pl
What you want to do is auto-generate Java code for this web service. The WSDL is here: http://www.webservicex.net/periodictable.asmx?wsdl
In Java, the tool to auto-generate the code is wsimport
. You'll want to use something like this:
wsimport http://www.webservicex.net/periodictable.asmx?wsdl -p com.company.whateveruwant -Xnocompile -d . -keep
This will put the code you want in the specified package (here com.company.whateveruwant
).
From there, all you have to do is simply invoke the SOAP method like a normal Java library:
PeriodictableSoap soap = new Periodictable().getPeriodictableSoap();
System.out.println(soap.getAtomicNumber("Iron"));
This prints out:
26
Iron
Fe
55.847
3300
7.9
1.6400000000000001
1.17
1808
7874