SOAP client and use Array with OGNL expression
boby Oct 18, 2010 12:02 PMHello,
I have a problem to use the arrays with OGNL expression.
My wsdl is in attachment.
My request action :
public Message process(Message message) throws Exception { ArrayList<GeolocWave> geolocWaves = (ArrayList<GeolocWave>) message.getBody().get(Body.DEFAULT_LOCATION); GeolocWave geolocWave = geolocWaves.iterator().next(); // add paramaters to the web service request map HashMap<String, String> requestMap = new HashMap<String, String>(); requestMap.put("reverseGeocode.points[0].latitude", Double.toString(geolocWave.getLatitude())); requestMap.put("reverseGeocode.points[0].longitude", Double.toString(geolocWave.getLongitude())); requestMap.put("reverseGeocode.language", "fr"); requestMap.put("dumpSOAP", ""); // The "paramsLocation" property was set in jboss-esb.xml to // requestMap.put("groupReference", "MCU"); message.getBody().add("get-reverseGeocode-params", requestMap); return message; }
And my log :
17:58:50,657 INFO [STDOUT] ------------------------------------------------------------------------------------------------------------------------------------------ 17:58:50,658 INFO [STDOUT] SOAP Template (Unexpanded): 17:58:50,658 INFO [STDOUT] <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:geoc="http://ws.webservices.masternaut.fr/MasterWS/services/Geocode" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header /> <soapenv:Body> <geoc:reverseGeocode soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <points xmlns:urn="urn:Geocode" soapenc:arrayType="urn:Point[]" xsi:type="geoc:ArrayOf_tns1_Point" /> <language xsi:type="xsd:string">?</language> </geoc:reverseGeocode> </soapenv:Body> </soapenv:Envelope> 17:58:50,658 INFO [STDOUT] ------------------------------------------------------------------------------------------------------------------------------------------ 17:58:50,658 INFO [STDOUT] ------------------------------------------------------------------------------------------------------------------------------------------ 17:58:50,658 INFO [STDOUT] SOAP Template (Expanded): 17:58:50,659 INFO [STDOUT] <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:geoc="http://ws.webservices.masternaut.fr/MasterWS/services/Geocode" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header /> <soapenv:Body> <geoc:reverseGeocode soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <points xmlns:urn="urn:Geocode" soapenc:arrayType="urn:Point[]" xsi:type="geoc:ArrayOf_tns1_Point" /> <language xsi:type="xsd:string">?</language> </geoc:reverseGeocode> </soapenv:Body> </soapenv:Envelope> 17:58:50,659 INFO [STDOUT] ------------------------------------------------------------------------------------------------------------------------------------------ 17:58:50,659 INFO [STDOUT] ------------------------------------------------------------------------------------------------------------------------------------------ 17:58:50,659 INFO [STDOUT] SOAP Message (Populated Template): 17:58:50,659 INFO [STDOUT] <?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:geoc="http://ws.webservices.masternaut.fr/MasterWS/services/Geocode" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <soapenv:Header /> <soapenv:Body> <geoc:reverseGeocode soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <points xmlns:urn="urn:Geocode" soapenc:arrayType="urn:Point[]" xsi:type="geoc:ArrayOf_tns1_Point" /> <language xsi:type="xsd:string">fr</language> </geoc:reverseGeocode> </soapenv:Body> </soapenv:Envelope> 17:58:50,659 INFO [STDOUT] ------------------------------------------------------------------------------------------------------------------------------------------ 17:58:50,738 INFO [AuthChallengeProcessor] basic authentication scheme selected 17:58:50,820 WARN [HttpMethodBase] Going to buffer response body of large or unknown size. Using getResponseBodyAsStream instead is recommended.
My language element is filled, but not the points. I tried many possibilities without succes.
So, if anyone could help me, it would be nice.
Thanks.
-
Geocode.wsdl.zip 1.4 KB