How can I share types when generate WebSevice proxies using local paths

 As we knowed, We can sharetypes using command line: wsdl /sharetypes <URL>, but now I have local wsdl files (together with xsd files) and I want to generate the service proxy classes using wsdl <Path>.

Such as:

 wsdl /out:D:\WebserviceProxies\AdvancedQuery.cs /n:CEWorkstation.WebService D:/wsdl/advancedquery/AdvancedQuery.wsdl D:/wsdl/RISEntity.xsd D:/wsdl/advancedquery/GetCustomizedAdvanceQuery.xsd D:/wsdl/advancedquery/Search.xsd D:/wsdl/advancedquery/UpdateCustomizedAdvanceQuery.xsd

and

 /out:D:\WebserviceProxies\AuditService.cs /n:CEWorkstation.WebService D:\wsdl\auditservice\AuditService.wsdl D:\wsdl\RISEntity.xsd D:\wsdl\auditservice\AuditOperationEvent.xsd D:\wsdl\auditservice\AuditSecurityEvent.xsd D:\wsdl\auditservice\GetAuditOperationEventPropByOperationEventID.xsd D:\wsdl\auditservice\GetAuditOperationEventsByRequestedProcedureID.xsd

Unfortunately, the command: wsdl <path> can't use with the parameter /sharetypes. After I generated the proxies and build them, I got "the already contains a definition" error. Because the common entities defined in  RISEntity.xsd are used in all of the service and the entities are generated repeatedly.

Somebody can give me some advices to share types using wsdl <path>?

Thanks a million!
wsdl files

原文地址:https://www.cnblogs.com/wmz/p/1062184.html