2011-05-13 3 views
2

형식이 잘못했다 (C 번호 /의 WinForm 응용 프로그램에서 호출) :입력 문자열이 나는 동일한 인터페이스를 두 개의 웹 서비스 기능을

string[] f1(int, string[])string[] f2(int, string[])

난을 보내고있다하기 똑같은 데이터. f1을 호출하면 올바르게 작동하고 문자열 []을 반환하지만 f2를 호출하면 "입력 문자열이 올바른 형식이 아닙니다"라는 SOAPException이 발생합니다.

하나가 작동하고 다른 하나가 작동하지 않을 수있는 원인은 무엇입니까?

private void backgroundWorkerUploadNew_DoWork(object sender, DoWorkEventArgs e) 
    { 
     List<String> submittedList = new List<String>(); 
     StreamReader reader = new StreamReader(this.textBoxFilename.Text); 
     String data; 

     while ((data = reader.ReadLine()) != null) 
     { 
      submittedList.Add(data); 
     } 
     reader.Close(); 
     // Send array of handset names to service 
     int channelId = 0; 
     string[] listToSubmit = submittedList.ToArray(); 
     channelId = AppStatus.CurrentChannel.ChannelID; 
     String[] newHandsetsList = service.Function2(channelId, listToSubmit); 
     ... 
    } 

public List<String> Function2(int integer, List<String> strings) 
{ 
    List<String> newList = new List<string>(); 
    DataTable tempDt = null; 
    foreach (String s in strings) 
    { 
     String q = @"** SOME QUERY **"; 
     tempDt = Database.RunSql(q); 
     ... 
    } 
    return newList; 
} 
+0

문자열에 날짜가 들어 있습니까? –

+0

데니스, 코드 스 니펫을 게시 할 수 있습니까? –

+0

또한 전송할 데이터를 추가하십시오. 두 서비스가 동일한 시스템에서 실행되고 있습니까? – Flawless

답변

2

그 메시지는 (숫자 유형, 날짜 시간 등) parse 메소드에서 제공되는 웹 서비스 방법. 컴퓨터가 다른 문화권을 사용하는 경우 올바른 형식이 다를 수 있습니다. 이것이 문제라면 불변 문화를 사용하여 문제를 해결할 수 있습니다.

+0

해결 : 글쎄, 문화적 문제는 아니었지만, 셀 (SQL Count() 번호)에서 값을 가져 오려고 할 때 DataRow를 int로 변경하려고했습니다. – Dennis

관련 문제