Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2006

Tip: Looking for answers? Try searching our database.

Warning: byte[], [XmlAttribute] and MTOM

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Marc Gravell - 03 Feb 2006 16:55 GMT
I don't know if this is an intentional feature change, or simply a bug...
but!

I recently upgraded a web service to WSE3, specifically to use MTOM in a
particular call. This worked, however something else unrelated went "snap"
in the process...

After much head-scratching, I identified it as a public byte[] property that
was marked with as [XmlAttribute]  - i.e. to be serialized inline with the
containing object-element. Under vanilla .Net WS everything was fine, but
with MTOM enabled this field ceased working - it would be read as 0 instead.
As it happens this represented a database timestamp, so it (oddly enough)
stopped a few things from working.

Changing this property to [XmlElement] and regenerating my proxy class
resolved this; this was the only change.

For ref, the markers in the proxy class changed from:
   [System.Xml.Serialization.XmlAttributeAttribute()]
   [System.ComponentModel.DefaultValueAttribute(0)]

To
   [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")]

Also note that I generate the proxies via
@"C:\Program Files\Microsoft WSE\v3.0\Tools\WseWsdl3.exe" /edb
/type:webClient /nologo /l:CS /n:%2 /out:%1 %3

(with obvious %1...%3; just included to indicate full calling syntax)

I've resolved it now, so I'm not panicking, but does anybody know if this is
by design? As I wasn't expecting it!!!

Marc
Marc Gravell - 03 Feb 2006 17:01 GMT
Oops - wrong group open in Outlook; will repost to
microsoft.public.dotnet.framework.webservices

Please disregard in this location

Marc

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.