Solved

Error streaming with WCF

Posted on 2011-03-25
4
541 Views
Last Modified: 2012-06-21
I have been trying to set up streaming of files with a simple WCF service. It has two basic operations: upload and download. I continuously get the following error:

Content Type multipart/related;
type="application/xop+xml";start="<http://tempuri.org/p>";boundary="uuid:eb090162-5a98-4569-937b-63baaad88ee3+id=1";start-info="text/xml" was not supported by service http://localhost/FileService/Service1.svc. The client and service bindings may be mismatched.

I have been round and round looking for a solution. I still have not found one. Any help is appreciated. I have attached my client and service config files

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_IFileTransferService" closeTimeout="00:01:00"
          openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
          allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
          maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
          messageEncoding="Mtom" textEncoding="utf-8" transferMode="Streamed"
          useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost/FileService/Service1.svc"
        binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IFileTransferService"
        contract="FileServiceReference.IFileTransferService" name="BasicHttpBinding_IFileTransferService" />
    </client>
  </system.serviceModel>
</configuration>

Open in new window


<?xml version="1.0"?>

<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->

<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="serviceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"
                        httpHelpPageEnabled="true"/>
          <dataContractSerializer maxItemsInObjectGraph="2147483647"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="serviceBehavior"
               name="FileTransferService">
        <endpoint address=""
                  name="basicHttpStream"
                  binding="basicHttpBinding"
                  bindingConfiguration="BasicHttpBinding_IFileTransferService" 
                  contract="IFileTransferService">
        </endpoint>
        <endpoint address="mex"
                  binding="mexHttpBinding"
                  contract="IMetadataExchange">
        </endpoint>
      </service>
    </services>
    <bindings>
      <basicHttpBinding>
        <binding name="httpLargeMessageStream"
                 maxBufferSize="2147483647"
                 maxReceivedMessageSize="2147483647"
                 transferMode="Streamed"
                 messageEncoding="Mtom">
          <security mode ="None">
            <transport clientCredentialType="None"></transport>
          </security>
        </binding>        
        <binding name="BasicHttpBinding_IFileTransferService" closeTimeout="00:01:00"
                  openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                  allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                  maxBufferSize="2147483647" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647"
                  messageEncoding="Mtom" textEncoding="utf-8" transferMode="Streamed"
                  useDefaultWebProxy="true">
          <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
            maxBytesPerRead="4096" maxNameTableCharCount="16384" />
          <security mode="None">
            <transport clientCredentialType="None" proxyCredentialType="None"
              realm="" />
            <message clientCredentialType="UserName" algorithmSuite="Default" />
          </security>
        </binding>
      </basicHttpBinding>
    </bindings>
  </system.serviceModel>
  <system.web>
    <httpRuntime maxRequestLength="2147483647"/>
  </system.web>
</configuration>

Open in new window

0
Comment
Question by:aceswildab1
  • 2
  • 2
4 Comments
 
LVL 25

Expert Comment

by:apeter
ID: 35222773
Can we see your complete xml?

You are trying to access you service using Add service reference, proxy?
0
 

Accepted Solution

by:
aceswildab1 earned 0 total points
ID: 35230995
Yes, I was accessing it via Add service reference. What other XML are you looking for? You have both of the config files, which other were you looking for?
0
 
LVL 25

Expert Comment

by:apeter
ID: 35243255
Sorry...meant to ask for complete error message.

So you are trying to add reference from the same solution or you deployed in IIS and accessing it
0
 

Author Closing Comment

by:aceswildab1
ID: 36287021
I would like to just remove the question. It's been a few months now. I moved onto a different solution for the problem. The question was abandoned and should not be kept.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question