我的WCF服务的wsdl没有列出操作的输入参数。
我在做http://localhost:123/CalculatorService.svc?wsdl。浏览器显示wsdl,但正如我所说没有输入参数。
我看起来又高又低。我已经找到了很多关于如何启用wsdl生成的例子,但没有明确说明输入参数。
WcfTestClient获取输入参数,因此我知道它们以某种方式可用。
这是我的Web.config&的一部分。 app.Config(为了隐私目的我改了名字。)
<serviceBehaviors>
<behavior name="CalculatorServiceBehavior">
<serviceMetadata httpGetEnabled="true" policyVersion="Policy15" />
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" policyVersion="Policy15"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service
name="MyServiceNamespace.CalculatorService"
behaviorConfiguration="MyServiceNamespaceBehavior">
<host>
<baseAddresses>
<add baseAddress="http://localhost:63906/CalculatorService"/>
</baseAddresses>
</host>
<endpoint address=""
binding="wsHttpBinding"
contract="MyServiceNamespace.CalculatorService" />
<endpoint address="mex"
binding="mexHttpBinding"
contract="IMetadataExchange" />
</service>
</services>
答案 0 :(得分:1)
WCF生成的wsdl包含名称空间,一些名称空间链接到定义输入和输出合同的模式文档。这就是描述方法参数的地方。