WCF، لا يمكن للعميل الاتصال إلا في نفس الجهاز

StackOverflow https://stackoverflow.com/questions/1730937

  •  20-09-2019
  •  | 
  •  

سؤال

لدي تطبيق Web ASP.NET بسيط يستخدم عميل WCF للتحدث إلى خدمة Windows المدعومة من WCF بسيطة.

عملت جميعها بشكل جيد في البيئات المحلية. نشرنا في dev، والتي عملت بشكل جيد أيضا. ومع ذلك، على DEV - خادم الويب وخادم التطبيق موجود على نفس الجهاز.

الآن بعد أن نشرنا في ضمان الجودة، نحصل على "تم إحباط اتصال المقبس. تم إلقاء استثناء بثريا. لسبب ما، لا يمكن لخادم الويب الخاص بنا التحدث إلى خادم تطبيقات QA الخاص بنا عبر عميل / خدمة WCF لدينا. يمكنني تعيين خادم تطبيقات QA من خادم الويب، يمكنني Telnet خادم تطبيق QA من خادم الويب، يمكنني الاتصال ب HTTP WSDL على خادم تطبيق QA من خادم الويب

ويمكنني توصيل غرامة لخدمة ضمان الجودة الخاصة بي من بيئتي المحلية / Visual Studio !!!

فلماذا لا يمكن تطبيق تطبيق QA ASP.NET الخاص بي خدمة QA WCF Windows؟ لقد حاولت وفي كل شيء ممكن، ولا يزال لا تذهب ...

هنا هو بلدي System.Servicemodel قسم العميل:

<system.serviceModel>
    <bindings>
      <netTcpBinding>
        <binding name="BigFileBinding">
          <!-- required to receive files greater then default size of 16kb -->
          <readerQuotas maxArrayLength="5242880"/>
        </binding>
      </netTcpBinding>
    </bindings>
    <client>
      <endpoint address="net.tcp://NJQACNET01:58887/PriceService"
          binding="netTcpBinding"
          contract="IPriceService"
          bindingConfiguration="BigFileBinding"/>
      </endpoint>
    </client>
  </system.serviceModel>

هنا هو بلدي System.Servicemodel قسم في الخدمة:

<system.serviceModel>
    <bindings>
      <netTcpBinding>
        <!-- required to receive files greater then default size of 16kb -->
        <binding name="BigFileBinding"
                 maxReceivedMessageSize="5242880">
          <readerQuotas maxArrayLength="5242880"/>
        </binding>
      </netTcpBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="MetaDataBehavior" name="RK.Pricing.PricingPortal.MarketableSecuritiesService.PriceService">
        <endpoint address="net.tcp://localhost:58887/PriceService" binding="netTcpBinding"
          contract="RK.Pricing.PricingPortal.MarketableSecuritiesService.IPriceService" bindingConfiguration="BigFileBinding"   />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"  />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:58889/PriceService" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="MetaDataBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="true"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>

شكرا جزيلا على اي مساعدة! هو موضع تقدير كبير ..

هل كانت مفيدة؟

المحلول

ربما تكون هذه مشكلة جدار الحماية، يتم حظر المنفذ الذي تستخدمه بين خادم ASP.NET QA خادم WCF QA Server.

يمكنك اختبار هذا باستخدام أمر Telnet.

نصائح أخرى

أعتقد أن هذا يحتمل أن تكون مشكلة أمنية. ضع في اعتبارك أنه بشكل افتراضي، استخدم Nettcpbinding مصادقة Windows.

يجب عليك مراجعة ومتابعة المبادئ التوجيهية المنشورة هنا اذا كان ممكنا.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top