MSDN > 論壇首頁 > ASMX Web Services and XML Serialization > WSE 3.0 and Visual Studio 2008?
發問發問
 

已答覆WSE 3.0 and Visual Studio 2008?

  • 2007年11月29日 下午 07:38Emmanuel Huna 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    So I downloaded and installed Visual Studio 2008 RTM.  I was able to upgrade all of my projects without problems, except for a client app that uses WSE 3.0.

     

    It refuses to build under Visual Studio 2008 - there were errors related to the web reference objects.  I updated the web references from VS 2008 and now the WSE 3.0 objects are gone.

     

    I googled and searched the MSDN forums, but the only thread I found was this one:

     

      http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2476455&SiteID=1

     

    where someone asks about WSE 3.0 support under VS 2008.  Unfortunately, there's no response.

     

    What should developers that are using WSE 3.0 do if they upgrade to Visual Studio 2008? 

     

    1) Is there a way to have support for the WSE 3.0 configuration tools within the VS 2008 IDE? (right click on project and choose WSE 3.0 settings)

     

    2) If not, is there anyway I could re-read the WSDL and create my WSE objects through a command line prompt if my project was upgraded to Visual Studio 2008?  Can someone point me to documentation and examples?

     

    It cracks me up that Microsoft is comitted to backwards compatibility for MFC, but WSE seems to never work with the latest version of Visual Studio.  I had the same problem when I upgraded to Visual Studio 2005 and was using WSE 2.0.  I had to wait and upgrade to WSE 3.0 to get the tools in the IDE.

解答

  • 2007年12月4日 下午 06:35Sidd Shenoy - MSFT版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆

    Hi Emmanuel,

     

    WSE 3.0 is not supported in VS 2008. This would require a Service Pack to be released for WSE and currently the WSE team has no future Service Packs planned.

     

    The question then stands, what do developers do. I'll answer your questions above and hopefully that might help a bit:

     

    1. Currently no, there is no supported way of doing this. VS 2008 just released and WSE 3.0 released a while back. Is there anything in particular that you use in the configuration tool? Everything that is done through the configuration tool can be done manually by updating your web.config file.

     

    2. Re-reading your WSE used to work with "Add Web Reference" in VS 2005. However, under the covers, what is really happning is that wsdl.exe is being run against the service's wsdl, and the base class changes from SoapHttpProtocol to WebServicesClientProtocol. So that's all you have to do:

       a) Run wsdl.exe against the service's wsdl file

       b) Change the base class that your proxy inherits from, from SoapHttpClientProtocol to

           WebServicesClientProtocol

     

    WSE 3.0 does not have any future releases planned and people should really be thinking about upgrading their stack to WCF. Migration from WSE to WCF isn't all that difficult and there is literature to help with that. You can find out more about WCF at www.netfx3.com.

     

    If there are any specific questions regarding migration that you want to ask, please let me know.

     

    Thanks,

    Sidd [MSFT]

     

所有回覆

  • 2007年11月29日 下午 08:41Emmanuel Huna 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    Ok, I found a fairly easy workaround to have the web references with WSE 3.0 updated and working in VS 2008:

     

    1) Create a new project in VS 2005. Name it exactly the same as the VS 2008 project

      a. In my case: “MYPROJECT”.

     

    2) Add a web reference to the web service with WSE 3.0 support.

      a. In my case: https://www.MYURL.com/MYSERVICE/MYASMX.asmx

     

    3) Right click on the project and choose > WSE 3.0 Settings > Enable this project for Web Services Enhancements.

     

    4) Update your web reference – this will create the WSE 3.0 classes and objects

      a. In my case: MYSERVICE.MYASMXWse

     

    5) Copy all of the files from the VS 2005 project to the VS 2008 project:

      a. In my case:

        i. From: C:\Projects\Misc\Projects\Vs2005Client\MYCLIENT\Web References\MYSERVICE

        ii. To: C:\Projects\MYCLIENT\main\Web References\MYSERVICE

     

    6) Exclude all previous files in the VS 2008 project and include the new ones.

      a. In my case: in the new VS 2008 project, refresh and include all files in MYCLIENT > Web References > MYSERVICE

     

    7) If you get an error on the default URL coming from “My Settings”, update it.

      a. In my case: Me.Url = My.Settings.MYCLIENT_MYSERVICE_MYASMX

     

    Hope this helps someone else, but if anyone from Microsoft reads this my question still stands: can we get WSE 3.0 support in VS 2008?

  • 2007年12月3日 下午 10:16ahsteele2 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    While this solution is definietly workable it is far from ideal.  I will be putting a watch on this thread to see if anyone from Microsoft replies to you.  Thank you for posting your workaround I will be utilizing it.
  • 2007年12月4日 上午 07:29Andreas Hammar 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Couldn't agree more, I guess that they want us to be using WCF - but you can't do all transitions at the same time!

    Our workaround is doing a postbuild-replace of the class/constructor in the proxy project (we have a separate project just for the proxy):


    With regex, in reference.cs:

    "class.*Service .*\{"         to       class ServiceWse : Microsoft.Web.Services3.WebServicesClientProtocol {

    and

    "public Service\(.*\{"          to       public ServiceWse() {


    This will yield no non-wse proxy, just a wse one, but we don't need the non-wse.


    Looking forward to integrated tools!



  • 2007年12月4日 下午 06:35Sidd Shenoy - MSFT版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     已答覆

    Hi Emmanuel,

     

    WSE 3.0 is not supported in VS 2008. This would require a Service Pack to be released for WSE and currently the WSE team has no future Service Packs planned.

     

    The question then stands, what do developers do. I'll answer your questions above and hopefully that might help a bit:

     

    1. Currently no, there is no supported way of doing this. VS 2008 just released and WSE 3.0 released a while back. Is there anything in particular that you use in the configuration tool? Everything that is done through the configuration tool can be done manually by updating your web.config file.

     

    2. Re-reading your WSE used to work with "Add Web Reference" in VS 2005. However, under the covers, what is really happning is that wsdl.exe is being run against the service's wsdl, and the base class changes from SoapHttpProtocol to WebServicesClientProtocol. So that's all you have to do:

       a) Run wsdl.exe against the service's wsdl file

       b) Change the base class that your proxy inherits from, from SoapHttpClientProtocol to

           WebServicesClientProtocol

     

    WSE 3.0 does not have any future releases planned and people should really be thinking about upgrading their stack to WCF. Migration from WSE to WCF isn't all that difficult and there is literature to help with that. You can find out more about WCF at www.netfx3.com.

     

    If there are any specific questions regarding migration that you want to ask, please let me know.

     

    Thanks,

    Sidd [MSFT]

     

  • 2008年1月4日 下午 10:20BrandonW 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    That is somewhat disheartening. I have tried to adopt WCF right off the bat on a new project, but after spending hours and hours knocking my head against the wall, I have decided to go back to the simple and easy to set up ASP.NET web services.

    It's nice that there is an easy conversion route from ASP.NET web services to WCF services, except that no matter what conversion path you decide on, if you include credentials in the requests, you need to include certificates in the workflow to secure the sensitive data... and if you use certificates, then you are doomed to fail.

    I have searched high and low through hundreds of blog postsings and forums, and it appears that either Microsoft doesn't want you to use certificates, or wants you to become brain dead before you use them. It seems all but impossible to create a test certificate that works for development. Since this was not feasible in a reasonable amount of time (I could have lived with weeks, but not even that was enough), I must try another path because the WCF path was going nowhere very fast.

    If I read your post correctly, it seems that one can still use WSE with VS 2008, as long as it is all done through the command line. Is this correct? If it isn't even usable that way then I'm going to have to decide on another technology stack because ASP.NET / WCF just doesn't seem very usable at the moment.
  • 2008年1月23日 上午 11:24Mattaniah 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    Unfortunately I am forced to use vs 2005 for web part projects on SharePoint.  I like the one click to deploy web part.  Hopefully MS will give us some way in the near future.

     

     

  • 2008年1月24日 下午 10:54Bidware.com 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

     



    I figured out exactly how to use WSE 3.0 with VS2008. You must use the old .cs or .vb files with your proxy or web reference files (They are in the same directory as your .wsdl files.) So, once VS 2008 finishes converting your VS 2005 to VS 2008, it will overwrite your existing reference.cs file (in my case) with the wrong base class (SoapHttpClientProtocol instead of WebServicesClientProtocol.) So, you can either manually modify your reference.cs files to use WebServicesClientProtocol, or simply copy your old .cs files from your working VS2005 project directory. It should compile and run after that. Contact me at chris@bidware.com should you have any questions.
  • 2008年1月24日 下午 11:18BrandonW 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I've gotten it to work with VS2008 alone too. You must use the GUI tool that is installed with WSE 3.0 to configure the app.config or web.config of the project (you can find a good amount of documentation on that on the net). Then you must go into a service reference's auto generated code (remember to make a old web reference, not a new service reference), and change the main web service client class so that it derives from The Protocol class in the Microsoft.Web.Services3 namespace (I forget the exact name). Once you do this, you will get access to all of the inherited properties, and it works fine.
  • 2008年1月24日 下午 11:27Bidware.com 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    Actually, you never need to use any GUI at all.  It's just a matter of using the old references to WSE.  It's that simple.

  • 2008年1月24日 下午 11:57BrandonW 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Sorry. I forgot to mention that my post was from the stand point of a person who isn't using VS 2005 at all (as in not even upgrading the original references).
  • 2008年2月12日 下午 12:25AlienationZombie 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

     BrandonW wrote:
    I've gotten it to work with VS2008 alone too. You must use the GUI tool that is installed with WSE 3.0 to configure the app.config or web.config of the project (you can find a good amount of documentation on that on the net). Then you must go into a service reference's auto generated code (remember to make a old web reference, not a new service reference), and change the main web service client class so that it derives from The Protocol class in the Microsoft.Web.Services3 namespace (I forget the exact name). Once you do this, you will get access to all of the inherited properties, and it works fine.

     

    Thanx for the suggestion!

    It works great!

    It saved me the time of trying to figure this out.

  • 2008年2月25日 下午 02:08Silvero van Henningen 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    Thnx,

    Finally my client-app (VS2008) works with MTOM (WSE 3.0).

     

    I only had to replace (in Reference.cs)

    public partial class wsMTOM : System.Web.Services.Protocols.SoapHttpClientProtocol

    in

    public partial class wsMTOM : Microsoft.Web.Services3.WebServicesClientProtocol

     

  • 2008年5月2日 上午 08:51PK_Sean 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     

    There is a very simple solution if you can change the Target Framework of your application to 3.0 or 3.5:

     

    You simply need to delete the "Web Reference" from your application and then re-add the web service as a "Service Reference".  This should automatically configure your client to use the WSE settings.  The only other change you will need to make to your code is the proxy reference which will need to instantiate as <webservice name>Client instead of <webservice name>

     

    If you must remain at Framework 2.0, then the above solutions must be considered.

     

  • 2008年8月21日 下午 03:44redluv 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Dear Microsoft,

    I have been contracted to develop a small web application that interfaces with a Java-based web service written by IBM.  Of course I am using ASP.NET.  The client would prefer .NET 3.0.  My problem is that the web service I am consuming uses DIME attachments.  Therefore I must use WSE2 which is not supported with VS2008.  I understand DIME is outdated, obsolete, whatever.  But why not keep support for old time's sake?  Now I must revert to VS2005 for development.  Very disappointing.

    -Redluv
  • 2008年8月21日 下午 04:51John SaundersMVP, 版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Did you consider using WCF?
    John Saunders | Use File->New Project to create Web Service Projects
  • 2008年8月29日 下午 01:18bijay 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    We are currently running both version  WSE 3.0 and WCF with VS 2005 due to diverse clients needs. Not all are ready with WCF. We are upgrading to VS 2008 and have the same problem.

    Is there way to customize that WSE Proxy creation ? Or any other ideas other than replacing the inherit class manually.
    • 已編輯bijay 2008年8月29日 下午 01:19typo
    •  
  • 2008年8月29日 下午 04:14bijay 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    Can you please  tell me how you are doing this as post-build action ?
  • 2008年10月3日 下午 08:21Jason Young _iMeta_ 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     提議的解答
    Check out http://blogs.imeta.co.uk/jyoung/archive/2008/08/29/345.aspx for a solution to using WSE 3 in VS 2008
  • 2008年10月28日 下午 02:18Zoodor 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     提議的解答
    One solution that doesn't seem to be mentioned so far is that if you have a separate project for your proxy classes (which we happen to do at my company) and you have both VS2005 and 2008 installed, then you can simply open this project in 2005 and update the web reference in there - no need to have separate projects, as VS2005 and 2008 can share project files. The project can then be built in 2008 and everything should work as before.

    Hope this helps someone.
  • 2009年10月27日 下午 01:29Neal Walters 使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    I need to call a third-party vendor web service that uses .asmx and WS-Security.  Can I write a WCF client on my side to do that?  In other words, is a WCF client "plug-compatible" with the various WS standards and .asmx?  Even more specifically, I want to use a BizTalk Adapter for BizTalk 2009.  WSE adapters were available for BT2006/R2 but haven't found anything for 2009 yet.  I'm wondering if I should try the WCF adapters, or if that is a waste of time.

    Thanks,
    Neal Walters
  • 2009年10月27日 下午 06:05Dan Glick - MSFT版主使用者勳章使用者勳章使用者勳章使用者勳章使用者勳章
     
    This page describes how to access a WSE service with a WCF client: http://msdn.microsoft.com/en-us/library/ms730299(VS.85).aspx. If you need more details, a quick search on MSDN turned up a number of other articles that seem relevant.

    BizTalk 2009 also has WCF adapters: http://msdn.microsoft.com/en-us/library/bb259952(BTS.10).aspx

    HTH,
    Dan