Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. MTOM and .NET question

MTOM and .NET question

Scheduled Pinned Locked Moved .NET (Core and Framework)
helpcsharpwcfxmlquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Antessima
    wrote on last edited by
    #1

    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?

    L 1 Reply Last reply
    0
    • A Antessima

      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?

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Antessima wrote:

      If you were to write an app in .NET to upload and download documents using MTOM, where would you start?

      Google, which always points me back to MSDN. Seems they have a sample[^].

      Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

      A 1 Reply Last reply
      0
      • L Lost User

        Antessima wrote:

        If you were to write an app in .NET to upload and download documents using MTOM, where would you start?

        Google, which always points me back to MSDN. Seems they have a sample[^].

        Bastard Programmer from Hell :suss: If you can't read my code, try converting it here[^]

        A Offline
        A Offline
        Antessima
        wrote on last edited by
        #3

        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

        L 1 Reply Last reply
        0
        • A Antessima

          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

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          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[^]

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups