sending stream through wcf
-
Im my application, on click of button i am running a service where i am reading a image from file . Converting the image to stream and sending back in the form of Stream .But on the application i am not getting the stream data . It is empty. CAN someone guide me in this. :zzz:
-
Im my application, on click of button i am running a service where i am reading a image from file . Converting the image to stream and sending back in the form of Stream .But on the application i am not getting the stream data . It is empty. CAN someone guide me in this. :zzz:
Since you're making us guess... First thing I can think of is the stream is never flushed and/or closed. Are you using buffered transfer mode or streaming transfer mode?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
Since you're making us guess... First thing I can think of is the stream is never flushed and/or closed. Are you using buffered transfer mode or streaming transfer mode?
Mark Salsbery Microsoft MVP - Visual C++ :java:
i have not mentioned any transfer mode. my config file is like <service name="LumedxPatientStudy.PatientStudy" behaviorConfiguration="LumedxPatientStudy.PatientStudyBehavior"> <host> <baseAddresses> <add baseAddress = "http://localhost:8731/Design\_Time\_Addresses/LumedxPatientStudy/PatientStudy/" /> </baseAddresses> </host> <!-- Service Endpoints --> <!-- Unless fully qualified, address is relative to base address supplied above --> <endpoint address ="" binding="wsHttpBinding" bindingConfiguration ="WSHttpBinding_IPatientStudy" contract="LumedxPatientStudy.IPatientStudy"> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IPatientStudy" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="102400000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false" > <readerQuotas maxDepth="32" maxStringContentLength="102400000" maxArrayLength="2000000" maxBytesPerRead="4096" maxNameTableCharCount="1000000" /> </binding> </wsHttpBinding> </bindings>
-
i have not mentioned any transfer mode. my config file is like <service name="LumedxPatientStudy.PatientStudy" behaviorConfiguration="LumedxPatientStudy.PatientStudyBehavior"> <host> <baseAddresses> <add baseAddress = "http://localhost:8731/Design\_Time\_Addresses/LumedxPatientStudy/PatientStudy/" /> </baseAddresses> </host> <!-- Service Endpoints --> <!-- Unless fully qualified, address is relative to base address supplied above --> <endpoint address ="" binding="wsHttpBinding" bindingConfiguration ="WSHttpBinding_IPatientStudy" contract="LumedxPatientStudy.IPatientStudy"> <bindings> <wsHttpBinding> <binding name="WSHttpBinding_IPatientStudy" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" maxReceivedMessageSize="102400000" messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false" > <readerQuotas maxDepth="32" maxStringContentLength="102400000" maxArrayLength="2000000" maxBytesPerRead="4096" maxNameTableCharCount="1000000" /> </binding> </wsHttpBinding> </bindings>
What does the contract and its implementation look like?
Mark Salsbery Microsoft MVP - Visual C++ :java:
-
What does the contract and its implementation look like?
Mark Salsbery Microsoft MVP - Visual C++ :java:
<endpoint address ="" binding="basicHttpBinding" bindingConfiguration ="BasicHttpBinding_IPatientStudy" contract="LumedxPatientStudy.IPatientStudy"> <basicHttpBinding> <binding name="BasicHttpBinding_IPatientStudy" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="204003200" messageEncoding="Mtom" transferMode="Streamed" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="2000000" maxArrayLength="16384" maxBytesPerRead="54096" maxNameTableCharCount="16384" /> <!--<security mode="TransportCredentialOnly">--> <!--<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />--> <!--<message clientCredentialType="UserName" algorithmSuite="Default" /> </security>--> </binding> </basicHttpBinding>
-
<endpoint address ="" binding="basicHttpBinding" bindingConfiguration ="BasicHttpBinding_IPatientStudy" contract="LumedxPatientStudy.IPatientStudy"> <basicHttpBinding> <binding name="BasicHttpBinding_IPatientStudy" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:10:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="204003200" messageEncoding="Mtom" transferMode="Streamed" useDefaultWebProxy="true"> <readerQuotas maxDepth="32" maxStringContentLength="2000000" maxArrayLength="16384" maxBytesPerRead="54096" maxNameTableCharCount="16384" /> <!--<security mode="TransportCredentialOnly">--> <!--<transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />--> <!--<message clientCredentialType="UserName" algorithmSuite="Default" /> </security>--> </binding> </basicHttpBinding>
That's configuration - I asked about the service contract - the LumedxPatientStudy.IPatientStudy interface and its implementation (just the service operation you're having trouble with is fine).
Mark Salsbery Microsoft MVP - Visual C++ :java: