我手动创建了一个WSDL,它只有一个没有输入参数且没有输出参数的操作.
当我尝试从此WSDL创建客户端时,我收到以下错误:
无法导入wsdl:portType详细信息:运行WSDL导入扩展时抛出异常:System.ServiceModel.Description.DataContractSerializerMessageContractImporter错误:具有目标命名空间的架构" http://www.xmlns.mycompany.com/GAME/service/Associate/ 1.1 / '无法找到.XPath到错误源:// wsdl:definitions [@ targetNamespace =' http://www.xmlns.mycompany.com/GAME/service/Associate/1.1/']/wsdl:portType [@ name ='GAMEAssociateIntf'] C :\工具箱\ BlueTest\BloodRedTest\BloodRedTest \服务
的types (在客户机中使用)需要从本WSDL中的XML生成.我认为,在添加服务引用时,由于XML中的一些错误,该工具无法创建它.该XSD似乎是问题.
需要在WSDL中进行哪些更改才能创建代理?
注意:我试图包含WSDL本身定义的xml类型.[我不需要单独的文件进行架构保护]
WSDL
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="GAMEAssociate"
targetNamespace="http://www.xmlns.mycompany.com/GAME/service/Associate/1.1/"
xmlns:tns="http://www.xmlns.mycompany.com/GAME/service/Associate/1.1/"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:wsp="http://www.w3.org/ns/ws-policy"
>
<types>
<xsd:schema>
</xsd:schema>
<xsd:element name="myData">
<xsd:complexType />
</xsd:element>
<xsd:element name="myDataResponse">
<xsd:complexType />
</xsd:element>
</types>
<message name="getAllVicePresidentsRequest">
<part element="tns:myData" name="getAllVicePresidentsRequest"/>
</message>
<message name="getAllVicePresidentsResponse">
<part element="tns:myDataResponse" name="getAllVicePresidentsResponse"/>
</message>
<portType name="GAMEAssociateIntf">
<operation name="getAllVicePresidents">
<input message="tns:getAllVicePresidentsRequest"/>
<output message="tns:getAllVicePresidentsResponse"/>
</operation>
</portType>
<binding name="GAMEAssociateIntfBinding" type="tns:GAMEAssociateIntf"> …Run Code Online (Sandbox Code Playgroud)