woensdag 29 april 2015

Mendix webservices: cannot find the declaration of element 'S:Body'

While working on an integration issue between 2 Mendix Apps, we kept running into an issue where a locally developed and tested integration worked fine, but after deploying it on the Test environment, errors kept occurring. Debugging led to the specific error " cannot find the declaration of element 'S:Body' " and in the java stack trace the mention of the Xerces libray, which handles Java webservice integration. Most likely (pending further investigation...) this means it's a server environment configuration issue. It seems to be that Mendix is not able to interpret (deserialization?) the incoming request. Can it be the the SOAP library is not available?

There are 2 options we are exploring:
- newer JRE version to be installed on the server
- settings of the VM need to be updated as the server is running On Premise.
This is our current approach for further researching a solution for this error:
There is an issue since Java 7, causing timeouts when using Web Services with a certain amount of data. You can circumvent this issue by adding the VM params "-Djava.net.preferIPv4Stack=true". The Mendix Business Modeler will do this for you but if you are running Mendix on premise on a Windows server you will need to do this yourself.
As found in the Mendix System Requirements.

"An error has occurred" in the Mendix UI: webservice with bad endpoint constant configuration

When working with webservices I kept on receiving the very clear (not) message "An error has occurred" in the Mendix UI. Locally developed and tested, all was fine, but when moved to the test environment, this kept popping up.
Debugging gave no further details, stack trace and additional logging showed a SOAP "fault" HTTP 200 OK.
However, under water a webservice was invoked, and for end point resolving we used a constant which is configurable for each environment; that is where it went wrong.

Locally the endpoint was configured correctly, but on the test server environment the endpoint was set to http://something.test.local/ws-doc/GetPersonList?wsdl
Obviously not the right endpoint, but no proper error information was available hinting at this.
So, check your endpoint configuration if you run into this error, when using Mendix webservices!

Moving on.... to Mendix

Since early this year I moved to the (rather)new and exciting platform Mendix. It is a platform that allows for Model Driven Development. Mendix makes it possible to very quickly generate interpretable models for business processes, which are recognizable for business end users, but allow for (Java) developers to still do what they want, just without needing to write thousands of lines of code. So from now on I will only post about Mendix and no longer SOA Suite.