C# 如何使我的WCF消息契约显示在导入的架构中?

C# 如何使我的WCF消息契约显示在导入的架构中?,c#,wcf,wsdl,schema,xsd,C#,Wcf,Wsdl,Schema,Xsd,一个客户机为我们提供了他们想要开发的服务的模式和wsdl。当我开始这个项目时,已经有了一个服务实现。当我在IE中调出svc文件时,它会显示正常的svcutil命令等。。当我深入查看我们正在使用的wsdl导入的模式时,我注意到MessageContracts没有显示在模式中。我该怎么做才能使MessageContracts显示出来,从而使模式更加理想 比如客户给我们这个 <xs:schema elementFormDefault="qualified" targetNamespace="ht

一个客户机为我们提供了他们想要开发的服务的模式和wsdl。当我开始这个项目时,已经有了一个服务实现。当我在IE中调出svc文件时,它会显示正常的svcutil命令等。。当我深入查看我们正在使用的wsdl导入的模式时,我注意到MessageContracts没有显示在模式中。我该怎么做才能使MessageContracts显示出来,从而使模式更加理想

比如客户给我们这个

<xs:schema elementFormDefault="qualified" targetNamespace="http://ws.tcore.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.tcore.com">
<xs:import schemaLocation="ATISDataContracts.xsd" namespace="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
<xs:import schemaLocation="Serialization.xsd" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> 
<xs:element name="ASICDetectorInventoryRequestMC">
 <xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="DetectorInventoryRequest" nillable="true" type="q1:DetectorInventoryRequestDC" xmlns:q1="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
 </xs:sequence>
 </xs:complexType>
 </xs:element>
  <xs:element name="ConnectionRequest" nillable="true" type="q2:ConnectionRequestDC" xmlns:q2="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
他们的模式显示复杂类型,但我的派生模式只显示元素,而不显示复杂类型。我做错了什么?任何帮助或提示都将不胜感激

谢谢你的帮助,

~ck in San Diego

默认情况下,当生成WSDL文件时,架构的一部分被拆分为其他导入文件,这可能与最初使用的导入(例如,在客户端提供的WSDL文件中)不一致。如果导航到导入的XSD文件(http://localhost:9305/mex?xsd=xsd1,例如)你应该找到一些你似乎缺少的元素

  <xs:schema elementFormDefault="qualified" targetNamespace="http://ws.tcore.com" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://ws.tcore.com">
<xs:import schemaLocation="http://localhost:9305/mex?xsd=xsd1" namespace="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
<xs:import schemaLocation="http://localhost:9305/mex?xsd=xsd0" namespace="http://schemas.microsoft.com/2003/10/Serialization/" /> 
<xs:element name="DetectorInventoryRequest" nillable="true" type="q1:DetectorInventoryRequestDC" xmlns:q1="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
<xs:element name="ConnectionRequest" nillable="true" type="q2:ConnectionRequestDC" xmlns:q2="http://schemas.datacontract.org/2004/07/tcore.ATISDataContracts" /> 
namespace tcore.ATISDataContracts
{
  [MessageContract(IsWrapped = false)]
  public class ASICDetectorInventoryRequestMC
  {
      [MessageHeader]
      public ConnectionRequestDC ConnectionRequest;

      [MessageBodyMember]
      public DetectorInventoryRequestDC DetectorInventoryRequest;
  }
}