I need to pull a zip file from an MTOM SOAP message. The client uses a <xop:Include> tag and the binary file seems to be well tagged at the end of the message. In fact, the SOAP message received looks pretty good. But an error occurs when the code parses the <xop:Include> tag. It fails on this line of code :
where @tree@(data) is the <xop:Include> tag. As the <xop:Include> tag has been marked as an ELEMENT (e) in the XML tree, an XMLImportErr is triggered. This Include tag was clearly unexpected (as an ELEMENT).
The problem is that I've not builded any XML tree : it is automatically done by the XMLParser class.
The SOAP message received (partial) :
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
--uuid:0de6fa5f-a1a0-4f77-9d74-a4a4db0c721a+id=17
Content-Transfer-Encoding: 8bit
Content-Type: application/xop+xml;charset=utf-8;type="text/xml"
<s:Body>
<DemanderLotResponse xmlns="WSURL">
<_bytContFich>
<xop:Include
href="cid:http%3A%2F%2Ftempuri.org%2F1%2F634838351358690280"
</_bytContFich>
</DemanderLotResponse>
</s:Body>
</s:Envelope>
--uuid:0de6fa5f-a1a0-4f77-9d74-a4a4db0c721a+id=17
Content-Transfer-Encoding: binary
Content-Type: application/octet-stream
PK Ût5AŠâ Œb Õ
-- VERY LONG CONTENT --
__________________________________________________________
An output of the XML tree automatically created :
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
e|Envelope
e|Body
e|DemanderLotResponse
e|_bytContFich
e|Include <=================================
Maybe there is something wrong in my WebService class definition. I've setted the MTOM attributes :
__________________________________________________________
...
Parameter MTOMREQUIRED = 1;
...
Method DemanderLot(ByRef bytContFich As %xsd.base64Binary(XMLNAME="_bytContFich",MTOM=1))
[ Final, ProcedureBlock = 1, SoapBindingStyle = document, SoapBodyUse = literal, WebMethod ]
{
Set ..MTOMRequired = 1
Do (..WebMethod("DemanderLot")).Invoke($this,"WSURL",.bytContFich)
}
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Anyone has an idea on this one? Am I missing something on the receiving side of an MTOM package? Should I build my own XML parser? As ISC manages the MTOM technology, I'm sure there is a simple solution to my problem!
Dany J.