私はc#serverとphp clientの間でWebサービスを使用しようとしています。soap fault '入力文字列が正しい書式ではありません'
私は引数なしでWebサービスを使用するとすべて動作します!
しかし、私はこのエラーを持つ関数に引数を渡したい: にSoapFault:ル・フォーマット・デ・ラ・CHAINE D'アントレEST間違った
私のWSDLファイル: https://pastebin.com/ti805zkW
私のPHPコード:
public function previewAction(Request $req)
{
$client = new \SoapClient("http://localhost:1664/WebReport/Service/?wsdl");
$preview = $client->Preview(array('id' => 1, 'choice' => 2, 'userDate' => 'test'));
return new JsonResponse($preview);
}
私のC#Iserviceコード:
using System.Collections.Generic;
using System.ServiceModel;
namespace WebReport
{
[ServiceContract]
public interface IService
{
[OperationContract]
bool Reload();
[OperationContract]
bool Treatment();
[OperationContract]
Dictionary<string, float> Preview(int id, int choice, string userDate);
}
}
私のC#のサービスコード:
using System;
using System.Collections.Generic;
namespace WebReport
{
public class Service : IService
{
public bool Reload()
{
//Application.GetInstance().ReloadConfig();
return true;
}
public bool Treatment()
{
//DataPoints.Treatment.GetInstance().run();
return true;
}
public Dictionary<string, float> Preview(int id, int choice, string userDate)
{
Console.WriteLine("{ 0}.{ 1}.{ 2}", id, choice, userDate);
Dictionary<string, float> test = new Dictionary<string, float>();
test.Add("2017-05-04 10:10:10", 100000);
test.Add("2017-05-05 10:10:10", 100001);
return test;
}
}
}
は私がwsdl2phpgeneratorが、同じエラーでWSDLファイルからPHPクラスを抽出するためのテストを持っています。
アイデア?