none
PSI Create resource failed when the pwa is configured Multi-Authentication RRS feed

  • Question

  • Hi , All

    I configured my pwa site Multi-Authentication. But now there is a problem that I can't create resource(windows user) by PSI and the following is error code:

    The server was unable to process the request due to an internal error.

    For more information about the error, either turn on

    IncludeExceptionDetailInFaults (either from ServiceBehaviorAttribute or from the

    <servicedebug></servicedebug>configuration behavior) on the server in order to send the

    exception information back to the client, or turn on tracing as per the

    Microsoft .NET Framework 3.0 SDK documentation and inspect the server trace

    logs.

     

    This is my code:

         [WebMethod]
            public Guid AddResource(string Name)
            {
                try
                {
                    resourceSvc.Url = PROJECT_SERVER_URI + RESOURCE_SERVICE_PATH;
                    resourceSvc.Credentials = CredentialCache.DefaultCredentials;
                    ResourceSvc.ResourceDataSet.ResourcesRow resourceRow = resourceDs.Resources.NewResourcesRow();
                    Guid NewResGuid = Guid.NewGuid();
                    resourceRow.RES_UID = NewResGuid;
                    resourceRow.RES_NAME = Name;
                    resourceDs.Resources.AddResourcesRow(resourceRow);
                    resourceSvc.CreateResources(resourceDs, false, true);          --> Error
                    //AddAuthorization(NewResGuid, Name,true);
                    return NewResGuid;
                }
                catch (Exception ex)
                {
                    return Guid.Empty;
                }
            }

    The code works well when it runs under windows authentication.

    How can I do it, please give me some suggestions.

    thanks.

    Friday, August 21, 2015 8:42 AM

Answers

  • Hi,

    Wow you're stretching the memory here, haven't seen this issue in a long while. Reason: use CSOM when you can, then you won't have to worry about this kind of WCF / Claims related problem.

    So my guess is that the issue is you are not using the correct WCF endpoint binding / routing for your PSI calls, this is because you have changed your web app auth from 'native windows auth' to 'saml windows auth' and unfortunately there is a huge difference internally.

    I'd suggest the following MSDN article that from memory helped me solve this many years ago:

    Walkthrough: Developing PSI Applications Using WCF

    That covers in detail the changes required, however if you want a working example then I would suggest that you have a look at the Project Server 2013 SDK and specifically the ProjTool solution which has a very handy "wcfHelper.cs" class that I have borrowed from extensively in the past.

    HTH,


    Martin Laukkanen
    Nearbaseline blog - nearbaseline.com/blog
    Bulk Edit and other Apps - nearbaseline.com/apps


    • Edited by Martin Laukkanen Wednesday, August 26, 2015 9:47 AM fixed url
    • Marked as answer by Zhang Klein Friday, August 28, 2015 3:38 AM
    Wednesday, August 26, 2015 9:46 AM

All replies

  • Hi,

    Wow you're stretching the memory here, haven't seen this issue in a long while. Reason: use CSOM when you can, then you won't have to worry about this kind of WCF / Claims related problem.

    So my guess is that the issue is you are not using the correct WCF endpoint binding / routing for your PSI calls, this is because you have changed your web app auth from 'native windows auth' to 'saml windows auth' and unfortunately there is a huge difference internally.

    I'd suggest the following MSDN article that from memory helped me solve this many years ago:

    Walkthrough: Developing PSI Applications Using WCF

    That covers in detail the changes required, however if you want a working example then I would suggest that you have a look at the Project Server 2013 SDK and specifically the ProjTool solution which has a very handy "wcfHelper.cs" class that I have borrowed from extensively in the past.

    HTH,


    Martin Laukkanen
    Nearbaseline blog - nearbaseline.com/blog
    Bulk Edit and other Apps - nearbaseline.com/apps


    • Edited by Martin Laukkanen Wednesday, August 26, 2015 9:47 AM fixed url
    • Marked as answer by Zhang Klein Friday, August 28, 2015 3:38 AM
    Wednesday, August 26, 2015 9:46 AM
  • Hi, Martin

    That's really very nice of you. It bored me for a few days. Many thanks.


    • Edited by Zhang Klein Friday, August 28, 2015 3:44 AM
    Friday, August 28, 2015 3:44 AM