[Problem Summary] issues encountered in WCF host and IIS

Source: Internet
Author: User
Tags website server xml reader

Recently, a small video processing website was developed in the company. Due to video processing, the website is on different servers, therefore, when processing videos, you must request the video processing server to process the videos on the website server and return the results. After writing this WCF Service, I encountered a lot of problems when boarding to IIS. The following describes the problem and the solution.

Question 1:

Since the WCF Service here adopts the "wshttpbinding" mode, that is, the secure binding mode, the end point configuration (endpoint) generated by the Client After referencing this service becomes
<Endpoint address ="Server machine name/*. SVC "> if it is in the LAN, it is no problem to access the server through the machine name. Because the video processing server is not local, the machine name cannot access the server in the WAN, an unresolvable exception is reported.

"System. servicemodel. endpointnotfoundexception) (system. Exception) (E. Result). innerexception

No endpoints are listening for http: // www-b5fbb257931: 8080/videoservice. SVC that can receive messages. This is usually caused by incorrect addresses or soap operations. If this happens, see innerexception for details ."

Solution:
Manually modify the endpoint configuration: <endpoint address = "IP Address/videoservice. SVC">

Question 2:

The previous problem is solved, and the new problem comes again. Because of the wshttpbingding method, this direct access to the server through the IP address will be considered as an insecure access by the server, an exception is reported, indicating that the access is denied.
Solution:
Modify the server configuration file as follows:

<System. servicemodel>



bindingconfiguration =" wshttpbindingconfiguration " contract =" videoservice. web. ivideoservice ">




NT address =" mex "binding =" mexhttpbinding "Contract =" imetadataexchange "/>

</Service>
</Services>
<Bindings>
<Wshttpbinding>
<Binding name = "wshttpbindingconfiguration" maxcompute edmessagesize = "20971510">
<Readerquotas maxstringcontentlength = "20971520" maxarraylength = "20971520"/>
<Security mode = "NONE"/>
</Binding>
</Wshttpbinding>
</Bindings>
</System. servicemodel>

In this way, the server will not undergo security authentication.

Question 3:

Since I want to transfer files to the server when processing video requests to the server, my approach is to convert the files into binary byte [] Data Types for transmission, however, since the data size transmitted by WCF by default is only 64 K, when the size of the file passed exceeds this value, the message "the maximum array length quota (16384) is exceeded when WCF reads XML data ). You can add this quota by changing the maxarraylength attribute of the xmldictionaryreaderquotas object used when creating an XML reader. ". For more information, see innerexception ."

Solution:
Modify the server configuration file:

<System. servicemodel>



NT address =" "binding =" wshttpbinding " bindingconfiguration =" wshttpbindingconfiguration " contract =" videoservice. web. ivideoservice ">




</Service>
</Services>
<Bindings>
<Wshttpbinding>
<Binding name = "wshttpbindingconfiguration" maxcompute edmessagesize = "20971510">
<Readerquotas maxstringcontentlength = "20971520" maxarraylength = "20971520"/>
<Security mode = "NONE"/>
</Binding>
</Wshttpbinding>
</Bindings>
</System. servicemodel>

Then modify the client configuration file:
<Bindings>
<Wshttpbinding>
<Binding name = "wshttpbinding_ivideoservice" closetimeout = "00:01:00"
Opentimeout = "00:01:00" receivetimeout = "00:10:00" sendtimeout = "00:01:00"
Bypassproxyonlocal = "false" transactionflow = "false" hostnamecomparisonmode = "strongwildcard"
Maxbufferpoolsize = "524288" maxcompute edmessagesize = "65536" messageencoding = "text"
Textencoding = "UTF-8" usedefawebwebproxy = "true" allowcookies = "false">
<Reliablesession ordered = "true" inactivitytimeout = "00:10:00"
Enabled = "false"/>
<Readerquotas maxdepth = "32" maxstringcontentlength = "20971520" maxarraylength = "20971520"
Maxbytesperread = "40960" maxnametablecharcount = "163840"/>
<Security mode = "NONE">
<Transport clientcredentialtype = "Windows" proxycredentialtype = "NONE"
Realm = ""/>
<Message clientcredentialtype = "Windows" negotiateservicecredential = "true"
Algorithmsuite = "default" establishsecuritycontext = "true"/>
</Security>
</Binding>
</Wshttpbinding>
</Bindings>

Question 4:

When I upload files to the server in Silverlight, the "notfound" exception is always reported,

This is caused by the limitation of the file upload size in the WCF configuration. You can modify it in the webconfi file. Add configurations similar to the followingCode

<Basichttpbinding>
<Binding name = "largebuffer" maxbuffersize = "2147483647" maxcompute edmessagesize = "2147483647" textencoding = "UTF-8" sendtimeout = "00:05:10" receivetimeout = "00:05:10" opentimeout = "00:05:10" closetimeout =" 00:05:10 ">
<Readerquotas maxdepth = "2147483647" maxstringcontentlength = "2147483647" maxarraylength = "2147483647" maxbytesperread = "2147483647" maxnametablecharcount = "2147483647"/>
</Binding>
</Basichttpbinding>

 

In this way, the data transmission volume of WTF is modified, and the problem is solved. I hope you can quickly eliminate these problems in the future.

From: http://www.cnblogs.com/ccmaycry/archive/2009/08/28/1555934.html

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.