WCF Ria Call Method And Not Found

345 views Asked by At

I am using WCF RIA with silverlight 5 and I use LinqToSqlDomainService.

I have one class Like this

[EnableClientAccess()]
public class UsersAndGroups : LinqToSqlDomainService<DataBaseDataContext> {
    protected override DataBaseDataContext CreateDataContext() {
        return DataBaseConnection.GetNewDataBaseContext();
    }

    public tblUsersAndGroup Web_CanLogin(string userName, string password) {
        ...
    }

    //Will call without error
    [Invoke]
    public List<spSelectVwUsersAndGroupsResult> Web_SelectView(
                                                 BLL.tblUsersAndGroup logedInUser) 
    {
        ...
    }
}

When I call methods in this class every things is ok.

I have another class:

[EnableClientAccess()]
public class Privileges : MyLinqToSqlDomainService<DataBaseDataContext> {
    protected override DataBaseDataContext CreateDataContext() {
        return DataBaseConnection.GetNewDataBaseContext();
    }

    //Will not call and get error!
    [Invoke]
    public List<spSelectVwUsersAndGroupsResult> Web_SelectView(
                                                 BLL.tblUsersAndGroup logedInUser) 
    {
        ...
    }

    //Will call without error!
    [Invoke]
    public List<spSelectVwUsersAndGroupsResult> Web_SelectViewWithNoParam() {
        ...
    }
}

When I Create method exactly like Web_SelectView in previous calss, when I call it I get "The remote server returned an error: NotFound." error.

When I remove parameter it work, and no error will show to me and method will call.

I see this link about this error:

http://blogs.objectsharp.com/post/2010/04/13/WCF-RIA-Services-%E2%80%9CNot-Found%E2%80%9D-Error-Message.aspx

I see in network tab of my browser in developer tools, I see when call this method it will call but return not found, and result is 500.

Also I put these code in my web config but I didn't see any meaningful error in event log

<system.diagnostics>
    <sources>
        <source name="System.ServiceModel" 
                switchValue="Information, ActivityTracing" 
                propagateActivity="true" >
        <listeners>
            <add name="xml"/>
        </listeners>
    </source>
    <source name="System.ServiceModel.MessageLogging">
        <listeners>
            <add name="xml"/>
        </listeners>
    </source>
    <source name="myUserTraceSource" 
            switchValue="Information, ActivityTracing">
        <listeners>
            <add name="xml"/>
        </listeners>
    </source>
    </sources>
    <sharedListeners>
        <add name="xml" 
             type="System.Diagnostics.XmlWriterTraceListener" 
             initializeData="C:\logs\Traces.svclog" />
    </sharedListeners>
</system.diagnostics>

<system.serviceModel>
    <diagnostics wmiProviderEnabled="true">
        <messageLogging logEntireMessage="true" 
                        logMalformedMessages="true" 
                        logMessagesAtServiceLevel="true" 
                        logMessagesAtTransportLevel="true" 
                        maxMessagesToLog="3000" />
    </diagnostics>
</system.serviceModel>

UPDATE:

I edit my web config switchValue="Information, ActivityTracing" to switchValue="All" and now I can see error:

WebHost failed to process a request. Sender Information: System.ServiceModel.ServiceHostingEnvironment+HostingManager/12036987 Exception: System.ServiceModel.ServiceActivationException: The service '/Services/BLL-Privileges.svc' cannot be activated due to an exception during compilation. The exception message is: Operation named 'Web_GetPrivileges' does not conform to the required signature. Parameter types must be an entity or complex type, a collection of entities or complex types, or one of the predefined serializable types.. ---> System.InvalidOperationException: Operation named 'Web_GetPrivileges' does not conform to the required signature. Parameter types must be an entity or complex type, a collection of entities or complex types, or one of the predefined serializable types.

But why "Operation named 'Web_GetPrivileges' does not conform to the required signature." when it work in previous class!!!

Second Edit:

When I remove [Invoke] attribute, no error event will register... but again I get Not Found! also when I see in browser developer tools no code will back to me, no 200, no 500, or any other....

Thanks

0

There are 0 answers