Announcement Announcement Module
Collapse
No announcement yet.
No Content-Id in attachments created with SaajSoapMessage Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No Content-Id in attachments created with SaajSoapMessage

    Adding an attachment with this code in a Client Interceptor

    Code:
    public boolean handleRequest(MessageContext messageContext)
    			throws WebServiceClientException {
    
    DataHandler dataHandler = new DataHandler(foto.getImmagine(),
    				"application/octet-stream");
    
    SaajSoapMessage saajMsg = (SaajSoapMessage) messageContext
    						.getRequest();
    				saajMsg.addAttachment("foto_allegata", dataHandler);
    produces an attachment but without the expected Content-Id <foto_allegata>

    Code:
    POST /openspcoop/PD/scambioContatto HTTP/1.1
    Accept-Encoding: gzip
    Accept: text/xml, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
    SOAPAction: ""
    Content-Type: multipart/related; type="text/xml"; boundary="----=_Part_0_5944104.1207147827609"
    Content-Length: 2521
    Authorization: Basic YXN5bmM6MTIzNDU2
    User-Agent: Jakarta Commons-HttpClient/3.0.1
    Host: fi221606:81
    
    ------=_Part_0_5944104.1207147827609
    Content-Type: text/xml; charset=utf-8
    
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
    <SOAP-ENV:Header/>
    <SOAP-ENV:Body>
    .....
    </SOAP-ENV:Envelope>
    
    ------=_Part_0_5944104.1207147827609
    Content-Type: application/octet-stream
    Content-Transfer-Encoding: binary
    
    
    Something wrong in my code?

    Luciano

  • #2
    it happens only in JBoss

    I tried to port my application to Oracle OC4J 10.1.3.3 and after some troubles (I had to update saaj, activation and mail jars) i discovered that the app runs fine on this platform inserting the rigth Content-id

    On JBoss 4.2.1 i still have the problem.

    Any idea what could it happen?

    Luciano

    Comment

    Working...
    X