그래서 C# 프로젝트에서 xml에 Linq를 사용하는 XML 문서 (학생 이름과 Id 이름 포함)를로드하고 관련 데이터 (기한, 금액 및 물건) WCF 서비스에서. 오른쪽 클릭만으로 서비스를 추가하고 서비스 참조를 추가 했으므로 배열을 GetData 함수에 전달해야합니다.이 함수는 초기화되었지만 null을 명시 적으로 전달해야합니다. 내 배열을 서비스 유형으로 변환 할 수 없으며 함수도 배열을 반환합니다. 어떻게 배열을 studentArray에 할당합니까?배열을 WCF 함수에 전달
ServiceReference1.ServiceClient client = new ServiceReference1.RycorServiceClient();
Application.ServiceReference1.Student[] studentArray = new ServiceReference1.Student[9];
Student[] array = studentList.ToArray();
//for (int i = 0; i <= array.Count(); i++)
// studentArray[i] = (RycorApplication.ServiceReference1.Student)array[i];
//this gives me an error says Cannot convert type 'Application.Student' to 'Application.ServiceReference1.Student'.
var data = client.GetData(studentArray);
이 데이터를 가져온 후이 데이터를 XML 파일에 어떻게 저장합니까?
왜냐하면, 내가하고있는 프로젝트, 그들은 이미 서비스를 주었고, 나는 wcf 서비스를 만들지 않았기 때문이다. –
studentArray가 Empty이고 9의 빈 배열입니다. –
덜 혼란스럽게 수정되었습니다 (잘하면). 기본적으로 내가 아는 유일한 방법은 이미 가지고있는 학생들의 배열을 반복하고 각 객체를 wcf 서비스가 기대하는 유형으로 변환하는 것입니다. –