Category Webservice

WebService with PHP Server and Java Client

For my current private project that answers to the nice name "Telrunya" I'm trying to access a PHP web service through a Java client. I once heard in a .NET codecamp that WebServices are super cool and that it doesn't matter in which language they are implemented. But that doesn't apply if you're communication between 2 different technologies. In the Guxx blog I found the reversed case, how to access a java server through a PHP client. There is also a Java bridge developed by Zend that manages the conversion of the objects. But that seems to be an independent server or at least a server modul but that isn't considered by me. (furthermore it costs money)

Anyway, I tried the whole thing withion NetBeans IDE with JAX-WS. My WSDL file (document) written in Eclipse was successfully parsed and the Java files for client etc. were created. The client was also able to access the service but it failed to convert the values. Monitoring the HTTP traffic I can see that the right values are returned, but the Java client returns "null". I already read a lot of documentations and tutorials but I didn't find out anything about converting the received data.
Maybe someone has an advide for me?

Well, the old school alternative works but it is lond winded. Therefore I simply create an URL in Java, set my SOAP function as "RequestProperty" and send an handmade (or even by soapUI created) SOAP envelope. The result is the corresponding envelope returned that now has to be stripped and the relevant data has to be extracted. It could be so simply with JAX-WS but isn't....