我正在尝试使用 svcutil 从 wsdl 文件生成 C# 代理类。但我收到很多错误: 错误:无法导入 wsdl:portType 详细信息:运行 WSDL 导入扩展时引发异常:System.ServiceModel.Description.XmlSerializerMessageContractImporter 错误:引用类型 ' http://schemas.xmlsoap.org/soap /encoding/:Array ' 仅对编码的 SOAP 有效。错误源的 XPath: //wsdl:definitions[@targetNamespace='Feed']/wsdl:portType[@name='FeedPortType']
错误:无法导入 wsdl:binding 详细信息:导入 wsdl:binding 所依赖的 wsdl:portType 时出错。wsdl:portType 的 XPath: //wsdl:definitions[@targetNamespace='Feed']/wsdl:portType[@name='FeedPortType'] 错误源的 XPath: //wsdl:definitions[@targetNamespace='Feed']/ wsdl:绑定[@name='FeedBinding']
错误:无法导入 wsdl:port 详细信息:导入 wsdl:port 所依赖的 wsdl:binding 时出错。wsdl:binding 的 XPath: //wsdl:definitions[@targetNamespace='Feed']/wsdl:binding[@name='FeedBinding'] 错误源的 XPath: //wsdl:definitions[@targetNamespace='Feed']/ wsdl:service[@name='Feed']/wsdl:port[@name='FeedPort']
我发现出现此错误的原因如下: xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
<xsd:complexType name="gameWST">
<xsd:all>
<xsd:element name="game" type="xsd:string"/>
<xsd:element name="amountWagers" type="xsd:float"/>
<xsd:element name="amountSettlements" type="xsd:float"/>
<xsd:element name="amountTips" type="xsd:float"/>
</xsd:all>
</xsd:complexType>
<xsd:complexType name="gameWSTArray">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:gameWST[]"/>
</xsd:restriction>
</xsd:complexContent>
</xsd:complexType> …Run Code Online (Sandbox Code Playgroud) 我有IIS v8.5,我想配置支持CORS标头.我在web.config中添加了下一个设置:
<httpProtocol>
<customHeaders>
<add name="Access-Control-Allow-Origin" value="*"/>
</customHeaders>
</httpProtocol>
Run Code Online (Sandbox Code Playgroud)
如果我向我的控制器发出请求它工作正常,但我的文件夹中有java脚本,当我提出获取此文件的请求时,我得到没有标题
"access-control-allow-origin"的响应.我想用该标头提供静态文件.这可能吗?谁能帮我这个?