locked
SyncFramework using WebService : security restrictions, the type SyncGroupMetaData cannot be accessed RRS feed

  • Question

  • Hi All,

    This is my first post because I had problems regarding SyncFramework.

    To make story short:
    I have a server and client. Server expose a WebService and client triggers calls to WS to synchronize (SyncAgent is placed on client).
    But, both on server and client access an application server which uses Remoting.

    So the architecture is like this:

           Remoting 
    WS ----------> App Server (All SyncAdapter placed here)
    \
     \
      \         Remoting
       Client --------> App Server (All SyncAdapter placed here)

    And, since WS must expose 4 methods (GetServerInfo, GetSchema, GetChanges, ApplyChanges), it calls method from AppServer which is done via remoting. However, when calling one of the method (GetChanges), it encounters an error:
    ************** Exception Text **************
    System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Sync WS Error:Because of security restrictions, the type Microsoft.Synchronization.Data.SyncGroupMetadata cannot be accessed.
       at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
       at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
       at SyncWS.SyncService.GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession) in C:\BNF3\Sync\SyncBase\SyncBase\Web References\SyncWS\Reference.cs:line 385
       --- End of inner exception stack trace ---


    I marked the exception text with bold, the matter is, since it HAS to call remote method to return back values, it get that exception (security restrictions). Well how can I workaround this? any idea?

    This is one of the exposed WS method that has problem with it:
    [WebMethod(EnableSession=true)]
     public SyncContext GetChanges(SyncGroupMetadata groupMetadata, SyncSession syncSession)
        {
            try
            {
                syncObj = (ISyncObject4)Session["SyncObject"];             // syncObj is remote object
                return syncObj.GetServerChanges(groupMetadata, syncSession);   // GetServerChanges is remote method
            }
            catch (Exception ex)
            {
                throw new Exception("Sync WS Error:"+ex.Message);
            }


           
        }


    I hope that anyone can help me, big thanks!

    Yojana Hanif
    -----------------
    • Moved by Hengzhe Li Friday, April 22, 2011 2:59 AM (From:SyncFx - Microsoft Sync Framework Database Providers [ReadOnly])
    Wednesday, June 10, 2009 9:49 AM

Answers

  • Hi,

    May I know that your WS and client processes are running under what kind of accounts? If your cient account cannot be successfully authorized by the WS service account, I feel that you may see this kind of errors. One easy way to verify my guess is to run both processes under the same account.

    Thanks,
    Dong


    This posting is provided AS IS with no warranties, and confers no rights.
    Wednesday, June 10, 2009 6:15 PM
    Moderator