0

I'm generally looking for some kind of feedback on wcf service where I'm a complete beginner. Basically the client needs to transfer xml files and images to the service as well as be able to pull down datasets/or xml files from the service. I have set up a wsDualHttpBinding duplex contract to allow this(callbacks). My main three questions are:

  1. Is setting up a duplex contract the only way to achieve back/forth data transfer?
  2. With wsDualHttpBinding, I can't stream apparently, if my files are no bigger than 10mb, is that normal to let that buffer and then send it up to the service?
  3. What is the best way to send a .jpg image up to the service?

I really could use some feedback please, wcf can be very complex and finding the correct way of doing something isn't easy for a beginner. Havn't had much feedback from previous questions on this topic.

Edit: After setting up stream, getting error for endpoint not following http protocol

  <binding name="duplexendpointserver"
                maxReceivedMessageSize="2147483647"
                transferMode="Streamed"
                messageEncoding="Mtom">
      <security mode="TransportCredentialOnly">
        <message clientCredentialType="UserName" />
      </security>
    </binding>         <!--<reliableSession ordered="true" inactivityTimeout="00:10:00"/>-->
    <!--</binding>-->
  </basicHttpBinding>
</bindings>


<services>
  <service name="Votex.Service.WCFServices" behaviorConfiguration="svcbh">
    <endpoint name="duplexendpoint" address="" binding="basicHttpBinding" bindingConfiguration="duplexendpointserver" contract="Votex.Service.IWCFServices" ></endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
TMan
  • 4,044
  • 18
  • 63
  • 117

1 Answers1

1

Check out this MSDN article on Large Data and Streaming.

  1. You can set up a service to have methods that can send and receive without a duplex contract.
    • void Upload(Stream uploadStream)
    • Stream Download(string fileName))
  2. You can only use streams with the following bindings: BasicHttpBinding, NetTcpBinding, NetNamedPipeBinding, and WebHttpBinding.
  3. I would recommend you read the entire article I linked above and that should get you started.
TylerOhlsen
  • 5,485
  • 1
  • 24
  • 39
  • So I set my streaming up, I'm getting an error in the client when I try to pass a stream to the service basically saying that possibly the endpoint address isn't following http protocol. Any idea on why this could be? – TMan Jan 04 '13 at 03:21
  • Can you post your endpoint and binding configuration? FYI, the article has a typo... transferMode="Streamed" (not "Streaming") – TylerOhlsen Jan 04 '13 at 03:45
  • OK I went ahead and posted the needed web.config from the service. Thanks for the help btw – TMan Jan 04 '13 at 14:12
  • OK I figured it out, I was still implementing the my ICallback interface when I had it configured for duplex contract, it didn't like that. I turned on trace listening and saw the error. Thanks for the help. – TMan Jan 04 '13 at 14:55
  • Good deal. Glad you found the problem and glad I could help. =) – TylerOhlsen Jan 04 '13 at 15:11