I'm just starting out with Java (been a C/C++/Perl/PHP/Ruby programmer for many years).
I'm really enjoying the language and everything has been quite plain sailing and straightforward - until now! Basically, I just want to write a very simple SOAP client in Java. I don't want it tied to any particular service, it's really a test-stub type application. To give you an idea of what I'm after (it really is something quick and dirty), here is something I knocked up in PHP:
#!/usr/local/bin/php <? $client = new SoapClient("https://SOME_URL?WSDL", array); $params = array(); // set parameters for method call $params['id'] = '12345'; // key for the update $params['no_of_widgets'] = "10"; // value for the "update" method $res = $client->__soapCall("update", array($params)); // call "update" with the params echo $client->__getLastRequest(); echo "\n\n"; echo $client->__getLastResponse(); ?>
I've google'd for simple SOAP clients in Java but many of them didn't work in my environment (J6SE, Netbeans, Linux 64 bit) - a lot of the time it was the "import"s at the top which were not found and therefore the code below had unknown classes etc. I've made sure the relevant libraries were installed (JAX, AXIS etc) and included in the NetBeans project but no luck. I also noticed the amount of code seemed to be very large but the demos were probably trying to achieve a lot more than I was.
Can anyone help me translate the above PHP into Java or give any tips?