WPF+MVC+WCF big picture Upload echo Demo

Source: Internet
Author: User

This example says WCF configuration, MVC and WPF are not explained!

Effect:

Demo Hierarchy:

MVC client:
Connect the WCF service, convert the picture to stream, and then upload the stream in a byte[] way!

Core code

WCF Service side:
With IIS as the host, the HTTP protocol implements the receiving client's byte[] data, which is returned to the WPF client!
Server Web. config configuration is very important, in order to achieve large image data transfer, you need to add to the binding
<binding name= "imageoperationservice_binding" maxbufferpoolsize= "2147483647" maxbuffersize= "2147483647" Maxreceivedmessagesize= "2147483647" >
<readerquotas maxdepth= "2147483647" maxstringcontentlength= "2147483647" maxarraylength= "2147483647" Maxbytesperread= "2147483647" maxnametablecharcount= "2147483647"/>

Add under the system.web node
<system.web>
<compilation debug= "true"/>
</system.web>

The client also needs to configure the same information

---------------------------------------------------------------------The following is the service-side configuration code------------------------------------------ ---------------------------
<?xml version= "1.0"?>
<configuration>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name= "Imageoperationservice_behavior" >
<servicemetadata httpgetenabled= "true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<basicHttpBinding>
<binding name= "imageoperationservice_binding" maxbufferpoolsize= "2147483647" maxbuffersize= "2147483647" Maxreceivedmessagesize= "2147483647" >
<readerquotas maxdepth= "2147483647" maxstringcontentlength= "2147483647" maxarraylength= "2147483647" Maxbytesperread= "2147483647" maxnametablecharcount= "2147483647"/>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorconfiguration= "Imageoperationservice_behavior" name= "LshDemo.Service.ImageOperationService" >
<endpoint address= "Http://192.168.1.75/ImageOperationService.svc" binding= "BasicHttpBinding" bindingconfiguration= "imageoperationservice_binding" contract= "LshDemo.Service.IImageOperationService"/>
</service>
</services>
</system.serviceModel>
<system.web>
<compilation debug= "true"/>
</system.web>
</configuration>

WPF client:
The boot thread listens to the WCF service picture information, reads the WCF service byte stream in time, displays in the interface!

Core code:

Demo download link: http://yunpan.cn/cfpygtIvCqjUv;
Extract Code b289

WPF+MVC+WCF big picture Upload echo Demo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.