Database Reference
In-Depth Information
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service name="OECDSvc">
<endpoint address="http://localhost:5555/OECD,svc"
behaviorConfiguration="OECDSvc.OECD"
binding="webHttpBinding" contract="OECDSvc.OECD" />
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
The default example has used port 5555. Note that you need to replace
http://localhost:5555/ with the website you're using on your machine if
you changed this—this is located in the endpoint tag eight lines from the end.
Go ahead and create a new empty website in Internet Information Services
(IIS) now if you don't have one (this was covered in “Installing the HTML5
Samples” earlier in the chapter, and if you followed that section you should
have a website setup—you should use that one.)
The final piece of the basic website setup is changing the service markup. Go
to OECD.svc , right-click, choose View Markup, and then replace the content
with the following code:
<%@ ServiceHost Language="C#" Debug="true" Service="OECDWebSvc.OECD"
CodeBehind="OECD.svc.cs" Factory="System.ServiceModel.
Activation.WebServiceHostFactory"%>
This can be seen in Figure 9-9.
Next, you need to return some data. In this example, the data is hardcoded.
In the download samples for the chapter (available at www.wiley.com/go/
visualintelligence ), it is pulled from a database. This data needs to be
returned in JSON, based on the format that InfoVis requires.
Json To C# To Json
You may be wondering why you are going through this process. You need
to deliver JSON (which will be dynamically generated) in a very particular
structure to our visualization, and you will be using C# to generate that
JSON. While you could code this yourself, instead you are going to use a
converter tool that looks at a sample of the correctly structured JSON and
outputs an appropriate C# class.
Search WWH ::




Custom Search