简体   繁体   English

创建WCF并将其托管在IIS上

[英]creating WCF and hosting it on IIS

i have seen alot of questions and tutorials about this subject but none of them seem to fully answer my questions. 我已经看到了很多有关此主题的问题和教程,但似乎都没有一个完全回答我的问题。 Im am doing a 3 layers project. 我正在做一个3层项目。 I have service library called ServiceHandlers which gets data from microsoft ax 2012 and putts the right entity on it. 我有一个称为ServiceHandlers的服务库,该库从microsoft ax 2012获取数据并在其上放置正确的实体。 Then i have a wcf service called Services which calls these get functions from the serviceHandlers (has a reference to that project) .. and then in the end of there is the client side which can be winform,console or whatever. 然后,我有一个名为Services的wcf服务,该服务从serviceHandlers调用这些get函数(具有对该项目的引用)..然后最后是客户端,可以是winform,console或其他任何客户端。 My questions is that my boss wants me to put the services on up on a localserver with HTTPS communication. 我的问题是老板希望我通过HTTPS通信将服务安装在本地服务器上。 Now this would be easy if i only had the service and client part. 现在,如果我只有服务和客户端部分,这将很容易。 I would just folllows this tutorial http://debugmode.net/2010/09/07/walkthrough-on-creating-wcf-4-0-service-and-hosting-in-iis-7-5/ ) .. but since i have the serviceHandler part also everything seems a mess. 我只是遵循本教程http://debugmode.net/2010/09/07/walkthrough-on-creating-wcf-4-0-service-and-hosting-in-iis-7-5/ )..由于我有serviceHandler部分,所以一切似乎一团糟。 What should i do ?? 我该怎么办 ?? MY boss is on a vacation and i have no one to ask so i now little as nothing 我的老板正在休假,我没有人要问,所以我现在什么都没有

If you need standalone WCF service you can follow this tutorial: How to: Host a WCF service in IIS . 如果您需要独立的WCF服务,则可以遵循本教程: 如何:在IIS中托管WCF服务 Actually you need to create 其实你需要创建

  • /App_code folder with real C# code file (just like this copy/paste cs file there) /App_code文件夹包含真实的C#代码文件(就像此复制/粘贴其中的CS文件一样)
  • /bin folder with all your .DLL files. /bin文件夹以及所有.DLL文件。 You need an already working program with all dependencies resolved (don't forget to include: System.ServiceModel). 您需要一个已解决所有依赖关系的已经工作的程序(不要忘记包括:System.ServiceModel)。 The project itslef you can build from WCF Service Library template from VS and just reference your other projects/libs/resources ( don't forget to copy them with your project .dll file ) 您可以从VS的WCF服务库模板中构建项目,然后引用其他项目/库/资源( 不要忘记将它们与项目.dll文件一起复制
  • In main 'VirtualFolder' (that already converted to Application in IIS) put the .svc file and web.config file. 在主“ VirtualFolder”(已转换为IIS中的应用程序)中,放入.svc文件和web.config文件。 SVC file build as follows: SVC文件构建如下:

    <@ServiceHost language="C#" Debug="true" Service="full-name-including-namespace-to-class-that-implements-interface" @> <@ServiceHost语言=“ C#” Debug =“ true” Service =“全名,包括名称空间,到类的那个实现接口” @>

    Hopefully this will work from the begining. 希望这将从一开始就起作用。 There's zillions a possible combination of what could go wrong, strange errors and just-dead situations - I just could not explain about all of them In case you run into another problem you could search this site for solution 可能出现错误的原因,异常的错误和死胡同的可能性不计其数-我只是无法解释所有这些信息,如果您遇到其他问题,可以在本网站上搜索解决方案

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM