1

我使用以下 wsdl 在 Visual Studio 2010 中添加了服务引用。添加成功。这是从模式 xsd 文件生成的 wsdl;不是来自实际的服务代码。知道为什么这没有在 Reference.cs 文件中生成所需的类和方法吗?

<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:import0="urn:thinktecture-com:demos:restaurantservice:messages:v1" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:import1="urn:thinktecture-com:demos:restaurantservice:data:v1" xmlns:tns="urn:lijo:demos:multiplyservice:calculation:v1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" name="CalculationService" targetNamespace="urn:lijo:demos:multiplyservice:calculation:v1" xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<types>
<xsd:schema>
  <xsd:import schemaLocation="C:\toolbox\LijosServiceApp\NewService\RestaurantMessages.xsd" namespace="urn:thinktecture-com:demos:restaurantservice:messages:v1" />
  <xsd:import schemaLocation="C:\toolbox\LijosServiceApp\NewService\RestaurantData.xsd" namespace="urn:thinktecture-com:demos:restaurantservice:data:v1" />
</xsd:schema>
</types>

<message name="getMultipliedIn">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<part name="parameters" element="import0:getMultiplied" />
</message>
<message name="getMultipliedOut">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<part name="parameters" element="import0:getMultipliedResponse" />
</message>

<portType name="CalculationServiceInterface">
<wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
<operation name="getMultiplied">
  <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" />
  <input message="tns:getMultipliedIn" />
  <output message="tns:getMultipliedOut" />
</operation>
</portType>

<binding name="BasicHttpBinding_CalculationServiceInterface" type="tns:CalculationServiceInterface">

<soap:binding transport="http://schemas.xmlsoap.org/soap/http" />

<operation name="getMultiplied">
  <soap:operation soapAction="urn:lijo:demos:multiplyservice:calculation:v1:getMultipliedIn" style="document" />
  <input>
    <soap:body use="literal" />
  </input>
  <output>
    <soap:body use="literal" />
  </output>
  </operation>
  </binding>
  <service name="CalculationServicePort">
 <port name="CalculationServicePort" binding="tns:BasicHttpBinding_CalculationServiceInterface">
  <soap:address location="http://localhost/CalculationService" />
  </port>
 </service>
 </definitions>
4

1 回答 1

0

问题在于该工具使用的 xml 命名空间不正确。请参阅400 Bad Request Exception: Simple SOAP WCF service with small data中更正后的 wsdl

于 2012-09-13T16:42:38.297 回答