[英]DataTypes XSD two WSDL files - Types 'X' and X' both use the XML type name, 'X', from namespace ''
I received two WSDL + XSD files and one xsd datatypes file from an organisation. 我从一个组织收到了两个WSDL + XSD文件和一个xsd数据类型文件。 Both WSDL file are imported/ used as (two) service reference(s).
两个WSDL文件都被导入/用作(两个)服务参考。
As soon as I serialize an object I am receiving the below exception: Types 'X' and X' both use the XML type name, 'X', from namespace Y. 序列化对象后,我立即收到以下异常消息:类型'X'和X'都使用名称空间Y中的XML类型名称'X'。
The problem is; 问题是; both WSDL files are using the same object/class of the xsd file.
两个WSDL文件都使用与xsd文件相同的对象/类。 How to solve this problem, without modifying the WSDL files?
如何在不修改WSDL文件的情况下解决此问题? Do I need to combine the WSDL files?
我需要合并WSDL文件吗? Or is it possible to point both WSDL files to some shared datatypes file?
还是可以将两个WSDL文件都指向某个共享数据类型文件?
if you need more information/ details, please write a comment. 如果您需要更多信息/细节,请写评论。
Thank you in advance. 先感谢您。
*I am using C#, Visual Studio 2015. *我正在使用C#,Visual Studio 2015。
Create a new WSDL file which imports both (received) WSDL files. 创建一个新的WSDL文件,该文件将同时导入(接收)两个WSDL文件。
Note: The WSDL and XSD files need to be in the same directory. 注意:WSDL和XSD文件必须位于同一目录中。
Example 例
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/">
<import location="LOCATION WSDL1"/>
<import location="LOCATION WSDL2"/>
</definitions>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.