|
System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251
|
|||
---|---|---|---|
#18+
Кто-нибудь сталкивался с такой ошибкой? В инете почитал - пишут что угодно - не поймешь ничего... Вообще тут по ходу работы моей проги происходит обращение к Assist (для процессинга платиковых карт) - суппорту написал, но они молчат как партизаны. Это вообще-то даже не сам процессинг пока, а только курсы ЦБ вычитываются. Дальше по алгоритму прога просто пока не пошла - слишком много проблем даже на этом этапе. Но все вызовы сервисов делаются по идее в той же среде (кодировки и вся прочая хрень). Не понимаю, как может быть не та кодировка, если я тупо сгенерировал из студии стандартные обертки ServiceReference. Совершенно никаких ручных правок не вносил. Что вообще происходит? System.ServiceModel.ProtocolException{"The content type text/xml; charset=windows-1251 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 536 bytes of the response were: '<?xml version='1.0' encoding='windows-1251' standalone='no'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'> <SOAP-ENV:Body SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'> <SOAP-ENV:Fault> <faultcode>5</faultcode> <faultstring>100</faultstring> <detail></detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>'."} System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 536 bytes of the response were: '<?xml version='1.0' encoding='windows-1251' standalone='no'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'> <SOAP-ENV:Body SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'> <SOAP-ENV:Fault> <faultcode>5</faultcode> <faultstring>100</faultstring> <detail></detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>'."} Data: {System.Collections.ListDictionaryInternal} HelpLink: Nothing InnerException: Nothing Message: "The content type text/xml; charset=windows-1251 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly. The first 536 bytes of the response were: '<?xml version='1.0' encoding='windows-1251' standalone='no'?> <SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/' SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'> <SOAP-ENV:Body SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/'> <SOAP-ENV:Fault> <faultcode>5</faultcode> <faultstring>100</faultstring> <detail></detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope>'." Source: "mscorlib" StackTrace: " Server stack trace: at System.ServiceModel.Channels.HttpChannelUtilities.ValidateRequestReplyResponse(HttpWebRequest request, HttpWebResponse response, HttpChannelFactory factory, WebException responseException, ChannelBinding channelBinding) at System.ServiceModel.Channels.HttpChannelFactory.HttpRequestChannel.HttpChannelRequest.WaitForReply(TimeSpan timeout) at System.ServiceModel.Channels.RequestChannel.Request(Message message, TimeSpan timeout) at System.ServiceModel.Dispatcher.RequestChannelBinder.Request(Message message, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operati on) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at AssistTestKurs.AssistSoapPort.GetRate(GetRateRequest request) at AssistTestKurs.AssistSoapPortClient.AssistTestKurs.AssistSoapPort.GetRate(GetRateRequest request) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\www\bc44e63b\e2f0d5df\App_WebReferences.xi_emj5s.5.cs:line 158 at AssistTestKurs.AssistSoapPortClient.GetRate(Int32 shop_id, String login, String password, String currency, String date) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\www\bc44e63b\e2f0d5df\App_WebReferences.xi_emj5s.5.cs:line 168 at Test.Button1_Click(Object sender, EventArgs e) in G:\Projects\Airts\Www\Test.aspx.vb:line 17" TargetSite: {System.Reflection.RuntimeMethodInfo} ... |
|||
:
Нравится:
Не нравится:
|
|||
21.09.2010, 16:05 |
|
System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251
|
|||
---|---|---|---|
#18+
Быдло-Кодер, да все просто. http же всегда передает в какой кодировке будет передано сообщение. вот тебе говорят.что служба откуда ты берешь данные передает в 1251, а служба твоя имеет в биндинге настройку для utf8. ... |
|||
:
Нравится:
Не нравится:
|
|||
21.09.2010, 16:39 |
|
System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251
|
|||
---|---|---|---|
#18+
а почему это происходит? мне надо изменить в конфигурации привязку? я наверное туплю, но мне казалось, что если я вычитываю WSDL некой службы - то все биндинги там по умолчанию уже прописаны мне наверное просто везло - я уже делал несколько проектов, обращающихся к внешним сервисам и мне не требовалось вручную менять биндинги в кодировках - из этого я сделал вывод что WSDL содержит все необходимые данные для кодировки этот вывод неверный? после онлайнового выдергивания wsdl надо еще обязательно подгонять как минимум кодировку в биндинге чтобы обратиться к внешнему сервису? ... |
|||
:
Нравится:
Не нравится:
|
|||
21.09.2010, 20:03 |
|
System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251
|
|||
---|---|---|---|
#18+
все, техподдержку Ассиста заклинило - они утверждают, что я не знаю своих логинов/паролей/shop_id (хотя я сейчас сижу в их панели и оттуда переговариваюсь с их суппортом) остается понять в чем же дело (теперь уже без супорта Ассиста) Итак, они мне отдали вот такой WSDL Код: plaintext 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.
MS Visual Studio сгенерировала мне вот такие привязки Код: plaintext 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.
Что здесь надо поправить за Visual Studio? (то что бросается в глаза - я пробовал править) ... |
|||
:
Нравится:
Не нравится:
|
|||
21.09.2010, 21:03 |
|
System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251
|
|||
---|---|---|---|
#18+
ну собственно я перепробовал все кодировки, которые смог придумать ISO-8859-5 ISO-8859-1 WINDOWS-1251 CP866 KOI8-r KOI8-ru utf-7 во всех случаях получил такое сообщение: Код: plaintext
не понимаю, что за хрень - самый распространеный российский сервис... как то ж он работает? я ничего специального не делал - считал просто студией его WSDL в чем тут хитрость - что такая элементарная задачка не решаема? это все заточено именно одно для другого (и ни для чего другого не применимо) - биндинги, публичный платежный сервис, wcf, автоматически сгенерированный MS-студией враппер? откуда ж такие глюки? ... |
|||
:
Нравится:
Не нравится:
|
|||
21.09.2010, 22:31 |
|
System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251
|
|||
---|---|---|---|
#18+
Быдло-Кодер, ты уже код дай, который можно запустить. хоре тут задачки по своему глючному коду задавать :) ... |
|||
:
Нравится:
Не нравится:
|
|||
22.09.2010, 11:03 |
|
System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251
|
|||
---|---|---|---|
#18+
да нету тут никакого кода обьявляется единственный обект, который возможно обьявить по сгенерированной обертке в нем единственный метод, принимающий пять параметров - логин, пароль, shop_id, код валюты и дата как такового кода нету = есть сгенерированный студией прокси-класс, по онлайновому обьявлению WSDL есть единственный обявленный метод в WSDL, есть логин, пароль, номер магазина, которые я вижу в панели Ассиста, есть коды валют в документации (USD) и есть дата - ВСЕ. какой тут может быть код - одна строчка обращения к прокси классу, сгенерированному студией по официально обьявленному публичному WSDL насколько я понимаю - этот вопрос задан, чтобы увести обсуждение в сторону от того, КАКИЕ ИМЕННО кодировки поддерживает стандартный клиент WCF? ... |
|||
:
Нравится:
Не нравится:
|
|||
22.09.2010, 11:41 |
|
System.ServiceModel.ProtocolException: {"The content type text/xml; charset=windows-1251
|
|||
---|---|---|---|
#18+
Да, теперь я понял, что круче Ассиста только вареные яйца - не зря у них нет официального публичного форума техподдержки. Впрочем к заданному вопросу вопросу о поддержке различных кодировок микрософтовским WCF-клиентом это отношения не имеет. ... |
|||
:
Нравится:
Не нравится:
|
|||
22.09.2010, 12:28 |
|
|
start [/forum/topic.php?fid=19&fpage=25&tid=1397595]: |
0ms |
get settings: |
8ms |
get forum list: |
14ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
72ms |
get topic data: |
12ms |
get forum data: |
3ms |
get page messages: |
47ms |
get tp. blocked users: |
2ms |
others: | 14ms |
total: | 178ms |
0 / 0 |