gpt4 book ai didi

c# - SOAPUI 未显示来自 WSDL 的操作

转载 作者:行者123 更新时间:2023-12-03 18:48:46 25 4
gpt4 key购买 nike

我正在努力让 SOAPUI 在我的服务中显示我的操作,我从公开的 MEX 端点生成我的 WSDL(所以不是手动),然后我从生成的 WSDL 创建我的 CLIENT 代理。从代码的角度来看,这工作正常(如果主机正在运行,我的单元测试通过,如果主机关闭则失败)。

我想使用 SOAPUI 进行一些低级别测试,但是如果我使用用于生成代理的相同 WSDL,那么它不会显示任何操作(即使 WSDL 正在工作)

生成 WSDL
svcutil/target:metadata "net.tcp://localhost:10109/AnimalService"

生成代理
svcutil/t:code ..*.wsdl ..*.xsd/out:Proxy.cs/config:Proxy.config

我认为我做错了什么,任何帮助将不胜感激。

主要 WSDL

<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:i0="http://spikes/WcfCodeFirstExample/services/AnimalService" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://tempuri.org/" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" name="AnimalService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:import namespace="http://spikes/WcfCodeFirstExample/services/AnimalService" location="" />
<wsdl:types />
<wsdl:service name="AnimalService">
<wsdl:port name="NetTCPBinding_IAnimalService" binding="i0:NetTCPBinding_IAnimalService">
<soap12:address location="net.tcp://localhost:10109/AnimalService.svc" />
<wsa10:EndpointReference>
<wsa10:Address>net.tcp://localhost:10109/AnimalService.svc</wsa10:Address>
</wsa10:EndpointReference>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>

次要 WSDL(在第一部分中引用)
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:i0="Spike.Contracts.Services" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://spikes/WcfCodeFirstExample/services/AnimalService" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" targetNamespace="http://spikes/WcfCodeFirstExample/services/AnimalService" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsp:Policy wsu:Id="NetTCPBinding_IAnimalService_policy">
<wsp:ExactlyOne>
<wsp:All>
<msb:BinaryEncoding xmlns:msb="http://schemas.microsoft.com/ws/06/2004/mspolicy/netbinary1"></msb:BinaryEncoding>
<wsaw:UsingAddressing></wsaw:UsingAddressing>
</wsp:All>
</wsp:ExactlyOne>
</wsp:Policy>
<wsdl:import namespace="Spike.Contracts.Services" location="" />
<wsdl:types />
<wsdl:binding name="NetTCPBinding_IAnimalService" type="i0:IAnimalService">
<wsp:PolicyReference URI="#NetTCPBinding_IAnimalService_policy"></wsp:PolicyReference>
<soap12:binding transport="http://schemas.microsoft.com/soap/tcp" />
<wsdl:operation name="GetAvailableAnimalTypes">
<soap12:operation soapAction="Spike.Contracts.Services/IAnimalService/GetAvailableAnimalTypes" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="AddPetAnimalType">
<soap12:operation soapAction="Spike.Contracts.Services/IAnimalService/AddPetAnimalType" style="document" />
<wsdl:input>
<soap12:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap12:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>

请记住,这是生成的 WSDL 和 XSD 不是手工制作的。我尝试了 netTcpbinding 和 basicHttpBinding 配置。很可能是我错误地使用了 SOAPUI,但是如果我尝试示例 WSDL ( http://www.webservicex.com/CurrencyConvertor.asmx?wsdl ),我确实看到了相关的操作,所以我认为我做得对。

我正在使用 SOAPUI 5.0。

最佳答案

我遇到了完全相同的问题,结果我使用的是 WebHttpBinding 而不是 BasicHttpBinding 。一旦我切换到使用 BasicHttpBinding,所有操作/方法都显示在 SoapUI 中。

关于c# - SOAPUI 未显示来自 WSDL 的操作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27691029/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com