Created attachment 15873 [details]
Service page generated by WCF with highlighting mentioned in the code example
I'm running Mono on Raspbian, which apparently comes with version 3.2.8 when I install it (apt-get install mono-complete). I see now that this is not the latest version, but I'm not sure how I can upgrade it so that I can test this on a newer version.
I have created a WCF service that needs to present a specific WSDL file (for backwards compatibility). I tell WCF to tell the consumers of the service to use a specific WSDL file (instead of the one being generated by WCF).
In regular .Net on Windows (not using Mono) this works as in the attached screenshot.
The highlighted numbers point to examples in the code below:
#1 - The address the WCF service is set up to use
#2 - The WSDL referred to in the ExternalMetadataLocation property
Also, if you go to http://localhost:8080/myservice?wsdl you are redirected to the custom WSDL.
In Mono the WCF service just presents the autogenerated WSDL for the service, when it should instead present a link to the external WSDL file as well as redirect to the external file.
Example of how WCF is set up to use a specific WSDL file:
MyService service = new MyService();
// See #1 in attached screenshot
ServiceHost host = new ServiceHost(service, new Uri("http://localhost:8080/myservice");
var behaviour = host.Description.Behaviors.Find<ServiceBehaviorAttribute>();
behaviour.InstanceContextMode = InstanceContextMode.Single;
ServiceMetadataBehavior smb = new ServiceMetadataBehavior();
// See #2 in attached screenshot
smb.ExternalMetadataLocation = new Uri("http://localhost:8080/reachable/wsdl/myservice.wsdl", baseAddress.Scheme, baseAddress.Host, baseAddress.Port));
smb.HttpGetEnabled = true;
I have now been able to upgrade to 4.0.2 and the issue is there as well.
Verified on 126.96.36.199