سؤال

أحاول ضبط أمان مستوى النقل على خدمة Webhttp Binding WCF WCF التكوين الحالي يبدو وكأنه

 <system.serviceModel>
<client>
  <endpoint binding="webHttpBinding" bindingConfiguration="webHttp"
    contract="PrimeStreamInfoServices.IService1" name="Client" />
</client>
<bindings>
<webHttpBinding>
  <binding name="webHttp" maxBufferPoolSize="1500000"  maxReceivedMessageSize="1500000"  maxBufferSize="1500000">
  <security mode="Transport">
      <transport clientCredentialType="None"

            proxyCredentialType="None"
            realm="string" />
  </security>
  </binding>

</webHttpBinding>
</bindings>
<services>

  <service name="PrimeStreamInfoServices.Service1" behaviorConfiguration="PrimeStreamInfoServices.Service1Behavior">
    <!-- Service Endpoints -->
    <endpoint address="" binding="webHttpBinding" bindingConfiguration="webHttp" contract="PrimeStreamInfoServices.IService1">
      <!-- 
          Upon deployment, the following identity element should be removed or replaced to reflect the 
          identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity 
          automatically.
      -->
    </endpoint>
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
  </service>
</services>
<behaviors>
  <serviceBehaviors>
    <behavior name="PrimeStreamInfoServices.Service1Behavior">

      <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
      <serviceMetadata httpGetEnabled="true"/>
      <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
<diagnostics>

  <messageLogging logMalformedMessages="true"  logMessagesAtServiceLevel="true"
    logMessagesAtTransportLevel="true" />

</diagnostics>

ومع ذلك، عندما أقوم بتشغيل خدمتي، أحصل على استثناء: تعذر العثور على عنوان أساسي يطابق مخطط HTTPS لنقطة النهاية باستخدام Webhttpbinding الربط. مخططات العناوين الأساسية المسجلة هي [http].

أعلم أنني في عداد المفقودين شيئا ما، وقد أحاول أشياء مختلفة لا أستطيع معرفة ذلك، أي شخص حصل على بعض المدخلات على ما يجب علي فعله؟

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

المحلول

نعم - التبديل إلى HTTPS، مع شهادة مناسبة. يتم توفير أمن النقل، في حالة HTTP بواسطة قناة SSL. لا يمكنك الحصول على أمن النقل WS * عبر HTTPS عادي

نصائح أخرى

تجاهل إجابتي السابقة، كنت أفكر في WshttpBinding غير WebhttpBinding.

هذا هو العنوان الذي تستخدمه للاتصال بالخدمة التي يجب أن تبدأ باستخدام https.

https: // machinename / servicename

يمكنك محاولة إضافة عنوان أساسي (داخل <host> عنصر تكوين الخدمة الخاص بك) الذي هو https؟ هل تضيف عنوان (أو متعدد) العنوان (ES) في التعليمات البرمجية؟

<service name="PrimeStreamInfoServices.Service1" 
         behaviorConfiguration="PrimeStreamInfoServices.Service1Behavior">
   <host>
      <baseAddresses>
         <add baseAddress="https://localhost:8080/YourService.svc" />
      </baseAddresses>
   </host>
   <!-- Service Endpoints -->
   <endpoint ......
</service>

ليس بالتأكيد 100٪ إذا كان ذلك يعمل مع webhttpbinding، ولكن جربه!

مارك

تذكر أنه بالإضافة إلى تكوين WCF الصحيح، تحتاج أيضا إلى تكوين خاصية IIS لتمكين SSL عليه (بما في ذلك إعداد شهادة X.509 الأيمن ل SSL). ال مستندات لديك بعض المعلومات الكريمة حول كيفية القيام بذلك.

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