Receiving complex xml structures through a web service response in 2.5beta
The Problem: I've got a problem with saving response from a web service call. None of the returned data is saved in the database or is accessible through associations. I'm starting to think it's a problem in Mendix, but I'm not sure. The Situation: The web service is called within a microflow. Some objects are passed along as input. The response of the call web service is a 'Complex XML structure'. I've created a mapping which creates new objects. The mapping looks as follows: 1 'return' object, which consists of 0..* 'entry'-objects. The 'return' object only consists of 0..* 'entry'-objects, no other elements. The 'entry'-object consists of some values (Integers and DateTimes). Between the objects there is an association set via 'association to parent'. For testing purposes, the response object are exactly the same the domain model entities. An analysis: By analyzing traffic, the input is correctly sent to the web service. The web service is able to create a response and send it back. I've checked it with a packet-analyzer and the Mendix console (log: trace). The log file ends with: ConnectionBusSynchronize: Endelement encountered for with content (localName: Body) ConnectionBusSynchronize: Endelement encountered for with content (localName: Envelope) So no objects are stored in the data base. What I've tried: The Mendix console shows the response gets parsed, however, no objects are created. Passing along a parameter to the call web service, as suggested in https://forum.mendix.com/questions/803/Capturing-return-result-of-a-consumed-wsdl-in-25, does not seem to do the trick. Trying to retrieve objects by association results in null objects. Using web services which return a simple type (Integer/Long for example) are working fine.. What am I doing wrong? Screenshots and example xml: http://dl.dropbox.com/u/5049895/mendix-forum/call-webservice.png http://dl.dropbox.com/u/5049895/mendix-forum/domain-model.png http://dl.dropbox.com/u/5049895/mendix-forum/input.xml http://dl.dropbox.com/u/5049895/mendix-forum/result.xml http://dl.dropbox.com/u/5049895/mendix-forum/wsdl.xml http://dl.dropbox.com/u/5049895/mendix-forum/xml-to-domain-mapping.png
There's a known issue with 2.5 whereby you can't "explicitly" declare xsi:type's in the soap result. This results in the platform not recognizing any xml elements, and, as you are experiencing, nothing being mapped.
The current (nasty) workaround is to change your webservice to not declare the types explicitly in the xml. Ie:
The wsdl has already declared that this element is of type xsd:int, so the information you're sending is superfluous anyway.
update: This will be fixed in 2.5 final. In the meantime, as I suggested, you can try (if possible) to edit the webservice response to not explicitly declare the types. This should fix the bug.
Thanks for your quick response. If you need more info, just let me know.
By the way, setting the debug level of Webservices and Data_synchronization (or something like that) to TRACE provides very useful feedback about the data mapping which is processed. (You can find it under the rocket icon in the console tab)
After 2 webservices log entries (Created soap envelope and called [..] and received response), I get a lot of entries from ConnectionBus_Sync: Available mapping, Added to xmlpath and Endelement encountered. This data seems to be ok.
'Endelement encountered for with content (localName: Envelope)' is the very last message in the console. After that, nothing happens...