i'm facing a little problem and can't find a solution. The situation:
print_r()
shows the following (shortened to the relevant parts):stdClass Object ( [enthMWsT] => 0 [preisStreckeGesamt] => 28.6 [waehrung] => EUR [applikationsDaten] => stdClass Object ( [entry] => Array ( [0] => Array ( [key] => test [value] => 1 ) [1] => Array ( [key] => fahrDrucken [value] => 1 ) [2] => Array ( [key] => fahrLfdnr [value] => 0 ) ) )
System.out.print()
it, i get the following:[STDOUT] {[key: null]=[value: null], [key: null]=[value: null], [key: null]=[value: null]}
as you can see, it's the number of elements is correct, but all keys an values are null
.
my problem is: why don't i get the correct keys/values on java-side?
PS: if you need more information to analyse this, please don't hesitate to ask
EDIT:
on java-side i'm running a jBoss 4.2.2GA
on PHP-side i use the SoapClient Object like this:
$conf['soap_wsdl'] = "http://192.168.0.213:8180/R1WebService/Service?wsdl";
$conf['soap_timeout'] = 5;
$soap = new SoapClient($conf['soap_wsdl'], array('connection_timeout' => $conf['soap_timeout']));
$bst = $soap->getBestellung()->return;
// some stuff
$return = $soap->saveBestellung(array($bst))->return;
i found the solution: the problem was in my java code. it's not enough to declare the hashmap in the object like this:
private HashMap applikationsDaten;
public HashMap getApplikationsDaten() {
return applikationsDaten;
}
public void setApplikationsDaten(HashMap applikationsDaten) {
this.applikationsDaten = applikationsDaten;
}
to make it work, i had to specify datatypes for the Hashmap like this:
private HashMap<String,String> applikationsDaten;
public HashMap<String,String> getApplikationsDaten() {
return applikationsDaten;
}
public void setApplikationsDaten(HashMap<String,String> applikationsDaten) {
this.applikationsDaten = applikationsDaten;
}
after changing this and redeploying the webservice it worked as expected. I'll leave this question and mark it as community wiki instead of deleting it - maybe it helps someone looking for the same failure.
PS: thanks to ZeissS for his hints.