.net - WSE 3.0 - Byte array being encoded as Base64 and not "MTOM-ing" to binary -
.net - WSE 3.0 - Byte array being encoded as Base64 and not "MTOM-ing" to binary -
i have couple of other questions on here surrounding area bit redundant now. answers them appreciated question main concern @ minute.
i have followed lots of examples of how mtom/xop works in wse 3.0 , have set project seems required. have byte array field designated datatype:-base64binary. in set byte array of attachment want add. when run application , check request, info encoded inline base64, i.e. without xop include element , associated mime part.
my understanding of mtom within wse 3.0 that, when encoding take field designated base64binary , encode binary , move mime part, replacing xop include element. say, worked. have set service, in reference file, inherit microsoft.web.services3.webservicesclientprotocol
, have set requiremtom
flag true, , still not encoding correctly.
have missed here? there other steps should implemented work?
edit: after looking through code 100th time, wondering if might due fact have serialise payload before running processmessage method. sound problem? reason have serialised because method have utilize accepts "payload" parameter has content property, content property xmlelement property , way can serialise required class. stop mtom recognising info type of base64 field , hence not converted binary mime parts , xop? clutching @ straws now.
edit 2: while have solution below, 3rd party company saying our namespace prefixes wrong! have <q1:attachment xmlns:q1="http://whatever" />
, demanding <s:attachment xmlns:s="http://whatever" />
. going mad or not matter? there way can tell how assign namespace prefixes?
ok figured out , serialisation before invoking method. rewrote class passed in method didn't require xmlelement property, , hence pre-serialised class, , passed in. works correctly, after 3 or 4 weeks of work...if wants more clarification can seek downwards here.
edit: in response john saunders comment. when pre-serialised mean class, containing byte array, serialised xml before sending within web method. due fact class beingness sent in web method accepted xmlelement. reworked class, parameter of web method, take other class without beingness serialised xml beforehand.
ie. how class looks now. processrepairorder
field , pro()
property added , used instead of anyfield
partial public class content private anyfield system.xml.xmlelement private idfield string private anyattrfield() system.xml.xmlattribute 'this added private processrepairorder processrepairorder 'this added '''<remarks/> <system.xml.serialization.xmlelementattribute([elementname]:="processrepairorder", [namespace]:="http://www.starstandards.org/star")> _ public property pro() processrepairorder homecoming me.processrepairorder end set(byval value processrepairorder) me.processrepairorder = value end set end property '''<remarks/> <system.xml.serialization.xmlanyelementattribute()> _ public property any() system.xml.xmlelement homecoming me.anyfield end set(byval value system.xml.xmlelement) me.anyfield = value end set end property '''<remarks/> <system.xml.serialization.xmlattributeattribute(datatype:="token")> _ public property id() string homecoming me.idfield end set(byval value string) me.idfield = value end set end property '''<remarks/> <system.xml.serialization.xmlanyattributeattribute()> _ public property anyattr() system.xml.xmlattribute() homecoming me.anyattrfield end set(byval value system.xml.xmlattribute()) me.anyattrfield = value end set end property end class
with regards specific namespaces, added field required classes such:
<system.xml.serialization.xmlnamespacedeclarations()> _ public xmlns xmlserializernamespaces
then able add together namespace using:
dim ns new serialization.xmlserializernamespaces ns.add("s", "http://whatever") class.xmlns = ns
.net soap mtom wse xop
Comments
Post a Comment