Hi Thilina,

You were right. The problem was in TCPMon. Without using TCPMon, I don't even 
have the problem sending big files. Thanks a lot. 

I have one more question now that this problem was fixed: Is there any sample 
of  MOTM or SwA where the attachment is not a file?? I have to send large 
arrays, for example of short and sending them in xml increases the size of the 
message as it has to generate the tags for each element. So I would like to 
send them as attachments.

 Could anyone tell me how can I do it?

I was given some advise and I'm trying to convert the array of short in a byte 
array doing this. I would appreciate some help on this:

short[] data=new short[100];
        for (short i=0;i<data.length;i++)
            data[i]=i;
          byte[] byte_data = new byte[data.length * 2];
          for(int i=0; i < data.length; i++){
              byte_data[2*i] = (byte) ((data[i] >>> 8) & 0xFF);
              byte_data[2*i + 1] = (byte) ((data[i] >>> 0) & 0xFF);
          }
        
        // Populating the code generated beans
        GetAttachmentResponse response=new GetAttachmentResponse();
        DataHandler dataHandler = new 
DataHandler(byte_data,"application/octet-stream");
        BinaryData binaryData =new BinaryData();
        binaryData.setBase64Binary(dataHandler);
        binaryData.setContentType(dataHandler.getContentType());
        response.setBinaryData(binaryData);

The problem is in the method toEnvelope setting the child for the body.

I'm getting the following exception:

java.lang.RuntimeException: org.apache.axiom.om.OMException: Referenced 
Attachment not found in the MIME Message. ContentID:1.urn:uuid:[EMAIL PROTECTED]
    at 
client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5296)
    at 
client.Medici_LinkSOAP12PortStub.getAttachment(Medici_LinkSOAP12PortStub.java:4103)
    at client.ClientUtilities.mtomTest(ClientUtilities.java:476)
    at client.Client.main(Client.java:69)
Caused by: org.apache.axiom.om.OMException: Referenced Attachment not found in 
the MIME Message. ContentID:1.urn:uuid:[EMAIL PROTECTED]
    at 
org.apache.axiom.soap.impl.builder.MTOMStAXSOAPModelBuilder.getDataHandler(MTOMStAXSOAPModelBuilder.java:103)
    at medici_link.xmime.xsd.BinaryData$Factory.parse(BinaryData.java:429)
    at 
medici_link.op_messages.xsd.GetAttachmentResponse$Factory.parse(GetAttachmentResponse.java:342)
    at 
client.Medici_LinkSOAP12PortStub.fromOM(Medici_LinkSOAP12PortStub.java:5024)
    ... 3 more

And with TCPMon I can see the fault as an attachment.

Thanks and regards,

Jorge Fernández




Martin Gainty <[EMAIL PROTECTED]> escribió: Good Morning Thilina

do you know what caused the bug..Insufficient length..or Boundary condition 
detected (-- in suffix)?
Could you indicate the jira which describes this?

Thanks,
Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

----- Original Message ----- 
From: "Thilina Gunarathne" 
To: ; 
Sent: Sunday, April 29, 2007 11:19 PM
Subject: Re: Help with SwA


There was a known bug in Axis2 1.1.1 which prevented the last boundary
being written to the wire in the case of running Axis2 in Tomcat ...
This was fixed in the latest 1.2 release..

If possible please try the latest or try replacing the Axiom jars..

Thanks,
Thilina

On 4/30/07, Dennis Sosnoski  wrote:
> int values are a minimum of 32 bits in Java, not 16 bits. They have a
> range from roughly -2 billion to +2 billion.
>
> There may well be a problem in the code, but it's not because ints are
> limited to +/- 64k.
>
> - Dennis
>
> Dennis M. Sosnoski
> SOA and Web Services in Java
> Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>
>
>
> Martin Gainty wrote:
> > Jorge
> >
> > Appears you may have discovered a bug as the
> > BoundaryPushbackInputStream.java as there appears to not be ability to
> > deal with any buffer over 64k (the native datatypes appear to be all
> > integer instead of long)
> > Looking at the source
> > http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/attachments/BoundaryPushbackInputStream.java?revision=528680&pathrev=528680
> > 
> > I find length assignments of variables to int (max +- 64k) but no
> > mention of lengths to long or unsigned long datatypes
> > Do you know if there a JIRA ???
> >
> > Saludos Cordiales!
> > Martin--
> > This email message and any files transmitted with it contain 
> > confidential
> > information intended only for the person(s) to whom this email message 
> > is
> > addressed. If you have received this email message in error, please 
> > notify
> > the sender immediately by telephone or email and destroy the original
> > message without making a copy. Thank you.
> >
> >     ----- Original Message -----
> >     *From:* Jorge Fernandez 
> >     *To:* axis-user@ws.apache.org  ;
> >     [EMAIL PROTECTED] 
> >     *Sent:* Sunday, April 29, 2007 11:23 AM
> >     *Subject:* Re: Help with SwA
> >
> >     Hi Thilina,
> >
> >     With the new release that seems to work fine. But sadly :( , now
> >     I'm getting the following exception when trying to access the
> >     attachments with both MTOM or SwA at the client:
> >
> >     org.apache.axiom.om.OMException: javax.mail.MessagingException:
> >     Error reading input stream;
> >     nested exception is:
> >     java.io.IOException: End of Stream, but boundary not found
> >     at
> > 
> > org.apache.axiom.attachments.Attachments.getPart(Attachments.java:517)
> >     at
> > 
> > org.apache.axiom.attachments.Attachments.getNextPartDataHandler(Attachments.java:414)
> >     at
> > 
> > org.apache.axiom.attachments.Attachments.getContentIDSet(Attachments.java:386)
> >     at
> > 
> > org.apache.axiom.attachments.Attachments.getAllContentIDs(Attachments.java:379)
> >     at
> > 
> > client.Medici_LinkSOAP12PortStub.getAttachment(Medici_LinkSOAP12PortStub.java:4102)
> >     at client.ClientUtilities.mtomTest(ClientUtilities.java:531)
> >     at client.Client.main(Client.java:69)
> >     Caused by: javax.mail.MessagingException: Error reading input 
> > stream;
> >     nested exception is:
> >     java.io.IOException: End of Stream, but boundary not found
> >     at javax.mail.internet.MimeBodyPart.(MimeBodyPart.java:177)
> >     at
> > 
> > org.apache.axiom.attachments.PartOnMemory.(PartOnMemory.java:31)
> >     at
> > 
> > org.apache.axiom.attachments.Attachments.getPart(Attachments.java:513)
> >     ... 6 more
> >     Caused by: java.io.IOException: End of Stream, but boundary not 
> > found
> >     at
> > 
> > org.apache.axiom.attachments.BoundaryPushbackInputStream.read(BoundaryPushbackInputStream.java:230)
> >     at
> > 
> > org.apache.axiom.attachments.MIMEBodyPartInputStream.read(MIMEBodyPartInputStream.java:84)
> >     at java.io.BufferedInputStream.fill(Unknown Source)
> >     at java.io.BufferedInputStream.read1(Unknown Source)
> >     at java.io.BufferedInputStream.read(Unknown Source)
> >     at com.sun.mail.util.ASCIIUtility.getBytes(ASCIIUtility.java:246)
> >     at javax.mail.internet.MimeBodyPart.(MimeBodyPart.java:175)
> >     ... 8 more
> >
> >     I can see with TCPMon this:
> >
> >     HTTP/1.1 200 OK
> >     Server: Apache-Coyote/1.1
> >     Content-Type: multipart/related;
> >     boundary=MIMEBoundaryurn_uuid_2B201ECB17F697F7391177859246638;
> >     type="application/soap+xml";
> >     start="<0.urn:uuid:[EMAIL PROTECTED]>";
> >     action="urn:validateUser";charset=UTF-8Transfer-Encoding:
> >     chunkedDate: Sun, 29 Apr 2007 15:07:26
> > 
> > GMT423--MIMEBoundaryurn_uuid_2B201ECB17F697F7391177859246638Content-Type:
> >     application/soap+xml; charset=UTF-8Content-Transfer-Encoding:
> >     8bitContent-ID:
> >     <0.urn:uuid:[EMAIL PROTECTED]>
> >     
> >     
> >     xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope";>
> >     
> >     
> >     http://www.w3.org/2005/08/addressing/none
> >     
> >     
> > 
> > xmlns:axis2="http://ws.apache.org/namespaces/axis2";>urn:uuid:2B201ECB17F697F7391177859246088
> >     
> >     
> > 
> > urn:uuid:2B201ECB17F697F7391177859246104
> >     urn:validateUser
> > 
> > urn:uuid:7C37DED94C81AED4F81177859244163
> >     
> >     
> >     
> >     xmlns:ns3="http://op_messages.medici_link/xsd";>
> >     sim588929623218
> >     
> >     
> >     
> >     38
> >
> >     --MIMEBoundaryurn_uuid_2B201ECB17F697F7391177859246638
> >     2000
> >
> >     Content-Type: application/octet-stream
> >     Content-Transfer-Encoding: binary
> >     Content-ID:
> >     BM:/
> >     data............................
> >
> >     And this is the last line I can see with TCPMon
> >     <¥b;¤a:£_:¡]8ž]7›Z4šY3˜W1–U/"T
> >
> >     I'm sending a 11'8KB picture.
> >     With axis2 1.1.1 I had no problem with sending a picture that was
> >     about 24 KB. If I sent a larger one, I received it with errors and
> >     I couldn't see it correctly in the client but the response message
> >     seemed to be well formed.
> >
> >     Could you tell me, please if I have to do something else to send
> >     attachments in the service??
> >
> >
> >
> >     */Thilina Gunarathne /* escribió:
> >
> >         > org.apache.axis2.AxisFault: Invalid Application type.
> >         Support available for
> >         > MTOM & SwA/SOAP 1.l only.; nested exception is:
> >         > org.apache.axiom.om.OMException: Invalid Application type.
> >         Support
> >         > available for MTOM & SwA/SOAP 1.l only.
> >         You seem to be usign a old version of the axis2.. Please try the
> >         latest 1.2 release..
> >
> >         > But I don't know if this is right. Do I have to specify
> >         something in the
> >         > wsdl like I do when I use MTOM so the client could expect
> >         any attachment
> >         > when parsing the response message.
> >         MTOM is much better than SwA.. You can specify the type of the
> >         element
> >         containing the binary data as base64Binary...
> >
> >         Seems like you already have it in your WSDL, since you seem to
> >         be able
> >         to succesfully generate skeletons with MTOM suppport...
> >
> >         See http://ws.apache.org/axis2/1_2/mtom-guide.html#25 for more
> >         data...
> >
> >         Thanks,
> >         Thilina
> >         --
> >         Thilina Gunarathne - http://www.wso2.com -
> >         http://thilinag.blogspot.com
> >
> 
> >   ---------------------------------------------------------------------
> >         To unsubscribe, e-mail: [EMAIL PROTECTED]
> >         For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> >   ------------------------------------------------------------------------
> >
> >     LLama Gratis a cualquier PC del Mundo.
> >     Llamadas a fijos y móviles desde 1 céntimo por minuto.
> >     http://es.voice.yahoo.com
> > 
> > 
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Thilina Gunarathne  -  http://www.wso2.com - http://thilinag.blogspot.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



       
---------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com

Reply via email to