WCF Endpoint does not use provided Https binding - wcf

I'm calling an external WCF service and am getting the following error message. "The provided URI scheme 'http' is invalid; expected 'https'. Parameter name: via"
here are the config sections pertaining to the service:
<client>
<endpoint address="https://www.odfl.com:443/wsRate_v4/RateService" binding="basicHttpBinding" bindingConfiguration="RatePortBinding" contract="OdflRateService.RateDelegate" name="RatePort" />
</client>
and the binding Section:
<bindings>
<basicHttpBinding>
<binding name="RatePortBinding">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
The assembly is calling the service is loaded into the app through reflection and the configuration values are in the main app web config. I don't know if this makes any difference but thought i should mention it.
Thanks!

Related

the provided uri scheme https is invalid; expected 'http' in app.config

I have a wcf with like below url
https://localhost:44370/service.svc
I have a window service which is using the above wcf
and in my app.config I configured the same like below
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://localhost:44370/service.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpsBinding_IService" contract="FileServer.IService"
name="BasicHttpsBinding_IService" />
</client>
</system.serviceModel>
but I am getting the following error the provided uri scheme https is invalid; expected 'http'
when I changed my binding type into https like below
<system.serviceModel>
<bindings>
<basicHttpsBinding>
<binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647" />
</basicHttpsBinding>
</bindings>
<client>
<endpoint address="https://localhost:44370/service.svc" binding="basicHttpsBinding"
bindingConfiguration="BasicHttpsBinding_IService" contract="FileServer.IService"
name="BasicHttpsBinding_IService" />
</client>
</system.serviceModel>
then I am getting the below error
configuration binding extension 'system.servicemodel/binding.basichttpsbinding' could not be found. verify that this binding extension is properly registered in 'system.servicemodel/binding.basichttpsbinding' and that it is spelled correctly.
what can I do to solve this?
You are trying to use a HTTPS address with a HTTP binding, change the binding type to 'basicHttpsBinding'.
but I am getting the following error the provided uri scheme https is
invalid; expected 'http'
You try adding security mode to the binding, this change will allow you to use https instead of http.
<basicHttpBinding>
<binding name="BasicHttpsBinding_IService" maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="Transport">
</security>
</binding>
</basicHttpBinding>

Could not find endpoint element

The errror message is:
Could not find endpoint element with name
'NetbiterServiceReference.nbws' and contract
'NetbiterServiceReference.nbws' in the ServiceModel client
configuration section.
My app.config file looks like this:
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="nbws.cfcSoapBinding">
<security mode="Transport" />
</binding>
<binding name="nbws.cfcSoapBinding1" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://../nbws.cfc"
binding="basicHttpBinding" bindingConfiguration="nbws.cfcSoapBinding"
contract="NetbiterServiceReference.nbws" name="nbws.cfc" />
</client>
</system.serviceModel>
In my code I do like this and i gives the error message above.
nbwsClient proxy = new nbwsClient();
Then I did all these combinations, but with the same result:
nbwsClient proxy = new nbwsClient("NetbiterServiceReference.nbws", "https://../nbws.cfc");
nbwsClient proxy = new nbwsClient("nbws", "https://../nbws.cfc");
nbwsClient proxy = new nbwsClient("nbws.cfc", "https://../nbws.cfc");
Any ideas would be appreciated!
The errror message is: Could not find endpoint element with name 'NetbiterServiceReference.nbws' and contract 'NetbiterServiceReference.nbws' in the ServiceModel client configuration section. My app.config file looks like this:
If you change the endpoint section as follows, you'll lose this error.
<endpoint address="https://../nbws.cfc"
binding="basicHttpBinding" bindingConfiguration="nbws.cfcSoapBinding"
contract="NetbiterServiceReference.nbws" name="NetbiterServiceReference.nbws" />
Resolved it myself.
Problem was that the test-project, running the project with code and app.config didn’t have the correct information in the app.config.

How do I add a binding and endpoint that utilizes SSL for a WCF Workflow Service?

I have a need to secure my WCF service using SSL. The problem I'm running into is that this is a WCF Workflow service, and I can't seem to override the default bindings that it sets up behind the scenes.
There must be something that I'm missing in the configuration file, as whatever I do, the binding always comes back as: BasicHttpBinding_IService at address : http://myurl.com/biz/MyService.xamlx
It should be: https://myurl.com/biz/MyService.xamlx.
These are the bindings and endpoint sections:
<bindings>
<basicHttpBinding>
<binding name="basicBinding">
<security mode="Transport">
<transport clientCredentialType="None" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service name="MyNamespace.MyService">
<endpoint address="https://myurl.com/biz/MyService.xamlx"
binding="basicHttpBinding"
bindingConfiguration="basicBinding"
contract="IService" />
</service>
</services>
Thanks for any help!
A few things to try:
change the binding to wsHttpBinding and that will force SSL.
change clientCredentialType to Certificate.
use this example and set the httpsGetEnabled to true:
http://blog.adnanmasood.com/2008/07/16/https-with-basichttpbinding-note-to-self/

WP7 + WCF Service: There was no endpoint listening at (URL) that could accept the message

I'm trying to develop a Windows Phone application that uses a WCF Service. I'm doing it as decribed here:
http://www.c-sharpcorner.com/UploadFile/raj1979/5280/
(of course I use my own tables from the DB). The problem is:
I'm debugging the Class Library project containing the WCF service (to see if some of its methods are invoked properly)
after the method returns an entity I see the error: There was no endpoint listening at http://localhost:1708/Service1.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details. The InnerException is The remote server returned an error: NotFound.
the ServiceReferences.ClientConfig in the Windows Phone application:
<configuration>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IService1" maxBufferSize="2147483647"
maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://localhost:1708/Service1.svc" binding="basicHttpBinding"
bindingConfiguration="BasicHttpBinding_IService1" contract="ServiceReference1.IService1"
name="BasicHttpBinding_IService1" />
</client>
</system.serviceModel>
</configuration>
I don't know how to solve it. Any ideas ? I tried many answers from that site but none worked
What about Silverlight-enabled WCF service on the server side? It it based on CustomBinding instead of basicHttpBinding.
You must change in ServiceReferences.ClientConfig in your Windows Phone Emulator endpoint address from localhost to
yourComputerName. Thats all:) It works

WCF Error: Stream Security is required at http://www.w3.org/2005/08/addressing/anonymous, but no security context was negotiated

We have a windows service that we are trying to use as WCF host for a WPF application. It works fine in development but when we have tried to move to our production environment we have had nothing but problems. From reading posts from others, we figured out how to turn on WCF logging and this was a big help. It turned out that our security bindings on the service and the client did not match. We set them both to use windows security but still no luck now we are trying to set the security mode to 'None' but it still is not working. Here is the bindings section of our service config file:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="netTcp">
<security mode='None'>
</security>
</binding>
</netTcpBinding >
</bindings>
<services>
<service name="CompanyService">
<endpoint
address= "our.url.com/CompanyService"
binding="netTcpBinding"
contract="CompanyServices.ICompanyService" />
</service>
</services>
</system.serviceModel>
Here is the serviceModel section of our client app config:
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_Config" >
<security mode="None">
</security>
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="our.url.com/CompanyService" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_Config" contract="CompanyServiceProxy.ICompanyService" name="NetTcpBinding_ICompanyService" />
</client>
</system.serviceModel>
If I need to supply additional infor please tell me what I need to supply.
Thanks
Standard net.tcp binding uses Windows credentials by default, and those really require client and service to be in the same Windows domain. Is this the case here??
OK, sorry, you mentioned security=None (your listings weren't properly formatted so I only saw a fraction of the actual config).
I guess your problem really lies in the addresses used:
address= "our.url.com/CompanyService"
When using net.tcp binding, you have to specify that before the address, so change this on both the client and the server to:
address= "net.tcp://our.url.com/CompanyService"
Also, what I don't quite understand is your title: it mentions "streaming" - have you specified streaming mode anywhere? In your config or your service contracts?
Marc