Where to locate non-ArcGIS Rest Service for WAB widget to access

755
7
Jump to solution
03-02-2017 08:26 AM
WilliamMiller4
Occasional Contributor II

Hello,

I have developed a WCF rest service for a Web AppBuilder widget to use. I developed it in Visual Studio 2010 on my PC using VB.NET. I tested it with Visual Studio's WCF Test Client. I also tested it by right-clicking the service in Solution Explorer and selecting 'View in Browser', then adding the service function name and parameters to the end of the URL that opens in the browser. (example: http://localhost:port#/ServiceName.svc/ServiceFunction?parameter1=parameter1&parameter2=parameter2)

Now I need to add it to our Server. How do I go about this? Do I copy the solution and paste it to the server's C:\inetpub\wwwroot\myWAB folder? Do I need to save the project in a different format in Visual Studio first? Do I need to register it with ArcGIS (Server Manager, Portal, Map, etc.)?

For some additional context, here is a link to a thread I used to start the rest service: How to query a non-ArcGIS database from WAB? (This thread is sort of a continuation of that one.)

Thank you for any assistance you can provide.

William

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Esteemed Contributor

William,

  Here is Google result for "how to deploy wcf rest service on iis" that should help with the basics of deploying to IIS.

https://social.technet.microsoft.com/wiki/contents/articles/1265.hosting-a-wcf-rest-service-on-iis.a... 

View solution in original post

7 Replies
RobertScheitlin__GISP
MVP Esteemed Contributor

William,

  Here is Google result for "how to deploy wcf rest service on iis" that should help with the basics of deploying to IIS.

https://social.technet.microsoft.com/wiki/contents/articles/1265.hosting-a-wcf-rest-service-on-iis.a... 

View solution in original post

WilliamMiller4
Occasional Contributor II

Hi Robert,

For some reason, my Global.asax.vb says ServiceRoute is undefined in the following function.

Imports System.Web.SessionState
Imports System.Web.Routing
Imports System.ServiceModel.Activation

Public Class Global_asax
    Inherits System.Web.HttpApplication

    Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
        ' Fires when the application is started
        RouteTable.Routes.Add(New ServiceRoute("", New WebServiceHostFactory(), GetType(Service1)))
    End Sub
...
End Class

Any ideas?

William

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

William,

  Did you build the solution before you attempted to publish it?

0 Kudos
WilliamMiller4
Occasional Contributor II

Hi Robert,

This is an error I get in Visual Studio 2010. Type 'ServiceRoute' is not defined.

William

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

William,

Add the System.ServiceModel.Activation namespace to your project's references.

Also I am a little concerned with your service route not having a name:

RouteTable.Routes.Add(New ServiceRoute("", ....

WilliamMiller4
Occasional Contributor II

Hi Robert,

I published the WCF rest service to my local machine this morning. Why is leaving the route prefix empty a problem?

Thank you for all your help.

William

0 Kudos
RobertScheitlin__GISP
MVP Esteemed Contributor

I guess it does not matter for a simple REST service. I have several routes in mine so that is why it is important in my RESTful service.

0 Kudos