Messsage traces please..:)

On 5/1/07, Jorge Fernandez <[EMAIL PROTECTED]> wrote:
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




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

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

Reply via email to