0
私は石鹸ベースのwcfサービスに取り組んでいます。テストクライアント経由で消費しようとすると、次のエラーが発生します。石鹸ベースのwcfサービスを使用することができません
値をnullにすることはできません。パラメータ名:クラスの実装の
interface:
[WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Xml,
ResponseFormat = WebMessageFormat.Json, UriTemplate = "/updateTimesheet?timesheetID={timesheetID}")]
[OperationContract]
string updateTimesheet(string timesheetID);
:
public string updateTimesheet(string timesheet)
{
XmlDocument doc = new XmlDocument();
doc.LoadXml(timesheet);
XmlNode xnodeTimeSheetHourID = doc.DocumentElement.SelectSingleNode("TimeSheetHourID");
XmlNode xnodeHours = doc.DocumentElement.SelectSingleNode("TimeSheetHourID");
return xnodeTimeSheetHourID.Value+" "+xnodeHours.Value;
}
をweb.configファイル:
<service behaviorConfiguration="postServiceBehavior" name="postService">
<endpoint address="http://172.xx.xxx.xxx:xxxx/postService.svc/basic" binding="basicHttpBinding" bindingConfiguration="basicBinding" contract="IpostService">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
一部opneは、エラーを解決する方法を私を助けてくださいことができますか?私はWebInvoke方法でいくつかの問題があることはかなり確信しているが、私はあなたのエンドポイント定義が間違っているファイルを、あなたのweb.configファイルで
パンカジ
コードはwebHttpBindingを使用しているため、updateTimesheet操作でJSON形式のレスポンスが返されます。答えにsystem.serviceModel設定またはWCFサービス設定コードを追加してください。 –
WCFサービスへのアクセス方法に関するクライアントコードを投稿できますか? – Rajesh
@SixtoSaez最新のコードを確認してください。ここにweb.configコードを追加しました。あなたが求めているのはこれですか? – pankaj