Your provider is wrong; messages are semantically equivalent; your unskilled, they are qualified. Are you using Axis or Axis2? If you use Axis, I suggest you switch to Axis2 for a more robust, standards-compliant SOAP stack (both products are bad, but Axis2 is less bad).
I assume that you are creating your client using wsdl2java? If you cannot get this tool to generate a message the way you like, then it's best to create the message programmatically. With Axis2, you can do this using the AXIOM API. See this link for an example use of the API. It should be noted that with most methods, for example, createOMElement , you can pass a namespace prefix. So, if your provider requires this, you can pass a string containing "imk" as the namespacePrefix parameter.
If you finish doing this programmatically and you are going to write a simple client, then I STRONGLY propose to abandon the Axis / Axis2 approach and use JAX-WS , since it has been part of Java since version 1.6. The API is cleaner and the documentation is better. For example, the following is a very simple client that I wrote to send a SOAP request to our JIRA server. The sample code creates both qualified and unskilled elements.
QName port = new QName(endpoint, "subversionsoapservice-v2"); QName serviceName = new QName(endpoint, "ISubversionSoapServiceService"); Service service = Service.create(serviceName); service.addPort(port, SOAPBinding.SOAP11HTTP_BINDING, endpoint); Dispatch<SOAPMessage> dispatch = service.createDispatch(port, SOAPMessage.class, Service.Mode.MESSAGE); MessageFactory factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); SOAPMessage request = factory.createMessage(); SOAPBody body = request.getSOAPBody(); SOAPElement reindexRepository = body.addChildElement("reindexRepository", "jira", "http://soap.ext.plugin.jira.atlassian.com"); SOAPElement in0 = reindexRepository.addChildElement("in0"); in0.addTextNode("test"); request.saveChanges(); dispatch.invoke(request);
The XML sent by the client is as follows:
<?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <jira:reindexRepository xmlns:jira="http://soap.ext.plugin.jira.atlassian.com"> <in0>test</in0> </jira:reindexRepository> </SOAP-ENV:Body> </SOAP-ENV:Envelope>