0

I'm getting this error when trying to call a function of a wsdl. I added a ServiceReference to a project in my solution. In that project I have the following app.config file

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="MYSERVICENAME_ws_Authorization_Binder" closeTimeout="00:01:00"
                openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
                allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard"
                maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
                messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered"
                useDefaultWebProxy="true">
                <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
                        maxBytesPerRead="4096" maxNameTableCharCount="16384" />
                <security mode="Transport">
                    <transport clientCredentialType="Basic" proxyCredentialType="Basic"
                        realm="" />
                    <message clientCredentialType="UserName" algorithmSuite="Default" />
                </security>
            </binding>
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="MYSERVICEURL"
            binding="basicHttpBinding" bindingConfiguration="MYSERVICENAME_ws_Authorization_Binder"
            contract="MYSERVICE.Authorization_PortType" name="MYSERVICENAME_ws_Authorization_Port" />
    </client>
</system.serviceModel>
<system.diagnostics>
    <sources>
        <source name="System.ServiceModel.MessageLogging">
            <listeners>
                <add name="messages"
                type="System.Diagnostics.XmlWriterTraceListener"
                initializeData="c:\logs\messages.svclog" />
            </listeners>
        </source>
    </sources>
</system.diagnostics>
<system.serviceModel>
    <diagnostics>
        <messageLogging
             logEntireMessage="true"
             logMalformedMessages="true"
             logMessagesAtServiceLevel="true"
             logMessagesAtTransportLevel="true"
             maxMessagesToLog="3000"
             maxSizeOfMessageToLog="2000"/>
    </diagnostics>
</system.serviceModel>

Then in my main project, the MVC project I have the following in the Web.config file.

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="MYSERVICENAME_ws_Authorization_Binder" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="MYSERVICEURL"
            binding="basicHttpBinding" bindingConfiguration="MYSERVICENAME_ws_Authorization_Binder"
            contract="MYSERVICE.Authorization_PortType" name="MYSERVICENAME_ws_Authorization_Port" />
    </client>
</system.serviceModel>

The error occurs when I'm running in debug mode, localhost. I haven't tried it on my website since I'm still developing. My website has a certified SSL and my localhost is also configured to run on HTTPS but only with a self-signed certificate.

Am I getting this error because my self-signed certificate isn't enough? Can I make localhost also use the SSL that my website is using? If not, what's the best solution to this? I have found a few posts on this error but haven't found a solution that helps me yet.

joks
  • 125
  • 2
  • 14
  • Sounds like the endpoint address isn't `https` for your service reference. – interesting-name-here Mar 27 '17 at 17:34
  • Try putting in your `wsdl` address into WCF Test Client `C:\Program Files (x86)\Microsoft Visual Studio {your VS version}\Common7\IDE\WcfTestClient.exe`. – interesting-name-here Mar 27 '17 at 17:50
  • Ok, I found another URL that I'm probably supposed to use and it's ´https´ but now I get the error "There was no endpoint listening at MYURL that could accept the message..." I have looked this error up but never found a solution to this either. – joks Mar 27 '17 at 20:36
  • http://stackoverflow.com/questions/17572500/wcf-error-there-was-no-endpoint-listening-at#17577881 Maybe that'll help – interesting-name-here Mar 29 '17 at 14:38
  • Thanks a lot for your responses. I found another way to work with this service, via Nuget package and that was a lot easier. I still don't know why the other way didn't work. – joks Mar 31 '17 at 13:58

0 Answers0