Project and Portfolio Management Practitioners Forum
cancel
Showing results for 
Search instead for 
Did you mean: 

Web service usage help

Highlighted
eata
Regular Collector

Web service usage help

Hello;

I am tring to call web service. I downloaded toolkit from

http://10.100.44.29:8080/

itg/download/webservice/webservice_toolkit.zip

I imported web service

http://10.100.44.29:8080/itg/ppmservices/DemandService?wsdl as webservice1

 

On the line :

serviceProxy.SetPolicy(policy);

I get following error:

Error 44 'DemandServiceTest.WebReference1.DemandService' does not contain a definition for 'SetPolicy' and no extension method 'SetPolicy' accepting a first argument of type 'DemandServiceTest.WebReference1.DemandService' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\6748ofce\Desktop\DemandServiceTest\Program.cs 30 26 DemandServiceTest

 

Do you have any idea how can the error is solved?

 

The toolkit is developed on Visual Studio 2005, I am using Visual Studio 2010. I converted the project. Is the definiation on 2010 different than 2005. Can it be related with this??

 

using

System;

using

System.Collections.Generic;

using

System.Text;

using

DemandServiceTest.WebReference1;//DemandServiceTest.localhostDemandService;

using

Microsoft.Web.Services3;

using

Microsoft.Web.Services3.Design;

using

Microsoft.Web.Services3.Security;

using

Microsoft.Web.Services3.Security.Tokens;

namespace

DemandServiceTest

{

classProgram

{

staticDemandServiceserviceProxy;

 

staticvoid Main(string[] args)

{

Console.WriteLine("PPM Webservices test with a Microsoft .NET (C#) consumer.");

 

Console.Write("\nCreating service proxy...");

 

// create service proxy

serviceProxy =

newDemandService();

 

UsernameOverTransportAssertion policyAssertion = newUsernameOverTransportAssertion();

 

Console.WriteLine("done");

 

Console.Write("\nSetting authentication policies...");

 

// setup WS-Security credentials

policyAssertion.UsernameTokenProvider =

newUsernameTokenProvider("admin", "admin");

 

Policy policy = newPolicy(policyAssertion);

serviceProxy.SetPolicy(policy);

Console.WriteLine("done");

 

//TestDemandService();Console.WriteLine("\nTests completed. Press any key to exit.");

 

Console.ReadKey();

 

}

4 REPLIES
Utkarsh_Mishra
Honored Contributor

Re: Web service usage help

Hi Eata,

 

This issue is due to a visual studio version issue, 2008 or 2010 is NOT compatible with this example.

 

Cheers...

Utkarsh

Cheers..
Utkarsh Mishra

-- Remember to give Kudos to answers! (click the KUDOS star)
Islam Nofal
Regular Collector

Re: Web service usage help

Hi,

 

I have tried it on VS 2005 but I'm having the same error of cannot find setpolicy, any one have any updates.

 

PPM version is 9.13

eata
Regular Collector

Re: Web service usage help

Hi Islam;

it is workin in VS 2005 only.

You download the web service zip file

Open the project with VS 2005.

than change config, usernama and password only (do not reference web service)

Than it worked

Regards

sriniko
Acclaimed Contributor

Re: Web service usage help


eata wrote:

Hi Islam;

it is workin in VS 2005 only.

You download the web service zip file

Open the project with VS 2005.

than change config, usernama and password only (do not reference web service)

Than it worked

Regards



You may want to follow this link to get a resolution

http://digantakumar.com/2010/06/04/wse-3-in-visual-studio-2008-and-2010/

 

That's how i got my VS 2010 to work with WSE

 

Regards

SK

//Add this to "OnDomLoad" event