Using the Visual Studio addition here: https://blogs.msdn.microsoft.com/webdev/2015/12/15/wcf-connected-service-visual-studio-extension-preview-for-asp-net-5-projects/
I am attempting to add the service: https://sandbox.usaepay.com/soap/gate/1412E031/usaepay.wsdl
However, this service has comments at the top of it's document and I am assuming it is what is breaking the scaffolding, as you can see here: https://sandbox.usaepay.com/soap/gate/1412E031/usaepay.wsdl/mex
Which results in this error:
Error:Error: Cannot obtain Metadata from https://sandbox.usaepay.com/soap/gate/1412E031/usaepay.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://sandbox.usaepay.com/soap/gate/1412E031/usaepay.wsdl
Metadata contains a reference that cannot be resolved: 'https://sandbox.usaepay.com/soap/gate/1412E031/usaepay.wsdl/mex'.
The content type text/xml of the response message does not match the content type of the binding (application/soap+xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 1 bytes of the response were: '<'.
An error occurred in the tool.
Failed to generate service reference.
Thanks for filing this @adamreed90 . I can verify that using the normal "old style" Add Service Reference to the link you provided works, so it does sound like a bug for Connected Services to break this way. We'll get this assigned so someone can investigate. Are you able to remove the comments as an experiment, or is that WSDL outside your control?
The WSDL is outside my control unfortunately, any ideas how I could prune that for a test now?
@adamreed90 I would like to provide you a work around, but found this WSDL only contains operations with SOAP Encoding (use='encoded') that is NOT compatible with .Net Core apps. It is not supported to use SOAP Encoding web services in .Net Core apps.
@hongdai that's unfortunate, why isn't it compatible? Is it a planned addition?
I believe it is by design not compatible currently. If there are plenty of customers need this feature, I will ask product team to re-evaluate it.
Is there anything I can override to provide the Soap Encoding?
Unfortunately I'm not aware of anyway to override. I have opened a separate issue just to track supporting OperationFormatUse.
Closing this issue as the root cause is tracked as a feature request.
+1 for Encoded Message. I believe this is already handled by v2 ?
Most helpful comment
Unfortunately I'm not aware of anyway to override. I have opened a separate issue just to track supporting OperationFormatUse.