How to instruct wsdl.exe to create a single shared types file from multiple wsdl files?

375 views Asked by At

I am using wsdl.exe to create client proxy classes from multiple wsdl files.

Currently I'm able to generate reference file using single wsdl file but now i want to generate reference file using multiple wsdl files and facing blockers here.

Any pointers or help is welcomed.

Thanks.

1

There are 1 answers

1
Lan Huang On

Maybe you can try the following method, the source of the method:https://stackoverflow.com/a/62899844/17218587

Step 1: Create single wsdl files for each service from existing WCF services. For example if your Web service address is http://localhost:50286/EcomService.svc you can create your wsdl file form the http://localhost:50286/EcomService.svc?singleWsdl

Step2: Create a connected service reference using standard way by selecting one of the generated wsdl file. This will create a ConnectedService.json file under "Connected Services" -> "Your namespace name"

Step3: Edit the ConnectedService.json file and include additional wsdl files under "inputs".

 "ProviderId": "Microsoft.VisualStudio.ConnectedService.Wcf",
  "Version": "15.0.40203.910",
  "ExtendedData": {
    "inputs": [
      "../../wsdl/EcomService.wsdl",
      "../../wsdl/ProfileService.wsdl"
    ], ...

Disadvantage: Whenever there is a change in the WCF services, you have to manually generate the wsdl files at your ASP.NET Core project, before updating the Connected Service.

or try svcutil.
https://social.msdn.microsoft.com/Forums/en-US/e12344f7-36da-4793-833b-97f439d6dff3/create-single-shared-types-file-from-multiple-wsdl?forum=aspwcfasmx