none
wsHttpBinding not appearing on the WSDL RRS feed

  • Question

  • I have created a wcf service and I am pasting the service, binding and behavior detail below.

    When I add service reference to it or browse it using .svc?wsdl, I don't see the wshttpbinding listed there. And naturally I am not able to use wshttpbinding on my clients. Please assist.

     <service name="TPC.WebServices.CardInquiryService"
              behaviorConfiguration="DefaultServiceBehavior">
           <endpoint address=""
                binding="wsHttpBinding"
                bindingConfiguration="wsHttpBinding_Security_Transport_Message"
                contract="Common.Contracts.ICardInquiryService"
                bindingNamespace="http://TPC.Services" />
           <endpoint address="asmx"
                 binding="basicHttpBinding"
                 bindingConfiguration="basicHttpBindingDefault"
                 contract="Contracts.ICardInquiryService"
                 bindingNamespace="http://TPC.Services" />
           <endpoint address="mex"
                 binding="mexHttpsBinding"
                 contract="IMetadataExchange"
                 bindingNamespace="TPC.Services" />


    <wsHttpBinding>
           <binding name="wsHttpBindingDefault" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" >
             <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647"  />
             <security mode="None" />
           </binding>
           <binding name="wsHttpBinding_Security_Transport_Message" receiveTimeout="00:10:00" sendTimeout="00:05:00" messageEncoding="Text" textEncoding="utf-8" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
             <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647"/>
             <security mode="TransportWithMessageCredential">
               <transport clientCredentialType="Certificate"/>
               <message clientCredentialType="Certificate" establishSecurityContext="False"/>
             </security>
           </binding>
         </wsHttpBinding>
         <basicHttpBinding>
           <binding name="basicHttpBindingDefault" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" >
             <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647" />
             <security mode="None" />
           </binding>
         </basicHttpBinding>
       </bindings>

    <serviceBehaviors>
         <behavior name="DefaultServiceBehavior">      
           <serviceMetadata httpsGetEnabled="true"/>
           <serviceDebug includeExceptionDetailInFaults="True"/>      
         </behavior>
        <behavior name="">
         <serviceMetadata httpGetEnabled="true" />
         <serviceDebug includeExceptionDetailInFaults="false" />
        </behavior>

    Tuesday, February 19, 2013 5:24 PM

Answers

  • Hi,

    You may try create a service library with WCF Service Library template with Visual Studio, copy blow config into the app.config file.

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
    
      <system.web>
        <compilation debug="true" />
      </system.web>
      <!-- When deploying the service library project, the content of the config file must be added to the host's 
      app.config file. System.Configuration does not support config files for libraries. -->
      <system.serviceModel>
        <services>
          <service name="WcfServiceLibrary1.Service1">
            <host>
              <baseAddresses>
                <add baseAddress = "http://localhost:8732/Design_Time_Addresses/WcfServiceLibrary1/Service1/" />
              </baseAddresses>
            </host>
    
            <endpoint address="wsHttp"
                 binding="wsHttpBinding"
                 bindingConfiguration="wsHttpBinding_Security_Transport_Message"
                 contract="WcfServiceLibrary1.IService1"
                  />
            <endpoint address="basicHttp"
                  binding="basicHttpBinding"
                  bindingConfiguration="basicHttpBindingDefault"
                  contract="WcfServiceLibrary1.IService1"
                   />
    
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>
        </services>
        <bindings>
        <wsHttpBinding>
          <binding name="wsHttpBindingDefault" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" >
            <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647"  />
            <security mode="None" />
          </binding>
          <binding name="wsHttpBinding_Security_Transport_Message" receiveTimeout="00:10:00" sendTimeout="00:05:00" messageEncoding="Text" textEncoding="utf-8" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647">
            <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647"/>
            <security mode="None">
             
            </security>
          </binding>
        </wsHttpBinding>
        <basicHttpBinding>
          <binding name="basicHttpBindingDefault" maxReceivedMessageSize="2147483647" maxBufferPoolSize="2147483647" maxBufferSize="2147483647" >
            <readerQuotas maxArrayLength="2147483647" maxStringContentLength="2147483647" maxDepth="2147483647" />
            <security mode="None" />
          </binding>
        </basicHttpBinding>
        </bindings>
        <behaviors>
          <serviceBehaviors>
            <behavior>
              <serviceMetadata/>
              <serviceDebug includeExceptionDetailInFaults="False" />
            </behavior>
          </serviceBehaviors>
        </behaviors>
      </system.serviceModel>
    
    </configuration>

    You will find those endpoints are set properly in blow capture image when you press F5.

    You can consume the service by "Add Service Reference".

    Best Regards.


    Haixia
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by pp1299 Thursday, February 21, 2013 4:48 PM
    Thursday, February 21, 2013 6:45 AM
    Moderator