Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / cdf / src / NetFx35 / System.ServiceModel.Web / System / ServiceModel / WebScriptServiceHost.cs / 1305376 / WebScriptServiceHost.cs
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------
namespace System.ServiceModel
{
using System.IO;
using System.Collections.Generic;
using System.ServiceModel.Description;
using System.Diagnostics.CodeAnalysis;
using System.Configuration;
using System.ServiceModel.Web;
using System.Net;
using System.ServiceModel.Channels;
class WebScriptServiceHost : ServiceHost
{
static readonly string WebScriptEndpointKind = "webScriptEndpoint";
public WebScriptServiceHost(Type serviceType, params Uri[] baseAddresses)
:
base(serviceType, baseAddresses)
{
}
protected override void OnOpening()
{
WebServiceHost.AddAutomaticWebHttpBindingEndpoints(this, this.ImplementedContracts,
SR2.GetString(SR2.JsonWebScriptServiceHostOneServiceContract, this.ImplementedContracts.Count), WebScriptEndpointKind);
foreach (ServiceEndpoint endpoint in this.Description.Endpoints)
{
if (endpoint.Binding != null && endpoint.Binding.CreateBindingElements().Find() != null)
{
if (endpoint.Behaviors.Find() == null)
{
ConfigLoader.LoadDefaultEndpointBehaviors(endpoint);
if (endpoint.Behaviors.Find() == null)
{
endpoint.Behaviors.Add(new WebScriptEnablingBehavior());
}
}
}
}
base.OnOpening();
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- QueryProcessor.cs
- BamlLocalizationDictionary.cs
- Size.cs
- TypedDatasetGenerator.cs
- CharEnumerator.cs
- VBCodeProvider.cs
- SqlXmlStorage.cs
- RSAOAEPKeyExchangeFormatter.cs
- ConfigXmlDocument.cs
- OutputCacheProfileCollection.cs
- TransactedBatchingElement.cs
- WebBrowserDocumentCompletedEventHandler.cs
- LockedAssemblyCache.cs
- WebPartPersonalization.cs
- BooleanAnimationUsingKeyFrames.cs
- DataListCommandEventArgs.cs
- DrawingAttributesDefaultValueFactory.cs
- TextDecorationCollection.cs
- ArgumentDesigner.xaml.cs
- WindowsFormsSectionHandler.cs
- LineServices.cs
- BitmapEffectDrawingContent.cs
- CardSpaceSelector.cs
- CallbackValidator.cs
- infer.cs
- ResourceReferenceExpression.cs
- _ContextAwareResult.cs
- DataGridColumnReorderingEventArgs.cs
- TypeUtil.cs
- SignatureHelper.cs
- CSharpCodeProvider.cs
- KeyValuePairs.cs
- OleDbErrorCollection.cs
- FieldNameLookup.cs
- ExtractorMetadata.cs
- CodeAccessPermission.cs
- WebBrowserUriTypeConverter.cs
- DynamicValidatorEventArgs.cs
- ReferencedType.cs
- XmlAnyElementAttribute.cs
- ContentType.cs
- TemplateGroupCollection.cs
- TransformBlockRequest.cs
- SplineKeyFrames.cs
- ImpersonationContext.cs
- WebPartsPersonalization.cs
- InputLanguageEventArgs.cs
- BuildProvider.cs
- PerformanceCounterPermissionEntryCollection.cs
- DynamicDataRoute.cs
- sapiproxy.cs
- TextEditorParagraphs.cs
- IISMapPath.cs
- ExpressionPrefixAttribute.cs
- DecryptedHeader.cs
- ITextView.cs
- ErrorStyle.cs
- DetailsViewModeEventArgs.cs
- ToolStripProfessionalLowResolutionRenderer.cs
- Padding.cs
- ToolStripDropDownClosingEventArgs.cs
- DiscoveryEndpointElement.cs
- Directory.cs
- EditorAttribute.cs
- CodeGen.cs
- ErrorEventArgs.cs
- InitiatorServiceModelSecurityTokenRequirement.cs
- PerformanceCounter.cs
- EndEvent.cs
- DetailsViewUpdateEventArgs.cs
- PrintingPermission.cs
- AdornerPresentationContext.cs
- AssemblyAttributesGoHere.cs
- ObsoleteAttribute.cs
- DynamicHyperLink.cs
- LineBreakRecord.cs
- DrawingAttributeSerializer.cs
- GridViewColumn.cs
- ShaderRenderModeValidation.cs
- SupportsEventValidationAttribute.cs
- EventDescriptor.cs
- PropertyEmitterBase.cs
- BitVector32.cs
- NextPreviousPagerField.cs
- InstanceOwnerQueryResult.cs
- SoapWriter.cs
- MessageAction.cs
- CngKeyBlobFormat.cs
- BitmapMetadata.cs
- ReliableSessionBindingElementImporter.cs
- LoadedEvent.cs
- X509Certificate.cs
- LassoHelper.cs
- ConstructorNeedsTagAttribute.cs
- PolyQuadraticBezierSegment.cs
- Baml2006ReaderFrame.cs
- TableLayoutPanelCellPosition.cs
- OpCodes.cs
- FileDetails.cs
- TextDocumentView.cs