开发者

Calling web services dynamically from a console application

I am using this example from 开发者_运维问答microsoft to call web services dynamically using reflection:

http://blogs.msdn.com/b/kaevans/archive/2006/04/27/dynamically-invoking-a-web-service.aspx

Which works fine in a web page project, however in a console application the class

ServiceDescriptionImporter

Is unavailable (doesnt come up in intellisense and isnt recognized as part of the assembly it belongs to -- System.Web.Services.Description). Which is wierd b/c it DOES come up in web projects.

Anyone know why this is? I cannot get the console app to work. This is a VS 2010 project.


ServiceDescriptionImporter is in the System.Web.Services assembly. Add a reference to that, and import the namespace with a using System.Web.Services.Description; statement, and it will work.


I also met this problem. when I went to change the target framework, I found the default target is .Net Framework 4 client profile, also there has a .Net Framework 4 exist. I changed the target from .Net Framework 4 client profile to .Net Framework 4, and then it's working, the ServiceDescriptionImporter appeared. hope this helps for others.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜