I have some kind of RPC layer bug I think with Axis, both 1.1 and 1.2alpha.
I construct SOAPMessage objects with 2 attachments. The first is just a string, which happens to contain XML, the second is an InputStream attached to a ByteArrayOutputStream.
E.g. 1st attachment:
_mainAttachment = _soapMessage.createAttachmentPart() ; _mainAttachment.setContent(xmlRequest /*a string*/, "text/plain") ; _mainAttachment.setContentLocation("my.main.location") ; _soapMessage.addAttachmentPart(_mainAttachment) ;
2nd attachment: _zipAttachment = _soapMessage.createAttachmentPart() ; BinaryDataSource bds = new BinaryDataSource(zipContent /* InputStream */, "application/zip") ; DataHandler dh = new DataHandler(bds) ; _zipAttachment.setDataHandler(dh) ; _zipAttachment.setContentLocation("my.zip.location") ; _soapMessage.addAttachmentPart(_zipAttachment) ;
I do this for SOAPMessages constructed at both ends, a Client sending a SOAPMessage to the server, and the server constructing a SOAPMessage for reply to the client.
The code all worked under the SUN SOAP implementation. It works when the server constructs a reply to the client. It works when the client sends the server, but ONLY FOR ONE ATTACHMENT.
Only in the client->server case, and only when the second binary attachment is present, does the transmission fail.
The server gets the POST headers, but no content! (Here is debugging output):
Header: 'content-type' = 'multipart/related; type="text/xml"; start="<85727EBBCEA55FFCA1FAE7310B6D93B6>"; boundary="----=_Part_1_23763868.1096587242955"' Content: ''
I've attached the debugger to the client. I can see the attachments being added, and my DataSource.getContent() method is being called, as is the getContentType() method.
But the client just doesn't seem to transmit this stuff to the server. I haven't figured it out yet.
Anybody else have this issue and/or know of solutions/workarounds?
The client sends the request with
_soapMessage.saveChanges() ; reply = _soapConnection.call(_soapMessage, _destination) ; _soapConnection.close() ;
The only other pecular thing is that the client seems to hang waiting for the server response, which it eventually gets, after the 60 second socket timeout, but I'm not sure whose timing out (client or server).
The server doesn't seem to hang though, there's no stall getting the fact that there was no content after the mime headers in the POST request. If the server replies right away, I'm unsure why the client must wait so long for the result.
JAVA 1.4.2_05 TOMCAT 5.0.28 AXIS 1.1 and/or 1.2alpha, I tried both REDHAT Linux 9
Any advice appreciated.