Hi Amila,
I do not have the .NET service right now to try it out - but I am attaching a
snapshot taken earlier of the request from the .NET service captured in tcpmon.
From that, I see that the AppendChunkRequestElement has namespace=
xmlns="http://ws.selectica.com/ecm/"
The if condition in AppendChunkRequestElement.java is "if
(reader.isStartElement() && new
javax.xml.namespace.QName("http://ws.selectica.com/ecm/","Offset").equals(reader.getName()))"
- it does not enter that if body. The else part does not do anything other
than throw the above exception.
- Vish.
________________________________
From: Amila Suriarachchi [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 06, 2007 9:53 PM
To: [email protected]
Subject: Re: [Axis2] MTOM Exception with Axis2 1.3
"org.apache.axis2.databinding.ADBException: Unexpected subelement Buffer"
On Dec 7, 2007 10:49 AM, Pantvaidya, Vishwajit <[EMAIL PROTECTED]<mailto:[EMAIL
PROTECTED]>> wrote:
I am using Axis2 1.3 to receive a pdf doc using MTOM from a .NET 2.0 WSE 3.0 C#
client. I am already using an axiom jar from a nightly build that has Thilina's
patch
(https://issues.apache.org/jira/browse/AXIS2-3196?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12541070
).
I get the above error in the AppendChunkRequestElement class created by
wsdl2java when it tries to parse the MTOM request received from .NET. The .NET
client creates a byte array and sets it into the AttachmentData element. The
complete request element is defined in wsdl as follows:
<s:complexType name="AttachmentType">
<s:sequence>
<
s:element maxOccurs="1" minOccurs="0" name="AttachmentData"
type="s:base64Binary"
/>
</s:sequence>
</s:complexType>
<s:element
name="AppendChunkRequestElement">
<s:complexType>
<s:sequence>
<s:element
name="ClientWorkingFolderOnServer" type="s:string"/>
<s:element name="FileName"
type="s:string"/>
<
s:element name="Buffer" type="tns:AttachmentType"/>
<s:element name="Offset"
type="s:long"/>
<s:element name="BytesRead"
type="s:int"
/>
</s:sequence>
</s:complexType>
</s:element
>
After stepping thru the factory code I see that it parses Buffer and expects
Offset next. As far as I can see from Eclipse variables snapshot, the next
element is Offset. But for some reason it does not find it and throws above
error.
Does this match the namespce as well. if you go through the parse method you
can see there is an if statement for this. does it go inside the if statement?
Can you paste that code?
thanks,
Amila.
Strangest thing is - I asked the .NET client guy to set a non-binary bytearray
like byte[0]=0,byte[1]=1, etc into AttachmentData element and send it thru'
MTOM and then it works. Why does it not work with the PDF file byte[].
Does the .NET client have to transform the file into a base64 encoded array
before sending it to me? Any other suggestions?
Thanks,
Vish.
--
Amila Suriarachchi,
WSO2 Inc.
ÿþP O S T / s e r v i c e s / E C M S e r v i c e S o a p H T T P / 1 . 1
U s e r - A g e n t : M o z i l l a / 4 . 0 ( c o m p a t i b l e ;
M S I E 6 . 0 ; M S W e b S e r v i c e s C l i e n t
P r o t o c o l 2 . 0 . 5 0 7 2 7 . 8 3 2 )
V s D e b u g g e r C a u s a l i t y D a t a :
u I D P o 2 4 2 r 3 B I g C J H g y Y A I t W j / T Q A A A A A k D s M y e w H 8 E y K 4 X 1 J F 6 6 y X s E q Q 3 Y j S 0 J L p W Z G J u p V 8 / A A C A A A
S O A P A c t i o n : "