2010-01-19 2 views
0

질문하고 싶습니다. 전 동료 중 한 명은 창백한 프로젝트를 작성 했으므로이 프로젝트를 계속 진행해야합니다. 웹 서비스는 저 창 하늘 프로젝트에 있으며 실버 라이트로 웹 서비스를 호출해야합니다. 그러므로, 나는 기존의 창 하늘빛 프로젝트에서 새로운 은빛 프로젝트를 추가한다. 그리고 실버 라이트 애플리케이션에 Service Reference를 추가하려고 할 때. "Silverlight3과 호환되는 끝 점이 없습니다."라는 메시지가 나타나고 ServiceReference.config 파일을 만들 수 없습니다.Cloud Service Project에 추가 된 Silverlight에서 webservice를 호출하는 방법은 무엇입니까?

웹 서비스와 C#이 너무 비슷하지 않습니다. Silverlight에서 웹 서비스를 사용하는 단계별로 안내해 줄 수 있습니까?

또한 Web.config 파일에서 "basicHttpBinding"및 "customBinding"을 변경하려고했습니다. 그러나 그것은 내가 아무것도 바꿀 수 없게한다. 따라서 서버 측에서 아무 것도 변경하지 않고 어떻게 silverlight에서 webservice를 호출 할 수 있습니까?

다음은 코드의 일부입니다.

IEventHandler.cs 
`[OperationContract] 
     [WebGet(UriTemplate = "Holidays", ResponseFormat = WebMessageFormat.Xml)] 
     List<Holidays> GetHolidays();` 

EventHandler.svc 
`public List<Holidays> GetHolidays() 
     { 
      //database declaration for purpose of accessing the db. 
      Database db = new Database(); 

      //dg.getHolidays is found in the Database class. 
      List<Holidays> holidays = db.getHolidays(); 

      return holidays; 
     }` 

Web.config 
`<system.serviceModel> 
    <bindings> 
     <webHttpBinding> 
     <binding name="webBinding" 
       maxBufferPoolSize="2147483647" 
       maxBufferSize="2147483647" 
       maxReceivedMessageSize="2147483647" > 
      <readerQuotas 
      maxArrayLength="2147483647" 
      maxStringContentLength="2147483647"/> 
      <!--<security mode="Transport"> 
      </security>--> 
     </binding> 
     </webHttpBinding> 
    </bindings> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="webBehavior"> 
      <webHttp /> 
      <enableWebScript/> 
     </behavior> 
     </endpointBehaviors> 
     <serviceBehaviors> 
     <behavior name="Rest_EventHandler_WebRole.EventHandlerBehavior"> 
      <serviceMetadata httpGetEnabled="true" /> 
      <serviceDebug includeExceptionDetailInFaults="false" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    <services> 
     <service behaviorConfiguration="Rest_EventHandler_WebRole.EventHandlerBehavior" 
     name="Rest_EventHandler_WebRole.EventHandler"> 
     <endpoint address="" behaviorConfiguration="webBehavior" binding="webHttpBinding" 
      bindingConfiguration="webBinding" contract="Rest_EventHandler_WebRole.IEventHandler"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     </service> 
    </services> 
    </system.serviceModel>` 

실버 라이트의 경우 어떻게 WebService를 호출 할 수 있습니까? 서버 측 부품을 변경할 권한이 없습니다. sisvcutil.exe를 사용해야합니까? 친절하게 제 문제를 도와 주실 수 있습니까?

답변

0

나는 이것을 할 수 있다고 생각하지 않습니다. Silverlight는 basicHttpBinding 및 customBinding 만 지원합니다. 한 가지 옵션은 푸른 색 서비스를 호출하고 그 결과를 Silverlight에 다시 전달하는 중간 WCF 서비스 계층을 만드는 것이라고 가정합니다.

실버 라이트 클라이언트 -> 중동 WCF 층 -> 푸른 서비스

그러나이 unnecesssary 및 과잉 보인다. 웹 서비스를 제어 할 수있는 방법이 없습니까?

관련 문제