2012-12-21 6 views
1

내 프로젝트에서 웹 서비스 파일을 포함 시켰습니다. 실행하려고 시도했을 때 Chrome 브라우저에서이 오류가 발생했습니다.내 프로젝트에 웹 서비스 파일이 포함 된 경우의 오류

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.


Compiler Error Message: CS0029: Cannot implicitly convert type 'Unified.WebService.GetOrder [c:\Users\Venkatesh\AppData\Local\Temp\Temporary ASP.NET Files\root\417f2571\29df25a\assembly\dl3\1f05470e\0779ccf4_47dfcd01_0\WasteManagement.DLL]' to 'Unified.WebService.GetOrder [c:\Users\Venkatesh\Desktop\Venkateshwar\Company Related\Waste Management - Copy\WasteManagement\WasteManagement\App_Code\GetOrder.cs(8)]'

소스 오류 : 나는 Compiler Warning Messages을 클릭하면

Line 43:   public GetOrder retrieveOrder(string orderNumber) 
Line 44:   { 
         //Calling Web service method in my class 
Line 45:/*ERROR*/  return connection.getOrder(orderNumber); 
Line 46:   } 
Line 47: 

, 그것은 웹 서비스를 통해 있던 모든 연결에서 오류를 보이고있다.

필요한 경우 코드도 공유합니다. (asp.net을 처음 사용하기 때문에 코드의 어느 부분을 공유 할 것인지 이해할 수 없으므로 필요하면 코드의 원하는 부분을 언급하십시오.)

답변

2

웹 서비스는 솔루션에서 독립적 인 프로젝트 여야합니다 . 그 후에 Web Reference를 추가해야합니다. 그러면 안전하게 호출 할 수 있습니다.

웹 서비스는 기본 클래스가 아니기 때문에 추가 할 수 있습니다. 따라서 다른 서비스와 마찬가지로 App_Code 폴더에 추가하여 작동시키지 않아도됩니다. MSDN에서

:

Web service discovery is the process by which a client locates a Web service and obtains its service description. The process of Web service discovery in Visual Studio involves interrogating a Web site following a predetermined algorithm. The goal of the process is to locate the service description, which is an XML document that uses the Web Services Description Language (WSDL).

The service description describes what services are available and how to interact with those services. Without a service description, it is impossible to programmatically interact with a Web service.

편집 :

예, 웹 서비스 선언에서 등 [WebMethod] 속성을 제거하고 클래스와 같은 임시로 사용을하지만, 그 후에도 수 있습니다 웹 서비스처럼 사용할 웹 참조를 추가 할 수 있습니다.

+0

필자는 Webservice 파일을 완전히 만들지 않았습니다. 그래서 그 때까지는 내 프로젝트 (내 동료가 선택한대로) 안에 보관하는 것으로 결정했습니다. –

+0

@Mr_Green 웹 서비스를 사용하기 전에 여전히 referenece를 추가해야합니다. 이것이 유일한 방법입니다. – VMAtm

+0

hmm ok 나는 당신의 충고를 받아 들일 것이다. .. 당신이 지금 설명했던 것에 따라 나는 같은 길을 가려고 시도하고 있었다.. 그러나 나의 친구가 나를 이것을 할 것을 제안했을 때 :). 그럼 알릴 것입니다. –

관련 문제