2010-05-04 17 views
9

पढ़ते समय पार हो गया है। मेरे पास डब्ल्यूसीएफ सेवा है जो wsHttp बाइंडिंग का उपयोग करती है। सर्वर कॉन्फ़िगरेशन निम्नानुसार है:डब्ल्यूसीएफ - अधिकतम डेटाटेबल कैरेक्टर गिनती कोटा (16384) एक्सएमएल डेटा

<bindings> 
     <wsHttpBinding> 
     <binding name="wsHttpBinding" maxBufferPoolSize="2147483647" 
      maxReceivedMessageSize="2147483647"> 
      <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" 
      maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
      <security mode="None"> 
      <transport clientCredentialType="Windows" proxyCredentialType="None" 
       realm="" /> 
      <message clientCredentialType="Windows" negotiateServiceCredential="true" 
       algorithmSuite="Default" establishSecurityContext="true" /> 
      </security> 
     </binding> 
     </wsHttpBinding> 
    </bindings> 

क्लाइंट पक्ष में मैं डब्ल्यूसीएफ-सेवा का सेवा संदर्भ शामिल कर रहा हूं। यह बहुत अच्छा काम करता है यदि मेरे पास सीमित कार्य है, तो मेरे आईएसईसी में 9 0 ऑपरेशन कॉन्ट्रैक्ट का कहना है, लेकिन अगर मैं सेवा संदर्भ अपडेट करने में असमर्थ हूं तो मैं एक और ऑपरेशन कंट्रैक्ट जोड़ता हूं और न ही मैं उस सेवा संदर्भ को जोड़ सकता हूं। this आलेख में यह उल्लेख किया गया है कि उन कॉन्फ़िगरेशन फ़ाइलों को बदलकर (यानी devenv.exe.config, WcfTestClient.exe.config और SvcUtil.exe.config) यह काम करेगा, लेकिन उन कॉन्फ़िगरेशन फ़ाइलों में उन बाइंडिंग को भी शामिल करेगा, फिर भी त्रुटि यह बताती है कि

'http://10.0.3.112/MyService/Service1.svc/mex' डाउनलोड करने में त्रुटि हुई। अनुरोध HTTP स्थिति 400: खराब अनुरोध के साथ विफल रहा। मेटाडाटा में एक संदर्भ है जिसे हल नहीं किया जा सकता है: 'http://10.0.3.112/MyService/Service1.svc/mex'। एक्सएमएल दस्तावेज़ में एक त्रुटि है (1, 89549)। XML डेटा पढ़ने के दौरान अधिकतम नामांकित वर्ण गणना कोटा (16384) पार हो गया है। नामटेबल एक डेटा संरचना है जो एक्सएमएल प्रोसेसिंग के दौरान सामने आने वाले तारों को स्टोर करने के लिए उपयोग की जाती है - गैर-दोहराने वाले तत्वों के नाम वाले लंबे एक्सएमएल दस्तावेज, विशेषता नाम और विशेषता मान इस कोटा को ट्रिगर कर सकते हैं। XML पाठक बनाते समय XmlDictionaryReaderQuotas ऑब्जेक्ट पर MaxNameTableCharCount प्रॉपर्टी को बदलकर यह कोटा बढ़ाया जा सकता है। लाइन 1, स्थिति 89549. यदि सेवा वर्तमान समाधान में परिभाषित की गई है, तो समाधान बनाने और फिर से सेवा संदर्भ जोड़ने का प्रयास करें।

कोई विचार यह कैसे हल करें ????

अपने दृश्य स्टूडियो जहां devenv.exe स्थित है स्थापना निर्देशिका में (उदाहरण के लिए C: \ Program Files \ Microsoft Visual Studio 9.0 \ Common7 \ IDE) devenv को यह अनुभाग जोड़ने

उत्तर

11

का अनुसरण करें। exe.cofig

<system.serviceModel> 
<client> 
    <endpoint binding="customBinding" bindingConfiguration="largeServiceBinding" contract="IMetadataExchange" name="http" /> 
</client> 

<bindings> 
    <customBinding> 
    <!-- NOTE: The binding name must be the same as specified in the config file of the wcf service --> 
    <binding name="largeServiceBinding" > 
     <textMessageEncoding> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> 
     </textMessageEncoding> 

     <httpTransport transferMode="Buffered" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"/> 
    </binding> 

    </customBinding> 
</bindings> 
</system.serviceModel> 

अपने WCF सेवा की app.config में एक ही बंधन जोड़ें:

<bindings> 
    <customBinding > 
    <!-- NOTE: The binding name must be the same as specified in the devenv.exe.config file located ..\Common7\IDE folder of the VS installation directory --> 
    <binding name="largeServiceBinding" > 
     <textMessageEncoding> 
     <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" 
      maxNameTableCharCount="2147483647" /> 
     </textMessageEncoding> 
     <httpTransport transferMode="Buffered" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647"/> 
    </binding> 
    </customBinding> 
</bindings> 

ध्यान दें कि दो फ़ाइलों से बाध्यकारी टैग का नाम विशेषता (उदा।

<endpoint address="mex" binding="customBinding" contract="IMetadataExchange" bindingName="testBinding" bindingConfiguration="largeServiceBinding" name="http"/> 

इस कुछ ऐसा दिखाई देगा: पहचान करने के लिए

<services> 
    <service behaviorConfiguration="MyServiceBehavior" 
    name="MyService.MyService"> 
    <endpoint address="" binding="wsHttpBinding" contract="MyService.IMyService"> 
     <identity> 
     <dns value="localhost" /> 
     </identity> 
    </endpoint> 
    <endpoint address="mex" binding="customBinding" contract="IMetadataExchange" bindingName="testBinding" bindingConfiguration="largeServiceBinding" name="http"/> 
    <host> 
     <baseAddresses> 
     <add baseAddress="http://localhost:8731/Design_Time_Addresses/MyService/MyService/" /> 
     </baseAddresses> 
    </host> 
    </service> 
</services> 
+0

उत्तर के लिए धन्यवाद धन्यवाद और आपको परिणाम बताएगा। – Jankhana

+0

यह काम किया धन्यवाद। क्लाइंट में सर्विस एंडपॉइंट्स सेटिंग्स के बाद मुझे यह बदलना पड़ा कि यह काम करता है। धन्यवाद!!!! – Jankhana

+0

यह मेरे लिए भी काम करता था, लेकिन एक नया बाध्यकारी जोड़ने की कोई आवश्यकता नहीं थी, मैंने उपरोक्त के साथ 'readerQuotas' को अभी अपडेट किया था। – endyourif

1

एक बात है कि संदेश svcutil पाठक को संदर्भित करता है largeServiceBinding)

अंत में आपकी सेवा टैग में निम्नलिखित MEX endpoint जोड़ने कोटा सेवा नहीं है! Svcutil पर एक सीमा है कि यह कितना मेटाडाटा पढ़ सकता है। यह सीमा कॉन्फ़िगरेशन फ़ाइल के साथ बदला जा सकता है। समाधान svcutil के लिए एक विन्यास फाइल बनाने और उपकरण के समान फ़ोल्डर में रखने के लिए है। अगली बार जब आप svcutil चलाते हैं, तो कॉन्फ़िगरेशन फ़ाइल मानों को ध्यान में रखा जाएगा।

http://geekswithblogs.net/claraoscura/archive/2007/08/20/114806.aspx

1
अपने app.config या dll में

।क्लाइंट पर कॉन्फ़िगर करें:

<configuration> 
<system.serviceModel> 
<bindings> 
<netTcpBinding> 
<binding name="myMex" maxReceivedMessageSize="1024000"> <!-- modify this to avoid stupid error --> 
<readerQuotas maxNameTableCharCount="163840" /> <!-- DO NOT touch this one --> 
<security mode="None" /> 
</binding> 
</netTcpBinding> 
</bindings> 

... 

<client> 
<endpoint binding="netTcpBinding" bindingConfiguration="myMex" 
contract="IMetadataExchange" name="net.tcp" /> 

... 

     </client> 
    </system.serviceModel> 
</configuration> 

और वहां आप जाते हैं! यह डब्ल्यूसीएफ के साथ वास्तव में कष्टप्रद चीजों में से एक है और अक्सर Google आपको बस बीएस के बहुत सारे पैदा करता है। इसके साथ बहुत समय बर्बाद हो गया।

4

मैं जानता हूँ कि यह एक समय हो गया है, लेकिन मैं एक ही समस्या हो गया और अन्य (सरल) समाधान in codeproject

समाधान वहाँ दिए गए मान .config फ़ाइल कोड के बजाय में स्थापित कर रहे हैं में पाया।

 BasicHttpBinding binding = new BasicHttpBinding(); 
     binding.Security.Mode = BasicHttpSecurityMode.Transport; 
     binding.Security.Transport.ClientCredentialType = HttpClientCredentialType.Windows; 
     binding.MaxReceivedMessageSize = 50000000; 
     binding.ReaderQuotas.MaxArrayLength = 50000000; 
     binding.ReaderQuotas.MaxStringContentLength = 50000000; 
     binding.ReaderQuotas.MaxNameTableCharCount = 50000000; 
     EndpointAddress endpoint = new EndpointAddress(new Uri("https://server/EWS/Exchange.asmx")); 
     ExchangeServicePortTypeClient ews = new ExchangeServicePortTypeClient(binding, endpoint); 

हालांकि, मैं .config फ़ाइल में प्रासंगिक मूल्यों में मान बदले (दोनों <binding> और <readerQuotas> वर्गों में) और समस्या (बजाय जोड़ने कस्टम बाइंडिंग) हल:

   <binding name="ITransactionProcessor" closeTimeout="00:01:00" 
        openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" 
        allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" 
        maxBufferSize="50000000" maxBufferPoolSize="524288" maxReceivedMessageSize="50000000" 
        messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 
        useDefaultWebProxy="true"> 
        <readerQuotas maxDepth="32" maxStringContentLength="50000000" maxArrayLength="50000000" 
         maxBytesPerRead="4096" maxNameTableCharCount="50000000" /> 
        <security mode="TransportWithMessageCredential"> 
         <transport clientCredentialType="None" proxyCredentialType="None" 
          realm="" /> 
         <message clientCredentialType="UserName" algorithmSuite="Default" /> 
        </security> 
       </binding> 

मुझे उम्मीद है कि यह किसी की मदद करेगा :)

संबंधित मुद्दे