You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by "Jeff Randolph (JIRA)" <ax...@ws.apache.org> on 2005/02/04 16:00:24 UTC

[jira] Commented: (AXIS-1777) MIME attachments appended twice

     [ http://issues.apache.org/jira/browse/AXIS-1777?page=comments#action_58598 ]
     
Jeff Randolph commented on AXIS-1777:
-------------------------------------

Okay, the "problem" has been found.  It's in org/apache/axis/client/Call.java at line 2729

       // For debugging - print request message
       if (log.isDebugEnabled()) {
           StringWriter writer = new StringWriter();
           try {
               SerializationContext ctx = new SerializationContext(writer,
                                                                  msgContext);
               requestMessage.getSOAPEnvelope().output(ctx);
               writer.close();
           } catch (Exception e) {
               log.debug(Messages.getMessage("exceptionPrinting"), e);
           } finally {
               log.debug(writer.getBuffer().toString());
           }
       }

This happens when the log4j system is not initialized (directory containing log4j.properties is not in classpath).
Although the request message is simply writing itself to a StringWriter,  the fact that the log4j system is in an undefined state seems to cause the actual SOAP message to output any attachments twice when being sent.  However, the rest of the SOAP message serializes fine.

> MIME attachments appended twice
> -------------------------------
>
>          Key: AXIS-1777
>          URL: http://issues.apache.org/jira/browse/AXIS-1777
>      Project: Axis
>         Type: Bug
>   Components: Serialization/Deserialization
>     Versions: 1.2RC2
>  Environment: Windows XP Pro, JRE 1.5
>     Reporter: Jeff Randolph
>     Priority: Minor

>
> I used WSDL2Java to generate classes from the WSDL sample that uses MIME attachments: http://cvs.apache.org/viewcvs.cgi/ws-axis/java/test/wsdl/interop4/groupG/mime/doc/mime-doc.wsdl
> When I send the SOAP message, the attachments are output twice. Here is a message, you'll notice that the SOAP body refers to the second attachment only, but two attachments are appended for some reason:
> POST / HTTP/1.0
> Content-Type: multipart/related; type="text/xml"; start="<1015D76EB386F39C883FFF76296F8D02>"; 	boundary="----=_Part_0_3338151.1106337310875"
> Accept: application/soap+xml, application/dime, multipart/related, text/*
> User-Agent: Axis/1.2RC2
> Host: localhost:8080
> Cache-Control: no-cache
> Pragma: no-cache
> SOAPAction: "http://soapinterop.org/attachments/"
> Content-Length: 1305
> ------=_Part_0_3338151.1106337310875
> Content-Type: text/xml; charset=UTF-8
> Content-Transfer-Encoding: binary
> Content-Id: <1015D76EB386F39C883FFF76296F8D02>
> <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
> <soapenv:Body>
>     <ns1:EchoAttachments xmlns:ns1="http://soapinterop.org/attachments/xsd">
>         <ns1:Item href="cid:122DB559856B68774020E52EE51398A5"/>
>     </ns1:EchoAttachments>
> </soapenv:Body>
> </soapenv:Envelope>
> ------=_Part_0_3338151.1106337310875
> Content-Type: application/octet-stream
> Content-Transfer-Encoding: binary
> Content-Id: <7D95AF8BBD59881FC47E3D3E5212DED7>
> MY BINARY DATA HERE
> ------=_Part_0_3338151.1106337310875
> Content-Type: application/octet-stream
> Content-Transfer-Encoding: binary
> Content-Id: <122DB559856B68774020E52EE51398A5>
> MY BINARY DATA HERE
> ------=_Part_0_3338151.1106337310875--

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira