I suggest you use the Mendix webservices module (com.mendix.modules.webservices.WebserviceModule). It offers two public methods:
public static InputStream call(String location, String soapAction, String soapRequestMessage)
public static InputStream call(String location, String soapAction, InputStream soapRequestMessage)
which should be sufficient for your needs. If you need to use your own webservice lib you might want to checkout what Arjen suggested, it could be a jar loading issue with one of our own java libraries.
In respose to Achiel's comment:
javax.xml.ws.Service service = javax.xml.ws.Service create(new URL("xxxx"), new QName("yyyy", "ReportExecutionService")); ReportExecutionServiceSoap proxy = service.getPort(ReportExecutionServiceSoap.class); ((javax.xml.ws.BindingProvider)proxy).getRequestContext().put(javax.xml.ws.BindingProvider.USERNAME_PROPERTY, “username”); ((javax.xml.ws.BindingProvider)proxy).getRequestContext().put(javax.xml.ws.BindingProvider.PASSWORD_PROPERTY, “password”); ExecutionInfo executionInfo = proxy.loadReport(“ReportName”, null);
ReportExecutionServiceSoap and ExecutionInfo are both classes generated by jax-ws, it is ExecutionInfo which is coming back unexpectedly empty when running via the Mendix modeller.
I agree with Arjen that it is likely a library problem. Currently in userlib I have jaxb-impl-2.1.7.jar, jaxws-rt-2.1.4.jar, stax-ex-1.2.jar and streambuffer-0.7.jar. We are running java 1.6.10 which already contains the jaxb API.
If possible I would rather use these webservice libraries as it makes the code more standard and easier for other Java developers to maintain. I’ll certainly investigate using the Mendix webservice module though, it may help us narrow down what the actual problem is.
The solution for this problem was to put all the custom Java classes which were not in the xxx.actions package into a jar file in the userlib directory. Clearly the problem is down to classloading, but quite what the exact nature of it is remains a mystery.