SOAP - Cannot parse an MTOM Packaging Response (xop:Include)

425 views
Skip to first unread message

Dany

unread,
Sep 24, 2012, 10:04:46 AM9/24/12
to Ensemble-in...@googlegroups.com
Hi ISC,

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 :

Goto:$listget($get(@tree@(data,0)),1)="e" XMLImportErr

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-ID: <http://tempuri.org/0>
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" 
               xmlns:xop="http://www.w3.org/2004/08/xop/include"/>
         </_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!

Thanks a lot,

Dany J.

Rodolfo Mendes

unread,
Sep 26, 2012, 7:09:15 AM9/26/12
to ensemble-in...@googlegroups.com
Hi Dany,

As this is a public group, I am not from ISC but maybe I can be of some help ;-)

First of all, which version of Caché/Ensemble are you using?
I suggest you take a look at http://docs.intersystems.com/ens20102/csp/docbook/DocBook.UI.Page.cls?KEY=GSOP_mtom#GSOP_mtom_example (remember that these docs belong to Caché/Ensemble version 2010.2).
There is a web client example that is a little different from your code.

Are you sure the server side is built correctly? Maybe you should validate that using an external tool like soapUI. It does support MTOM attachments.

Please share your results.
Best regards,

Rodolfo Mendes


--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en

Dany

unread,
Sep 27, 2012, 1:35:19 PM9/27/12
to Ensemble-in...@googlegroups.com, ensemble-in...@googlegroups.com
Hi Rodolfo,

Thanks for the answer. I developed my code according to this DocBook section.

Good news this morning : I found the problem. Now, I'm looking for a solution :)

The customer sends me a .NET SOAP MTOM message. The <xop:Include> content-id is written like this :

- http%3A%2F%2Ftempuri.org%2F1%2F634838351358690280

But the attachment content-id is written like this :


Looks like a "normal" microsoft .NET standard :) As I don't use the ".NET standard", the two content-id doesn't match at all, so the XMLParser is not able to fill my binary64 property.

Now I must tell the XMLParser to "URLDECODE" this particular URL. I really don't want to modify the XMLParser class. I'm currently looking for a property/parameter where I can set the URL decoding. I'm also thinking at overriding a method to dynamically change the content of the xop:Include tag... Anyone has an idea on the best practice?

Thanks a lot,

Dany J.
To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages