有人请让我知道如何使用目标 c 将参数传递给 WCF 函数吗?
1.我用C#开发WCF。
2. WCF端点如下。
<system.serviceModel>
<services>
<service name="iAppServ.Service1" behaviorConfiguration="ServBehave">
<!--Endpoint for SOAP-->
<endpoint address="soapService" binding="basicHttpBinding" contract="iAppServ.IService1"/>
<!--Endpoint for REST-->
<endpoint address="XMLService" binding="webHttpBinding" behaviorConfiguration="restPoxBehavior" contract="iAppServ.IService1"/>
</service>
</services>
<bindings>
<webHttpBinding>
<binding crossDomainScriptAccessEnabled="True" name="webHttpBinding">
</binding>
</webHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="ServBehave" >
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<!--Behavior for the REST endpoint for Help enability-->
<behavior name="restPoxBehavior" >
<webHttp helpEnabled="true" />
</behavior>
</endpointBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
</system.serviceModel>
我想通过传递一个搜索文本来使用“SearchUserData”函数。
WCF 将返回 XML 数据。