|
svcutil.exe не может сгенерировать прокси
|
|||
---|---|---|---|
#18+
Добрый день, разбираюсь с WCF. На IIS разместил сервис. Конфиг Код: c# 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27.
Сам сервис Код: c# 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30.
Все простое, при обращении к http://localhost:81/TMHoste/service.svc You have created a service. To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax: svcutil.exe http://localhost:81/TMHoste/service.svc?wsdl Пытаюсь выполнить данную команду для генерации конфига и прокси класса для клиента и тут проблема. C:\Documents and Settings\user>"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\SvcUtil.exe" http://localhost:81/TMHoste/service.svc?wsdl Ошибка: Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1] Copyright (c) Microsoft Corporation. All rights reserved. Attempting to download metadata from ' http://localhost:81/TMHoste/service.svc?ws dl' using WS-Metadata Exchange or DISCO. Microsoft (R) Service Model Metadata Tool [Microsoft (R) Windows (R) Communication Foundation, Version 4.0.30319.1] Copyright (c) Microsoft Corporation. All rights reserved. Error: Cannot obtain Metadata from http://localhost:81/TMHoste/service.svc?wsdl If this is a Windows (R) Communication Foundation service to which you have acce ss, please check that you have enabled metadata publishing at the specified addr ess. For help enabling metadata publishing, please refer to the MSDN documentat ion at http://go.microsoft.com/fwlink/?LinkId=65455. WS-Metadata Exchange Error URI: http://localhost:81/TMHoste/service.svc?wsdl Metadata contains a reference that cannot be resolved: ' http://localhost:81/ TMHoste/service.svc?wsdl'. <?xml version="1.0" encoding="utf-16"?><Fault xmlns=" http://www.w3.org/2003/ 05/soap-envelope"><Code><Value>Sender</Value><Subcode><Value xmlns:a=" http://sch emas.xmlsoap.org/ws/2005/02/sc">a:BadContextToken</Value></Subcode></Code><Reaso n><Text xml:lang="ru-RU">The message could not be processed. This is most likely because the action 'http://schemas.xmlsoap.org/ws/2004/09/transfer/Get' is inco rrect or because the message contains an invalid or expired security context tok en or because there is a mismatch between bindings. The security context token w ould be invalid if the service aborted the channel due to inactivity. To prevent the service from aborting idle sessions prematurely increase the Receive timeou t on the service endpoint's binding.</Text></Reason></Fault> HTTP GET Error URI: http://localhost:81/TMHoste/service.svc?wsdl The document was understood, but it could not be processed. - The WSDL document contains links that could not be resolved. - There was an error downloading 'http://localhost:81/TMHoste/service.svc?xsd=xsd0'. - The underlying connection was closed: An unexpected error occurred on a rece ive. - Unable to read data from the transport connection: An existing connection wa s forcibly closed by the remote host. - An existing connection was forcibly closed by the remote host В чем может быть проблема? И как можно решить? Проверить сможет ли VS создать прокси класс спомощью Add Reference -возможности нет. ... |
|||
:
Нравится:
Не нравится:
|
|||
29.05.2014, 03:36 |
|
svcutil.exe не может сгенерировать прокси
|
|||
---|---|---|---|
#18+
Проблема оказалось простой. В IIS для сервиса был создан отдельный пул и соответственно заведен был юзер у которого куда-то не хватает прав. Если же у пула поставить во вкладке Identity - Local System, то все проходит на ура. Вопрос номер два. Усложняем сервис, необходимо добавить ссылку на свою библиотеку+появляется в контракте класс из этой библиотеки. Теперь при обращении к http://localhost:81/TMHoste/service.svc Compilation Error 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: CS0246: The type or namespace name 'WorkMainDll' could not be found (are you missing a using directive or an assembly reference?) Насколько понимаю, он не знает ничего про мою библиотеку, как можно это исправить (библиотека лежит, где и файлик service.cs в App_Code) Что настроить чтобы при обращении к службе и ее компиляции, она искала библиотеку в своей же папке? Код: c# 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 27. 28. 29. 30. 31. 32. 33. 34. 35. 36. 37. 38. 39. 40. 41. 42. 43. 44. 45. 46. 47. 48. 49. 50. 51.
... |
|||
:
Нравится:
Не нравится:
|
|||
30.05.2014, 06:06 |
|
|
start [/forum/topic.php?fid=19&msg=38655197&tid=1396979]: |
0ms |
get settings: |
10ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
33ms |
get topic data: |
13ms |
get forum data: |
2ms |
get page messages: |
41ms |
get tp. blocked users: |
1ms |
others: | 272ms |
total: | 394ms |
0 / 0 |