SOAPClient: array is not sent to the webservice
desbonns62 Mar 5, 2009 9:26 AMHi,
I'm new in Jboss and I would like to use the soapAction to call a webService (in SugarCRM). I creates a map that I add in my esb-message. There is no problem for all parameters except one: an array of string.
My array is sent empty to the webservice.
Here is how I create my message:
Message esbMessage = MessageFactory.getInstance().getMessage(); HashMap map=new HashMap(); map.put("get_entry_list.session", session); List<String> string= new ArrayList<String>(); string.add("id"); string.add("first_name"); map.put("get_entry_list.select_fields", string); esbMessage.getBody().add(map); ServiceInvoker invoker = new ServiceInvoker("SugarCRM_ESB", "SugarCRM_GetEntryList"); Message response = null; try { response= invoker.deliverSync(esbMessage, 3000); }catch(Exception ex) { ex.printStackTrace(); }
I also tried other way to put my array:
map.put("get_entry_list.select_fields[0]", "id"); map.put("get_entry_list.select_fields[0]", "first_name"); or map.put("get_entry_list.select_fields", new String[]{"id","first_name"});
A part of the soap message that is send to my webservice (thanks to the log file of Jboss!):
<session xsi:type="xsd:string">4db486656b7c3604ad81b4422874bdbd</session> <select_fields soapenc:arrayType="xsd:string[]" xsi:type="sug:select_fields">
The part that have should be sent to the webservice (generated and tried with the software SoapUI):
<session xsi:type="xsd:string">4db486656b7c3604ad81b4422874bdbd</session> <select_fields q0:arrayType="xsd:string[2]" xsi:type="q0:Array"> <string>first_name</string> <string>id</string> </select_fields>
And finally my jboss-esb.xml file:
<?xml version = "1.0" encoding = "UTF-8"?> <jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5"> <providers> <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"> <jms-bus busid="SugarCRMEsbChannel_GetEntryList"> <jms-message-filter dest-type="QUEUE" dest-name="queue/SugarCRM_esb_GetEntryList" /> </jms-bus> </jms-provider> </providers> <services> <service category="SugarCRM_ESB" name="SugarCRM_GetEntryList" description="Use the get_entry_list function of the SugarCRM WebService"> <listeners> <jms-listener busidref="SugarCRMEsbChannel_GetEntryList" name="ESBListener_GetEntryList" /> </listeners> <actions mep="RequestResponse"> <action class="org.jboss.soa.esb.actions.soap.SOAPClient" name="soapui-client-action"> <property name="wsdl" value="http://127.0.0.1/SugarCRM/soap.php?wsdl" /> <property name="SOAPAction" value="get_entry_list" /> <property name="responseAsOgnlMap" value="false" /> </action> </actions> </service> </services> </jbossesb>
There is never error message but my array is not sent...
Maybe there is a link with the type "soapenc:arrayType" but I would like to know if what I did is right before thinking that there is a bug.
Thanks in advance and sorry for my bad english!
Simon