Video Screencast Help
Symantec to Separate Into Two Focused, Industry-Leading Technology Companies. Learn more.

Create New Resource Web Service

Created: 06 Jun 2013 • Updated: 31 Jul 2013 | 8 comments
This issue has been solved. See solution.

Anyone have success using the CreateNewResource command from the ResourceModelService.  I'm able to use the GetResource, DeleteResource and SaveResource.  It is only CreateNewResource that fails.  I've setup a simple ASP.Net web app that uses the web service to create a new Asset Resource type, but I keep getting an error stating SRV does not have access to redirection.config.  I found a article stating the App pool needs access to the file.  Adding full control did not help.

            AltirisWebService.ResourceModelService rms = new AltirisWebService.ResourceModelService();
           
            System.Net.NetworkCredential cred = new System.Net.NetworkCredential();
            cred.Domain = "DOMAIN";
            cred.UserName = "USERNAME"
            String pswd = "PSWD";
            System.Security.SecureString SecureString = new System.Security.SecureString();
            foreach (char x in pswd)
            {
                SecureString.AppendChar(x);
            }
            cred.Password = pswd; //SecureString;
            rms.Credentials = cred;
            AltirisWebService.ResourceDataInfo rdi = new AltirisWebService.ResourceDataInfo();
            rdi.Name = "SouftwawrPurch12313";
            rdi.ResourceTypeGUID = new Guid("b9ee0ab2-ae0e-4867-bf4c-41d4a382163b");
            //rms.DeleteResource(new Guid("47703632-5fe9-48b1-8d7c-9246eef95b02"));
            rms.CreateNewResource(new Guid("b9ee0ab2-ae0e-4867-bf4c-41d4a382163b"), rdi);

 

Operating Systems:

Comments 8 CommentsJump to latest comment

EathenR's picture

I'm able to get this working after changing the application pool's identity from ApplicationPoolIdentity to LocalSystem.  Is that a good solution?

Prasanna Deshmukh's picture

Hi EathenR,

I have tried to create an application as mentioned by you. We gave the reference of ResourceModelService. but could not find AltirisWebService.

Could you tell us that whether the AltirisWebService is an external service created by you or it is provided by Altiris?

Thanks,

Prasanna

EathenR's picture

In C# I added a Web Service Reference which pointed to the WDSL URL.  I called the web service reference AltirisWebService.  If I recall correctly it is call a service reference for a C# console application.

If needed, I can provide more detail.

Prasanna Deshmukh's picture

Hi Eathen,

Could you please provide me the URL of the service which you referred? Please let us know about this in details.

Thanks,

Prasanna

 

 

EathenR's picture

Substitute your server name for localhost.

http://localhost/Altiris/nswebservice/resourcemodel.asmx?WSDL

Within Visual Studio click Project -> Add Service Reference.

Put the URL above in the Address line and click go.

Enter a Namespace.  I called mine AltirisWebService

Visual studio will discover and create a list of methods.

Prasanna Deshmukh's picture

 I have checked and found that Application Pool identities uses the machine account to access network resources and in case of Localsystem ,if the user is administrator then it will work. normally it's better to use identity as ApplicationPoolIdentity but as per the details provided by you it works with LocalSystem.

EathenR's picture

I too would like it to use the ApplicationPoolIdentity which is the default.  I switched to the LocalSystem and got it to work.

I did a complete removal of Symantec and IIS.  Once it was reinstalled it worked with the ApplicationPoolIdentity.

SOLUTION