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
- EnumBuilder.cs
- CaseInsensitiveOrdinalStringComparer.cs
- Speller.cs
- HideDisabledControlAdapter.cs
- WebPartConnectionsDisconnectVerb.cs
- URLString.cs
- FormatterConverter.cs
- DesignBindingConverter.cs
- QilStrConcatenator.cs
- MessageQueuePermission.cs
- XPathEmptyIterator.cs
- DbParameterCollectionHelper.cs
- MarkedHighlightComponent.cs
- WebPartChrome.cs
- AssociatedControlConverter.cs
- OracleConnectionStringBuilder.cs
- TreeViewItemAutomationPeer.cs
- WhitespaceReader.cs
- CanonicalFontFamilyReference.cs
- XPathDescendantIterator.cs
- ContainerParaClient.cs
- WebServiceEnumData.cs
- ApplicationTrust.cs
- IResourceProvider.cs
- ChannelBase.cs
- CookieProtection.cs
- ParserExtension.cs
- PlacementWorkspace.cs
- GreenMethods.cs
- AspNetPartialTrustHelpers.cs
- Adorner.cs
- ScrollBar.cs
- InternalDuplexBindingElement.cs
- XamlClipboardData.cs
- MaterialGroup.cs
- SQLBinaryStorage.cs
- SqlFactory.cs
- MinimizableAttributeTypeConverter.cs
- CssTextWriter.cs
- EnumerableRowCollection.cs
- ToolStripHighContrastRenderer.cs
- ImageFormat.cs
- SignatureHelper.cs
- PackageDigitalSignatureManager.cs
- ObjectToIdCache.cs
- EncoderParameters.cs
- PopOutPanel.cs
- documentsequencetextcontainer.cs
- InProcStateClientManager.cs
- RuleProcessor.cs
- DriveNotFoundException.cs
- GeneralTransform3D.cs
- FormViewCommandEventArgs.cs
- CacheHelper.cs
- HelpKeywordAttribute.cs
- PasswordTextContainer.cs
- ListItemParagraph.cs
- SpecularMaterial.cs
- XPathExpr.cs
- Attributes.cs
- SqlDuplicator.cs
- _DisconnectOverlappedAsyncResult.cs
- DependencyPropertyKey.cs
- TextInfo.cs
- FileChangesMonitor.cs
- Page.cs
- GraphicsPath.cs
- SiteMapNodeCollection.cs
- OutputWindow.cs
- BinaryFormatter.cs
- XmlSchemaSimpleTypeRestriction.cs
- VerificationAttribute.cs
- BitmapImage.cs
- TextDecoration.cs
- ProtocolElement.cs
- OdbcTransaction.cs
- MimeTypePropertyAttribute.cs
- VersionValidator.cs
- HtmlContainerControl.cs
- XmlSchemaObjectTable.cs
- LogWriteRestartAreaState.cs
- Property.cs
- FileCodeGroup.cs
- DataObjectPastingEventArgs.cs
- FormViewPageEventArgs.cs
- SymmetricKeyWrap.cs
- HttpRequestCacheValidator.cs
- HttpHandlerActionCollection.cs
- HttpWebRequest.cs
- MasterPageParser.cs
- CompatibleIComparer.cs
- DateTimeSerializationSection.cs
- AnimationLayer.cs
- Types.cs
- BitmapEffectInputConnector.cs
- ScriptServiceAttribute.cs
- ConversionContext.cs
- WebMessageFormatHelper.cs
- ImmComposition.cs
- DataControlLinkButton.cs