MTOM and .NET question
-
I've been working on a new .NET client to replace my organization's Java tool that they've been using for consuming a web service. Nobody here knows much Java, nor do they care to learn it. Since .NET is my background anyway, I was tasked with getting this to work. Everything works except downloading documents. The web service is configured to send them as MTOM attachments. The server side works fine because I can execute the API calls in SoapUI without any trouble, but when I added the service reference via svcutil to my .NET client, it didn't auto-configure to look for and decode MTOM attachments; instead, I get the error message about "client was looking for text/xml and found multipart/xml", etc. I did a lot of searching to find information about configuring it to look for MTOM, but the problem is that svcutil didn't configure the proxy class from System.ServiceModel, but rather built it on System.Web.Services. I can't find examples that use System.Web.Services, so I'm rather in the dark. I've already asked for specific help about how to fix the current client on Stack Overflow[^] and on MSDN[^], and in the 3-4 days since, haven't even gotten a comment. So, that's not what I'm after here. What I want to know is this: If you were to write an app in .NET to upload and download documents using MTOM, where would you start?
-
I've been working on a new .NET client to replace my organization's Java tool that they've been using for consuming a web service. Nobody here knows much Java, nor do they care to learn it. Since .NET is my background anyway, I was tasked with getting this to work. Everything works except downloading documents. The web service is configured to send them as MTOM attachments. The server side works fine because I can execute the API calls in SoapUI without any trouble, but when I added the service reference via svcutil to my .NET client, it didn't auto-configure to look for and decode MTOM attachments; instead, I get the error message about "client was looking for text/xml and found multipart/xml", etc. I did a lot of searching to find information about configuring it to look for MTOM, but the problem is that svcutil didn't configure the proxy class from System.ServiceModel, but rather built it on System.Web.Services. I can't find examples that use System.Web.Services, so I'm rather in the dark. I've already asked for specific help about how to fix the current client on Stack Overflow[^] and on MSDN[^], and in the 3-4 days since, haven't even gotten a comment. So, that's not what I'm after here. What I want to know is this: If you were to write an app in .NET to upload and download documents using MTOM, where would you start?
-
I'd been to that page many, many times already, and it wasn't much help. The problem was that I didn't know how to get from just having a WSDL doc to that point. Funny how you can Google "MTOM .NET" and "WCF MTOM" and "WCF MTOM .NET Client" all day long and get lots of stuff that doesn't fit the bill, but if you just Google "WCF Client", like I finally did yesterday around 1:30pm, you get this[^] as your fourth result. I've since followed the instructions on that page, and, combined with a little help finding the right WSDL for WCF (the original didn't have the necessary data to implement in WCF) and finding additional instructions[^] on how to use svcutil via the command line to generate a WCF-compliant proxy class, I now have exactly what I was looking for. :-D
-
I'd been to that page many, many times already, and it wasn't much help. The problem was that I didn't know how to get from just having a WSDL doc to that point. Funny how you can Google "MTOM .NET" and "WCF MTOM" and "WCF MTOM .NET Client" all day long and get lots of stuff that doesn't fit the bill, but if you just Google "WCF Client", like I finally did yesterday around 1:30pm, you get this[^] as your fourth result. I've since followed the instructions on that page, and, combined with a little help finding the right WSDL for WCF (the original didn't have the necessary data to implement in WCF) and finding additional instructions[^] on how to use svcutil via the command line to generate a WCF-compliant proxy class, I now have exactly what I was looking for. :-D
Antessima wrote:
I'd been to that page many, many times already, and it wasn't much help
Yup, that's how MSDN is often described :)
Antessima wrote:
I now have exactly what I was looking for. :-D
Well deserved :thumbsup:
Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]