I have written a simple WCF web service that I am trying to expose through a website.
I uploaded the website (which has the service reference and bindings in the web.config) to the server and I can browse to the wsdl using https://domain/ServiceRoute?wsdl.
The WSDL is showing an incorrect path for schemaLocation
.
I then try to use the WCF Test Client to test the service. The WCF Test Client gives me the following error:
Error: Cannot obtain Metadata from https://domain/ServiceRoute?wsdl 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: https://domain/ServiceRoute?wsdl Metadata contains a reference that cannot be resolved: 'https://domain/ServiceRoute?wsdl'.
Sendera:ActionNotSupported
The message with Action 'http://schemas.xmlsoap.org/ws/2004/09/transfer/Get' cannot be processed at the receiver, due to a ContractFilter mismatch at the EndpointDispatcher. This may be because of either a contract mismatch (mismatched Actions between sender and receiver) or a binding/security mismatch between the sender and the receiver. Check that sender and receiver have the same contract and the same binding (including security requirements, e.g. Message, Transport, None).HTTP GET Error URI: https://domain/ServiceRoute?wsdl The document was understood, but it could not be processed. - The WSDL document contains links that could not be resolved. - There was an error downloading 'https://incorrectSchemaLocation/ServiceRoute?xsd=xsd0'. - The remote name could not be resolved: 'IncorrectSchemaLocation'
I'm not sure what to do about this. Is there a server setting I need to change? Or can I update my bindings to explicitly use the schemaLocation
of https://domain/ServiceRoute
?
Also, note that I am not getting ssl certificate errors when I browse to the wsdl. I don't know if that helps.
I was able to get around this error by changing the web server's configuration using a command line utility:
cscript.exe adsutil.vbs set /w3svc/<site identifier>/SecureBindings ":443:<host header>"
Where <site identifier>
is the IIS site identifier and <host header>
is the URL that will be used to access the service from the outside (ie: subdomain.domain.com.)