저는 fx3.5에서 WCF를 사용하여 JSONP 웹 서비스를 배우고 구축했습니다. 당신은 내가 가지고 있었던 시련의 일부를 읽을 수 있습니다 .NET ASMX - Returning Pure JSON? 마침내 샘플을 실행하고 있지만 지금은 내 애플 리케이션으로 꼬리 도덕이다.확장명 '[extensionHere]'에 등록 된 [nameHere] 유형을로드 할 수 없습니다.
- RivWorks.Web -이 웹 사이트 - http://dev.example.com
- RivWorks.Web.Service로 위치 - 새 JSONP 서비스 - http://dev.example.com/services/에 위치한 - 서비스의 Web.config 여기에 상주합니다.
서비스의 Web.config :
<system.serviceModel>
<behaviors>
<endpointBehaviors>
<behavior name="JsonpServiceBehavior">
<webHttp />
</behavior>
</endpointBehaviors>
</behaviors>
<services>
<service name="RivWorks.Web.Service.CustomerService">
<endpoint address=""
binding="customBinding"
bindingConfiguration="jsonpBinding"
behaviorConfiguration="JsonpServiceBehavior"
contract="RivWorks.Web.Service.ICustomerService" />
</service>
<service name="RivWorks.Web.Service.NegotiateService">
<endpoint address=""
binding="customBinding"
bindingConfiguration="jsonpBinding"
behaviorConfiguration="JsonpServiceBehavior"
contract="RivWorks.Web.Service.INegotiateService" />
</service>
</services>
<bindings>
<customBinding>
<binding name="jsonpBinding" >
<jsonpMessageEncoding />
<httpTransport manualAddressing="true"/>
</binding>
</customBinding>
</bindings>
<extensions>
<bindingElementExtensions>
<add name="jsonpMessageEncoding"
type="RivWorks.Web.Service.JSONP.JsonpBindingExtension
, RivWorks.Web.Service
, Version=1.0.0.0
, Culture=neutral
, PublicKeyToken=null"/>
</bindingElementExtensions>
</extensions>
</system.serviceModel>
나는 다음과 같은 오류가 발생하고 있고 나는 그것을 해결하는 생각할 수있는 모든 노력을했습니다. 내 코드 전체에 몇 가지 오타가 있음을 발견했습니다 (서비스 대신 Sevice). MSDN에있는 샘플 코드를 사용하고 있습니다. 여기에 오류가 있습니다 :
Configuration Error Description:** An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: The type 'RivWorks.Web.Service.JSONP.JsonpBindingExtension
, RivWorks.Web.Service
, Version=1.0.0.0
, Culture=neutral
, PublicKeyToken=null' registered for extension 'jsonpMessageEncoding' could not be loaded.
Source Error:
Line 58: <customBinding>
Line 59: <binding name="jsonpBinding">
Line 60: <jsonpMessageEncoding />
Line 61: <httpTransport manualAddressing="true" />
Line 62: <binding>
Source File: C:\RivWorks\dev\services\web.config Line: 60
Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082
다른 사람이 내가 확인할 수있는 아이디어가 있습니까? RivWorks.Web.Service.dll이라는 DLL이 만들어져 웹 사이트의 bin 디렉토리에 복사됩니다. Web.config 서비스가 웹 사이트의 Services 디렉터리에 복사됩니다. 웹 사이트의 web.config에 상충되는 내용이 없습니다. 모든 철자 문제를 점검했습니다.
이것은 공식적인 대답은 아니지만이 정확한 문제에 대한 좌절감을 공유하고자합니다. IIS에서 응용 프로그램 A (App_A)를 호스팅하는 사이트 A가 있습니다. 그런 다음 사이트 A 아래에 응용 프로그램 B (App_B)를 호스팅하는 가상 디렉터리가 있습니다. App_A는 위와 유사한 사용자 정의 확장을 구현합니다. App_B의 web.config는 App_A의 web.config에서이 사용자 지정 확장을 상속 받았습니다. 이것은 여기에 설명 된 정확한 오류를 던지고있었습니다. 이것은 올바르게 설정하지 않으면 완전히 잘못되었다. 나는 그걸 모든 사람과 공유하고 싶었습니다. 가치있는 대답인지 확실하지 않습니다. – dyslexicanaboko