Web services WCF/WSDL文件似乎格式不正确

Web services WCF/WSDL文件似乎格式不正确,web-services,visual-studio,wcf,wsdl,Web Services,Visual Studio,Wcf,Wsdl,嗯。所以我有一个功能齐全的WCF REST服务。我可以使用Fiddler发送JSON并得到预期的响应 到目前为止还不错 但是,当我尝试在.Net项目中添加服务引用时,我在尝试创建服务时抛出了一个错误,请参考-我想我已经找到了根本原因,但它与以前完全不同,因此我决定打开另一个问题 请注意,它不是VisualStudio。我可以添加对其他服务的引用,多个不同的VS安装不会与我的服务一起工作 我认为根本原因是我的WSDL文件不正确。这里有一个微软提供的示例,这里有一个活生生的例子 结果是,这两个示例都

嗯。所以我有一个功能齐全的WCF REST服务。我可以使用Fiddler发送JSON并得到预期的响应

到目前为止还不错

但是,当我尝试在.Net项目中添加服务引用时,我在尝试创建服务时抛出了一个错误,请参考-我想我已经找到了根本原因,但它与以前完全不同,因此我决定打开另一个问题

请注意,它不是VisualStudio。我可以添加对其他服务的引用,多个不同的VS安装不会与我的服务一起工作

我认为根本原因是我的WSDL文件不正确。这里有一个微软提供的示例,这里有一个活生生的例子

结果是,这两个示例都比我调用WSDL时拥有更多

但是当我使用单页WSDL时,我得到了各种信息-

我想问题出在我的WCF服务的Web.config文件中,我在那里设置了端点

是否有人认为我的代码有问题会导致我在另一个问题中讨论的问题?我会很高兴地发现我只是在做一些愚蠢的事情

<client>
  <endpoint address="https://apitest.authorize.net/soap/v1/Service.asmx" binding="basicHttpBinding" bindingConfiguration="ServiceSoap" contract="AuthorizeNetCIMTest.ServiceSoap" name="ServiceSoap" />
</client>
<services>
  <service name="Marius.Marius_1_0_0" behaviorConfiguration="metadataSupport">
    <endpoint address="" behaviorConfiguration="Marius.MariusAspNetAjaxBehavior" bindingConfiguration="TransportSecurity" contract="Marius.Marius_1_0_0" binding="webHttpBinding" />
    <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
  </service>
</services>


<!--This is the transport the all the services use. It specifies that all the connections have to use HTTPS. Since there are no bindings for HTTP all those connections will 404-->
<bindings>
  <basicHttpBinding>
    <binding name="ServiceSoap">
      <security mode="Transport" />
    </binding>
    <binding name="ServiceSoap1" />
  </basicHttpBinding>
  <webHttpBinding>
    <binding name="TransportSecurity">
      <security mode="Transport">
        <transport clientCredentialType="None" />
      </security>
    </binding>
  </webHttpBinding>
</bindings>

<behaviors>
  <serviceBehaviors>
    <behavior name="metadataSupport">
      <!-- Enables the IMetadataExchange endpoint in services that -->
      <!-- use "metadataSupport" in their behaviorConfiguration attribute. -->
      <!-- In addition, the httpGetEnabled and httpGetUrl attributes publish -->
      <!-- Service metadata for retrieval by HTTP/GET at the address -->
      <!-- "http://localhost:8080/SampleService?wsdl" -->
      <serviceMetadata httpsGetEnabled="true" policyVersion="Policy15" httpsGetUrl="" />
    </behavior>
  </serviceBehaviors>
  <endpointBehaviors>
    <behavior name="Marius.MariusAspNetAjaxBehavior">
      <webHttp defaultOutgoingResponseFormat="Json" />
    </behavior>
  </endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />

约翰是对的,下面是问题的描述。看起来唯一的选择是使用RestSharp编写一些代码。呃。

WSDL只适用于SOAP。服务引用也是如此。