I've been struggling for a few days with this problem, learning a lot of things on bindings in the process. One thing puzzles me, though: various links (see this or that for example) explicitly state "By default, WCF project is created using WsHttpBinding", but that's not what I see. This is what I do:
SOAP / Send request to server: i get the errors
HTTP error: could not POST file ‘/WcfService7/Service1.svc’ on server ’localhost’ (415)
Error sending the soap data to ‘http://localhost/WcfService7/Service1.svc’ HTTP error: could not POST file ‘/WcfService7/Service1.svc’ on server ’10.51.0.108’ (415)
Any explanations? Thanks
Bindings are objects that are used to specify the communication details that are required to connect to the endpoint of a Windows Communication Foundation (WCF) service. Each endpoint in a WCF service requires a binding to be well-specified.
In this article Custom bindings can be built from a set of system-provided binding elements or can include user-defined custom binding elements. You can use custom binding elements, for example, to enable the use of new transports or encoders at a service endpoint.
Web binding This binding is provided by the WebHttpBinding class. It is designed to expose WCF services as HTTP requests using HTTP-GET and HTTP-POST. It is used with REST based services that may provide output in XML or JSON format.
Basic binding is offered by the BasicHttpBinding class. It uses the HTTP protocol to transport and represent a WCF service as an ASP.NET web service (ASMX web service), so that old clients who use ASMX web services can consume the new services conveniently.
When hosting WCF service in IIS (using WCF Service application project template) with default .svc file (without changing its service host factory) the default binding is basicHttpBinding
. If you want to change default binding to wsHttpBinding
you must use:
<protocolMapping>
<add scheme="http" binding="wsHttpBinding"/>
</protocolMapping>
In your service's configuration file but it will not solve your problem because you don't need wsHttpBinding
and as I remember Altova XmlSpy is not able to send valid request for wsHttpBinding
because it supports only basic SOAP stack without WS-* protocols.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With