Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / Extensions / Script / Services / ProxyGenerator.cs / 1305376 / ProxyGenerator.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Script.Services { using System; using System.Globalization; using System.ServiceModel; using System.ServiceModel.Description; using System.Web.Resources; public static class ProxyGenerator { public static string GetClientProxyScript(Type type, string path, bool debug) { return GetClientProxyScript(type, path, debug, null); } public static string GetClientProxyScript(Type type, string path, bool debug, ServiceEndpoint serviceEndpoint) { if (type == null) { throw new ArgumentNullException("type"); } if (path == null) { throw new ArgumentNullException("path"); } WebServiceData webServiceData = null; ClientProxyGenerator proxyGenerator = null; if (IsWebServiceType(type)) { proxyGenerator = new WebServiceClientProxyGenerator(path, debug); webServiceData = new WebServiceData(type, false); } else if (IsPageType(type)) { proxyGenerator = new PageClientProxyGenerator(path, debug); webServiceData = new WebServiceData(type, true); } else if(IsWCFServiceType(type)){ return WCFServiceClientProxyGenerator.GetClientProxyScript(type, path, debug, serviceEndpoint); } else { throw new ArgumentException(String.Format(CultureInfo.CurrentCulture, AtlasWeb.ProxyGenerator_UnsupportedType, type.FullName)); } return proxyGenerator.GetClientProxyScript(webServiceData); } private static bool IsPageType(Type type) { return typeof(System.Web.UI.Page).IsAssignableFrom(type); } private static bool IsWCFServiceType(Type type) { object[] attribs = type.GetCustomAttributes(typeof(ServiceContractAttribute), true); return (attribs.Length != 0); } private static bool IsWebServiceType(Type type) { object[] attribs = type.GetCustomAttributes(typeof(ScriptServiceAttribute), true); return (attribs.Length != 0); } } } // 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
- DataGridCaption.cs
- DataGridTextBox.cs
- Module.cs
- AtlasWeb.Designer.cs
- RadioButtonList.cs
- TdsParserSessionPool.cs
- BaseDataBoundControl.cs
- AssociationSetEnd.cs
- ParentUndoUnit.cs
- BaseParagraph.cs
- ValidatedControlConverter.cs
- DebugView.cs
- Vector3DIndependentAnimationStorage.cs
- TextBlockAutomationPeer.cs
- TextParentUndoUnit.cs
- RulePatternOps.cs
- DiagnosticsConfiguration.cs
- SeverityFilter.cs
- Blend.cs
- EventMappingSettingsCollection.cs
- ProcessManager.cs
- xmlglyphRunInfo.cs
- TableLayoutPanelResizeGlyph.cs
- NetworkCredential.cs
- ItemsPanelTemplate.cs
- WhitespaceRule.cs
- WindowsEditBoxRange.cs
- TextElementEnumerator.cs
- FaultDescription.cs
- ClientUtils.cs
- IPPacketInformation.cs
- ClientSettings.cs
- WindowsGraphics2.cs
- TypeToArgumentTypeConverter.cs
- BitStream.cs
- XmlSchemaInclude.cs
- VersionedStream.cs
- FileAuthorizationModule.cs
- ServiceOperationListItem.cs
- Executor.cs
- ModelPropertyDescriptor.cs
- OLEDB_Util.cs
- PrintDialog.cs
- CustomTypeDescriptor.cs
- CodeGotoStatement.cs
- FreezableCollection.cs
- ValuePattern.cs
- GenericRootAutomationPeer.cs
- SystemInfo.cs
- VScrollBar.cs
- StreamingContext.cs
- ReverseInheritProperty.cs
- DataGridAddNewRow.cs
- Int32Collection.cs
- IImplicitResourceProvider.cs
- Lease.cs
- ThreadExceptionEvent.cs
- TabPage.cs
- DecimalConverter.cs
- BamlLocalizableResource.cs
- QueryCursorEventArgs.cs
- MenuItemBinding.cs
- cache.cs
- StrokeFIndices.cs
- IsolatedStoragePermission.cs
- DataGridItemAttachedStorage.cs
- StrongNameUtility.cs
- BitArray.cs
- HtmlControlPersistable.cs
- UserPreferenceChangedEventArgs.cs
- AssemblyBuilder.cs
- SettingsPropertyNotFoundException.cs
- Trace.cs
- IdentitySection.cs
- FrameSecurityDescriptor.cs
- NetTcpBindingCollectionElement.cs
- HttpModuleActionCollection.cs
- DependencyPropertyChangedEventArgs.cs
- WsdlInspector.cs
- CompatibleComparer.cs
- WsiProfilesElementCollection.cs
- AbstractDataSvcMapFileLoader.cs
- Quad.cs
- SvcFileManager.cs
- TextProperties.cs
- X509Certificate.cs
- NotifyCollectionChangedEventArgs.cs
- FSWPathEditor.cs
- OpenFileDialog.cs
- CookieProtection.cs
- EventRouteFactory.cs
- ComboBox.cs
- CryptoKeySecurity.cs
- Substitution.cs
- StylusPointDescription.cs
- ApplicationDirectoryMembershipCondition.cs
- LabelAutomationPeer.cs
- SerialStream.cs
- SystemWebCachingSectionGroup.cs
- TypeReference.cs