6

मैं शुरुआती लोगों को डेमो वीडियो के साथ MSDN पर डब्ल्यूसीएफ पेज पर अनुसरण करने का प्रयास कर रहा हूं।"एंडपॉइंट्स के साथ सेवाओं को कॉन्फ़िगर करना" डेमो मेरे लिए विफल रहता है (माइक्रोसॉफ्ट/एंडपॉइंट.tv/Pluralsight)

पहला वीडियो कम या ज्यादा ठीक काम करता था। मैं अब दूसरे वीडियो के अंत में हूं। मैं वीएस -2010/.NET 4.0 का उपयोग कर रहा हूं, जबकि वीडियो वीएस -2008 का उपयोग कर रहा है (मैं .NET 3.5 मान रहा हूं, लेकिन मुझे याद नहीं है)। एक सादे http, net.tcp, और net.pipe:

I'm using the following demo

हम सिर्फ 3 और अंत अंक जोड़ दिया है। जब मैं प्रोजेक्ट को चलाने की कोशिश करता हूं तो वेब सेवा शुरू करने में विफल रहता है। बस अभी तक "Cannot load the X.509 certificate identity specified in the configuration"

मैं वास्तव में प्रमाण पत्र में शामिल हो नहीं करना चाहता था क्योंकि मैं अभी भी सिर्फ इसलिए मैं पीछा मूल बातें के साथ प्रयोग कर रहा हूँ:

System.InvalidOperationException: Cannot load the X.509 certificate identity specified in the configuration. 
    at System.ServiceModel.Description.ConfigLoader.LoadIdentity(IdentityElement element) 
    at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) 
    at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) 
    at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName) 
    at System.ServiceModel.ServiceHostBase.ApplyConfiguration() 
    at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) 
    at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) 
    at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) 
    at Microsoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(Type type, ServiceKind kind) 
    at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info) 

मेरे गूगल फू के आधार पर, मैं इस सूत्र में आए उस पोस्ट में सलाह और बस <dns value="localhost" /> टैग जोड़ा गया। अपवाद परिवर्तन:

Please try changing the HTTP port to 8732 or running as Administrator. 
System.ServiceModel.AddressAccessDeniedException: HTTP could not register URL http://+:8080/EvalService/. Your process does not have access rights to this namespace (see http://go.microsoft.com/fwlink/?LinkId=70353 for details). ---> System.Net.HttpListenerException: Access is denied 
    at System.Net.HttpListener.AddAllPrefixes() 
    at System.Net.HttpListener.Start() 
    at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen() 
    --- End of inner exception stack trace --- 
    at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen() 
    at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener) 
    at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback) 
    at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.HttpChannelListener.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.DatagramChannelDemuxer`2.OnOuterListenerOpen(ChannelDemuxerFilter filter, IChannelListener listener, TimeSpan timeout) 
    at System.ServiceModel.Channels.SingletonChannelListener`3.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.NegotiationTokenAuthenticator`1.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.CommunicationObjectSecurityTokenAuthenticator.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityUtils.OpenTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityProtocolFactory.Open(String propertyName, Boolean requiredForForwardDirection, SecurityTokenAuthenticator authenticator, TimeSpan timeout) 
    at System.ServiceModel.Security.SymmetricSecurityProtocolFactory.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityProtocolFactory.Open(Boolean actAsInitiator, TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.SecurityChannelListener`1.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionSecurityTokenAuthenticator.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.CommunicationObjectSecurityTokenAuthenticator.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityUtils.OpenCommunicationObject(ICommunicationObject obj, TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityUtils.OpenTokenAuthenticatorIfRequired(SecurityTokenAuthenticator tokenAuthenticator, TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionServerSettings.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Security.WrapperSecurityCommunicationObject.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SecuritySessionServerSettings.Open(TimeSpan timeout) 
    at System.ServiceModel.Security.SecurityListenerSettingsLifetimeManager.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.SecurityChannelListener`1.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout) 
    at System.ServiceModel.Channels.CommunicationObject.Open() 
    at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info) 
System.Net.HttpListenerException (0x80004005): Access is denied 
    at System.Net.HttpListener.AddAllPrefixes() 
    at System.Net.HttpListener.Start() 
    at System.ServiceModel.Channels.SharedHttpTransportManager.OnOpen() 

तो, मैं क्या कर यह क्या कहा की कोशिश की: पोर्ट को बदलने 8732 हो सकता है, लेकिन अपवाद अभी भी फेंक दिया जाता है, इस बार Please try changing the HTTP port to 8732...HTTP could not register URL http://+:8732/EvalService/... कह। : पी

मैंने बिना किसी लाभ के नए अंत बिंदुओं पर टिप्पणी करने का प्रयास किया है। यहां तक ​​कि मूल भी इस त्रुटि से असफल हो जाते हैं। कोई फर्क नहीं पड़ता या तो अगर मैं उन्हें मूल बंदरगाह में वापस डाल [नहीं तो] 1337

यहाँ App.config है, और कुछ नहीं के रूप समस्याग्रस्त बाहर खड़ा है:

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 
    <system.web> 
    <compilation debug="true" /> 
    </system.web> 
    <system.serviceModel> 
    <services> 
     <service name="EvalServiceLibrary.EvalService"> 
     <clear /> 
     <endpoint address="ws" binding="wsHttpBinding" contract="EvalServiceLibrary.IEvalService" 
      listenUriMode="Explicit"> 
      <identity> 
      <dns value="localhost" /> 
      <certificateReference storeName="My" storeLocation="LocalMachine" 
       x509FindType="FindBySubjectDistinguishedName" /> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" 
      listenUriMode="Explicit"> 
      <identity> 
       <dns value="localhost" /> 
       <certificateReference storeName="My" storeLocation="LocalMachine" 
       x509FindType="FindBySubjectDistinguishedName" /> 
      </identity> 
     </endpoint> 
     <endpoint address="basic" binding="basicHttpBinding" contract="EvalServiceLibrary.IEvalService" 
      listenUriMode="Explicit"> 
      <identity> 
      <dns value="localhost" /> 
      <certificateReference storeName="My" storeLocation="LocalMachine" 
       x509FindType="FindBySubjectDistinguishedName" /> 
      </identity> 
     </endpoint> 
     <endpoint address="net.tcp://localhost:8888/EvalService" binding="netTcpBinding" 
      contract="EvalServiceLibrary.IEvalService" listenUriMode="Explicit"> 
      <identity> 
      <dns value="localhost" /> 
      <certificateReference storeName="My" storeLocation="LocalMachine" 
       x509FindType="FindBySubjectDistinguishedName" /> 
      </identity> 
     </endpoint> 
     <endpoint address="net.pipe://localhost/EvalService" binding="netNamedPipeBinding" 
      bindingConfiguration="" contract="EvalServiceLibrary.IEvalService" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:8080/EvalService" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <serviceMetadata httpGetEnabled="True"/> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 
</configuration> 

क्या गलत है/कैसे करना है मैंने इसे ठीक किया?

उत्तर

3

ऊपर दी गई दो समस्याओं (HTTP could not register URL एक) के बाद के लिए एक प्रतीत होता है कि समाधान VS2010 Training Kit में गैबोबैट के उत्तर (उसके द्वारा) की टिप्पणियों में पोस्ट किया जा सकता है।

चौथे अभ्यास में, "एक्स 4-सर्विसडिस्वरी", आपको एक चैट एप्लिकेशन दिखाई देता है जो दो ग्राहकों के बीच संवाद करने के लिए डब्ल्यूसीएफ सेवाओं का उपयोग करता है। यह नेटवर्क पर सहकर्मियों को खोजने के लिए एक खोज सुविधा का उपयोग करता है। लंबी कहानी छोटी, वही अपवाद होता है जब आप शुरू में पूरा आवेदन चलाने की कोशिश करते हैं (अभ्यास में निर्धारित घटनाओं को भरने के बाद)। ट्रेनिंग किट के साथ बंडल कुछ बैच स्क्रिप्ट्स (जो AFAICT माइक्रोसॉफ्ट के "ओपन सोर्स" लाइसेंस का उपयोग करता है, इसलिए मुझे इन स्क्रिप्ट को साझा करने में सक्षम होना चाहिए) "यूआरएल एसीएल" सेट या डिलीट करने के लिए।

फ़ाइल:: व्यवहार में, वे केवल एक ही (उपयोगी) आदेश प्रतीत AddURLACL.cmd

@Echo Off 
@Echo Grant permissions for URL reservation 
@Echo Parameter 1 "%1" == port 
@Echo Parameter 2 "%2" == URL 
pause 
netsh http add urlacl url=http://+:%1/%2 user=%USERDOMAIN%\%USERNAME% 

फ़ाइल: जाहिर है DelURLACL.cmd

@Echo Off 
@Echo Deletes permissions for URL reservation 
@Echo Parameter 1 "%1" == port 
@Echo Parameter 2 "%2" == URL 
pause 
netsh http delete urlacl url=http://+:%1/%2 

, netsh आदेशों हैं केवल मायने रखता है। उदाहरण परियोजना (कमांड प्रॉम्प्ट विंडो "प्रशासक के रूप में चलाने के लिए" एक से) आप निम्न आदेश का उपयोग किया है यह अपवाद "ठीक" करने के लिए:

C:\VS2010TrainingKit\Labs\WhatsNewInWCF4\Source\Setup\AddURLACL.cmd 8000 

(मैं तो बस आप को दिखाने के लिए जहां प्रशिक्षण किट में निरपेक्ष पथ का इस्तेमाल किया आप ये स्क्रिप्ट मिल सकता है; व्यक्तिगत रूप से मैं WhatsNewInWCF4 \ स्रोत निर्देशिका में था जब मैं ऐसा किया)

स्ट्रिंग 8000 केवल इस परियोजना भर में 1 बार होता है:

C:\VS2010TrainingKit\Labs\WhatsNewInWCF4\Source\Ex4-ServiceDiscovery\Begin\C#>findstr /n /s "8000" * 
DiscoveryChat\SimpleChat.cs:376:   this.localAddress = new Uri("http://localhost:8000/" + Guid.NewGuid().ToString()); 

ऐसा लगता है कि बंदरगाह 8000 बंदरगाह है कि चैट क्लाइंट लॉन्च करने की कोशिश कर रहे हैं ch पर एक सेवा होस्ट (मुझे नहीं पूछें कि वे सभी इसे कैसे साझा करते हैं ... मुझे लगता है कि ServiceHost कक्षा वे उपयोग करते हैं जो मौजूदा सेवा का पुन: उपयोग करने के लिए पर्याप्त बुद्धिमान है ...)।

मैंने अभी तक इसका पूरी तरह से प्रयोग नहीं किया है, लेकिन ऐसा लगता है कि मेरे EvalService प्रोजेक्ट को "निश्चित" किया गया है (जब मैंने पोर्ट को 8000 में बदल दिया)। वर्तमान में यह अधिकांश अंतराल हटा दिए गए हैं (केवल basicHttpBinding एंडपॉइंट बाएं) और baseAddresslocalhost:8000 पर सेट है।

मुझे यह बताएं कि यह आपके लिए भी काम करता है या नहीं।

1

समस्या आपकी कॉन्फ़िगरेशन में है। आप अपने एंडपॉइंट्स में प्रमाणपत्रों का संदर्भ दे रहे हैं। या तो आप उन्हें हटा दें:

<certificateReference storeName="My" storeLocation="LocalMachine" x509FindType="FindBySubjectDistinguishedName" /> 

या आप अपने प्रमाणपत्र स्टोर में कुछ प्रमाणपत्र डालते हैं। मैं इस बिंदु पर "पहचान" कॉन्फ़िगरेशन अनुभागों को हटाने की सिफारिश करता हूं, जब तक आप थोड़ा और अधिक डब्लूसीएफ सीख नहीं लेते। स्टार्टर्स के लिए केवल मूल एंडपॉइंट कॉन्फ़िगरेशन पर रहने का प्रयास करें, और उस बिंदु से अपना रास्ता बनाएं जिसमें आप डब्ल्यूसीएफ की मूल बातें समझते हैं। डब्ल्यूसीएफ आपको अपनी विशिष्ट जरूरतों के आधार पर कॉन्फ़िगरेशन विकल्पों का एक बड़ा (वास्तव में बड़ा) सेट देता है।

हो सकता है कि इन कड़ियों की मदद से आप बेहतर WCF में जाने कि वीडियो आप देख किया गया है:

आशा इस मदद करता है।

+0

धन्यवाद। ' 'टैग को टिप्पणी करते हुए टैग X.50 9 प्रमाणपत्र त्रुटि से छुटकारा पाता है, लेकिन मुझे अभी भी बाध्यकारी त्रुटि के साथ छोड़ दिया गया है। मुझे लगता है कि '' अनुभागों को विजुअल स्टूडियो (मेरे द्वारा किसी भी विशेष कार्रवाई के बिना) द्वारा स्वचालित रूप से जोड़ा गया था, इसलिए यह इस डेमो के लिए उनसे छुटकारा पाने के लिए अनजान प्रतीत होता है। – bambams

+0

आपके पास कितने अंक/बाइंडिंग हैं? एक बुनियादी एचटीपी बाइंडिंग के साथ एक एंडपॉइंट के साथ शुरू करें। अन्य अंतराल और बाइंडिंग को हटाएं जिन्हें वे संदर्भित कर रहे हैं। क्या आप वीएस विकास सर्वर या अन्य वेब सर्वर का उपयोग कर रहे हैं? यदि ऐसा है, तो वीएस पोर्ट नंबरों को नियंत्रित करने दें। यदि आप अन्य वेब सर्वर का उपयोग कर रहे हैं, तो अपने डेमो के लिए पोर्ट 80 पर चिपके रहें। यदि आपको, नए अपवादों को पोस्ट करने की आवश्यकता है, तो आपको मिल रहा है। –

+0

ऊपर पोस्ट किया गया पहला लिंक ओपी में पहला लिंक है। ;) यही वह जगह है जहां मुझे वीडियो मिला। : पी – bambams

7

मैं भी उसी webcast का पालन करता था और वही समस्याएं थीं। मुझे उन प्रविष्टियों पर टिप्पणी करके प्रमाण पत्र जारी किया गया है जैसा कि दूसरों द्वारा सुझाया गया है।

मैं ठीक किया मेरा url में "Design_Time_Addresses" जोड़कर वापस द्वारा "8732 के लिए HTTP पोर्ट बदलने या प्रशासक के रूप में चलाने की कोशिश करें"

काम नहीं करता

<add baseAddress="http://localhost:8732/AMessageService" /> 

निर्माण!

<add baseAddress="http://localhost:8732/Design_Time_Addresses/AMessageService" /> 
+0

वीएस 2012 में मेरे लिए भी काम करता है। –

1

मैं एक ही मुद्दे के साथ frustated था। आखिर में विजुअल स्टूडियो 2010 को राइट क्लिक करके और 'व्यवस्थापक के रूप में चलाएं' चुनकर विजुअल स्टूडियो को प्रशासक के रूप में चलाकर मुझे समाधान मिला।

0

सोचा कि मैं जो पढ़ रहा था उससे एक अद्यतन समेकित उत्तर जोड़ दूंगा।

हालांकि हम सभी प्रमाण पत्र के साथ अनुमतियों की अनुमति देने के लिए बहुत अधिक समय तक जा सकते हैं, लेकिन अधिकांश लोग इसे पढ़ रहे हैं वास्तव में डब्लूसीएफ एंडपॉइंट्स को एएसएपी चलाने और चलाने के लिए चाहते हैं।

इस प्रकार कुछ विकल्प।

1. sudipto-kumar-mukherjee above states "I was frustated with the same issue. 
Finally I found the solution by myself by running the Visual Studio as Administrator 
by right clicking Visual Studio 2010 and choosing 'Run As Administrator'." 
--> Yes, this  will work. 
OR 
2. nasp.tech response with 
"Doesn't Work" 
<add baseAddress="http://localhost:8732/AMessageService" /> 
"Works!" 
<add baseAddress="http://localhost:8732/Design_Time_Addresses/AMessageService" /> 

इनमें से कोई भी इस मुद्दे के साथ उठने और चलाने का सबसे तेज़ तरीका प्रतीत होता है।

-2

व्यवस्थापक के रूप में चलाने के लिए, विजुअल स्टूडियो पर राइट क्लिक करें और संदर्भ मेनू से व्यवस्थापक के रूप में चलाएं चुनें। हर समय व्यवस्थापक के रूप में चलाने के लिए, विजुअल स्टूडियो पर राइट क्लिक करें, फिर संदर्भ मेनू में गुणों पर जाएं संगतता टैब पर जाएं, फिर इस प्रोग्राम को व्यवस्थापक के रूप में चलाएं चुनें।

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