none
deploying wcf service to iis RRS feed

  • Question

  • Hi I am new to WCF and having trouble deploying a Silverlight app with wcf to iis

    I get the following error message using WCFTestClient

    Error: Cannot obtain Metadata from http://localhost:8181/wccricket If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address.  For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.WS-Metadata Exchange Error    URI: http://localhost:8181/wccricket    Metadata contains a reference that cannot be resolved: 'http://localhost:8181/wccricket'.    The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.    The remote server returned an error: (401) Unauthorized.HTTP GET Error    URI: http://localhost:8181/wccricket    The HTML document does not contain Web service discovery information.

    I have set the Authentication in iis to windows But still get the error and wondered if there is a problem with the metadata in my web.config below is a listing the config.

    configuration>
        <system.diagnostics>
            <sources>
                <source name="System.ServiceModel" switchValue="Warning, ActivityTracing"
                    propagateActivity="true">
                    <listeners>
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        </add>
                        <add name="ServiceModelTraceListener">
                            <filter type="" />
                        </add>
                    </listeners>
                </source>
                <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
                    <listeners>
                        <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                            <filter type="" />
                        </add>
                        <add name="ServiceModelMessageLoggingListener">
                            <filter type="" />
                        </add>
                    </listeners>
                </source>
            </sources>
            <sharedListeners>
                <add initializeData="C:\inetpub\wwwroot\WCCricket\Web_tracelog.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
                    <filter type="" />
                </add>
                <add initializeData="C:\inetpub\wwwroot\WCCricket\Web_messages.svclog"
                    type="System.Diagnostics.XmlWriterTraceListener, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                    name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
                    <filter type="" />
                </add>
            </sharedListeners>
            <trace autoflush="true" />
        </system.diagnostics>
        <connectionStrings>
       <add connectionString="Server=Dave_NB;Database=TranzPlan;Integrated Security=true" name="TranzPlanConnectionString" providerName="System.Data.SqlClient" />    
        </connectionStrings>
        <system.web>
            <compilation strict="false" explicit="true" targetFramework="4.0" />
            <identity impersonate="false" />
        </system.web>

        <system.serviceModel>
            <diagnostics wmiProviderEnabled="true">
                <messageLogging logEntireMessage="true" logKnownPii="true" logMalformedMessages="true"
                    logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
            </diagnostics>
            <client>
                <endpoint address="http://localhost:8181/Service1.svc" binding="basicHttpBinding"
                    bindingConfiguration="BasicHttpBinding_Service1" contract="ServiceReference1.Service1"
                    name="BasicHttpBinding_Service1" />
                <endpoint address="http://localHost:8181/wccricket" binding="basicHttpBinding"
                    bindingConfiguration="BasicHttpBinding_Service1" contract="ServiceReference1.Service1"
                    name="" kind="" endpointConfiguration="" />
            </client>
            <behaviors>
                <serviceBehaviors>
                    <behavior name="">
                        <serviceMetadata httpGetEnabled="true" />
                        <serviceDebug includeExceptionDetailInFaults="true" />
                    </behavior>
                </serviceBehaviors>
            </behaviors>
            <bindings>
                <basicHttpBinding>
                    <binding name="BasicHttpBinding_Service1" closeTimeout="00:03:00" />
                    <binding name="NewBinding0" />
                </basicHttpBinding>
                <customBinding>
                    <binding name="WCCricket_WebServer.Service1.customBinding0">
                        <binaryMessageEncoding />
                        <httpTransport />
                    </binding>
                </customBinding>
            </bindings>
            <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
            <services>
                <service name="WCCricket_WebServer.Service1">
                    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="NewBinding0"
                        contract="WCCricket_WebServer.Service1" isSystemEndpoint="true" />
                    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
                </service>
            </services>
        </system.serviceModel>
    </configuration>

    Apologies if this is my second request but my first request seems to have disappeared.

    Wednesday, January 28, 2015 8:35 PM

Answers

  • Hi Aristocrat,

    >>The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.   

    Based on the error description, it seems that it has something related with authentication, please try to make sure that you have set the following config file in the both client and service side if you want to use the Windows Authentication:

    <basicHttpBinding>
      <binding>
        <security mode="TransportCredentialOnly">
          <transport clientCredentialType="Windows" />
        </security>
      </binding>
    </basicHttpBinding>

    Besides, if the client wants to consume the WCF Service, please make sur that the client has provided the correct windows username and password.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Saturday, February 7, 2015 8:23 AM
    Moderator

All replies

  • Hi Aristocrat,

    I see in your service config file you have two endpoints and you have hosted the service WCCricket_WebServer.Service1 in IIS. If you do not do any address modify in IIS, your service address will be http://localhost:8181/Service1.svc . But based on your client config file, you have two endpoints address. So what is the http://localhost:8181/wccricket? Can you browse this address in the broswer to see if it works?


    Best Regards,
    Amy Peng

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, January 29, 2015 7:17 AM
    Moderator
  • Hi Amy

    The wcf service is hosted by a Silverlight asp project  the full url of the application is http://localhost:8181/wccricket and this loads correctly but does not produce data in the grid from the service. It all works fine on the development PC.

    What should the end point address be.

    Regards

    Dave

    Thursday, January 29, 2015 9:37 PM
  • Hi Aristocrat,

    >>The HTTP request is unauthorized with client authentication scheme 'Anonymous'. The authentication header received from the server was 'Negotiate,NTLM'.   

    Based on the error description, it seems that it has something related with authentication, please try to make sure that you have set the following config file in the both client and service side if you want to use the Windows Authentication:

    <basicHttpBinding>
      <binding>
        <security mode="TransportCredentialOnly">
          <transport clientCredentialType="Windows" />
        </security>
      </binding>
    </basicHttpBinding>

    Besides, if the client wants to consume the WCF Service, please make sur that the client has provided the correct windows username and password.

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Saturday, February 7, 2015 8:23 AM
    Moderator