C# 서버와 PHP 클라이언트간에 웹 서비스를 사용하려고합니다.비누 오류 '올바른 형식이 아닌 입력 문자열'
인수없이 웹 서비스를 사용할 때 모두 작동합니다!
하지만 함수에 인수를 전달하고자 할 때이 오류가 : SOAPFault의 : 르 형식을 드 라 Chane 디부 연예 동부 표준시 잘못된
내 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 클래스를 추출하는 시험이있다.
아이디어가 있으십니까?