ClientBase classes are not available in Reference.cs file

。_饼干妹妹 提交于 2020-01-05 07:08:21

问题


I added a service reference in Visual Studio 2010 using following wsdl. It is added successfully. This is a wsdl generated from schema xsd files; not from actual service code. Any idea why this is not generating the required class and methods in Reference.cs file?

<?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>

回答1:


The issue was with incorrect xml namespace used by the tool. Please see the corrected wsdl in 400 Bad Request Exception: Simple SOAP WCF service with small data



来源:https://stackoverflow.com/questions/12410283/clientbase-classes-are-not-available-in-reference-cs-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!