Code:
/ Net / Net / 3.5.50727.3053 / DEVDIV / depot / DevDiv / releases / whidbey / netfxsp / ndp / fx / src / xsp / System / Web / Compilation / WsdlBuildProvider.cs / 1 / WsdlBuildProvider.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Compilation { using System; using System.Globalization; using System.IO; using System.Diagnostics; using System.Web.Services.Description; using System.Xml; using System.Xml.Serialization; using System.CodeDom; using System.CodeDom.Compiler; using System.Web.Configuration; using System.Web.Hosting; using System.Web.Util; using Util=System.Web.UI.Util; [BuildProviderAppliesTo(BuildProviderAppliesTo.Code)] internal class WsdlBuildProvider: BuildProvider { public override void GenerateCode(AssemblyBuilder assemblyBuilder) { // Get the namespace that we will use string ns = Util.GetNamespaceFromVirtualPath(VirtualPathObject); ServiceDescription sd; // Load the wsdl file using (Stream stream = VirtualPathObject.OpenFile()) { try { sd = ServiceDescription.Read(stream); } catch (InvalidOperationException e) { // It can throw an InvalidOperationException, with the relevant // XmlException as the inner exception. If so, throw that instead. XmlException xmlException = e.InnerException as XmlException; if (xmlException != null) throw xmlException; throw; } } ServiceDescriptionImporter importer = new ServiceDescriptionImporter(); #if !FEATURE_PAL importer.CodeGenerator = assemblyBuilder.CodeDomProvider; importer.CodeGenerationOptions = CodeGenerationOptions.GenerateProperties | CodeGenerationOptions.GenerateNewAsync | CodeGenerationOptions.GenerateOldAsync; #endif // !FEATURE_PAL importer.ServiceDescriptions.Add(sd); CodeCompileUnit codeCompileUnit = new CodeCompileUnit(); CodeNamespace codeNamespace = new CodeNamespace(ns); codeCompileUnit.Namespaces.Add(codeNamespace); // Create the code compile unit importer.Import(codeNamespace, codeCompileUnit); // Add the CodeCompileUnit to the compilation assemblyBuilder.AddCodeCompileUnit(this, codeCompileUnit); } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. //------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.Compilation { using System; using System.Globalization; using System.IO; using System.Diagnostics; using System.Web.Services.Description; using System.Xml; using System.Xml.Serialization; using System.CodeDom; using System.CodeDom.Compiler; using System.Web.Configuration; using System.Web.Hosting; using System.Web.Util; using Util=System.Web.UI.Util; [BuildProviderAppliesTo(BuildProviderAppliesTo.Code)] internal class WsdlBuildProvider: BuildProvider { public override void GenerateCode(AssemblyBuilder assemblyBuilder) { // Get the namespace that we will use string ns = Util.GetNamespaceFromVirtualPath(VirtualPathObject); ServiceDescription sd; // Load the wsdl file using (Stream stream = VirtualPathObject.OpenFile()) { try { sd = ServiceDescription.Read(stream); } catch (InvalidOperationException e) { // It can throw an InvalidOperationException, with the relevant // XmlException as the inner exception. If so, throw that instead. XmlException xmlException = e.InnerException as XmlException; if (xmlException != null) throw xmlException; throw; } } ServiceDescriptionImporter importer = new ServiceDescriptionImporter(); #if !FEATURE_PAL importer.CodeGenerator = assemblyBuilder.CodeDomProvider; importer.CodeGenerationOptions = CodeGenerationOptions.GenerateProperties | CodeGenerationOptions.GenerateNewAsync | CodeGenerationOptions.GenerateOldAsync; #endif // !FEATURE_PAL importer.ServiceDescriptions.Add(sd); CodeCompileUnit codeCompileUnit = new CodeCompileUnit(); CodeNamespace codeNamespace = new CodeNamespace(ns); codeCompileUnit.Namespaces.Add(codeNamespace); // Create the code compile unit importer.Import(codeNamespace, codeCompileUnit); // Add the CodeCompileUnit to the compilation assemblyBuilder.AddCodeCompileUnit(this, codeCompileUnit); } } } // 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
- QEncodedStream.cs
- xdrvalidator.cs
- PropertyValidationContext.cs
- EntityTypeEmitter.cs
- sqlcontext.cs
- XPathMessageFilterTable.cs
- SessionIDManager.cs
- ErrorBehavior.cs
- PermissionListSet.cs
- _Connection.cs
- MemoryStream.cs
- ApplicationContext.cs
- ElementMarkupObject.cs
- XmlSchemaCompilationSettings.cs
- TextServicesLoader.cs
- FormsIdentity.cs
- DisableDpiAwarenessAttribute.cs
- TemplateBuilder.cs
- ObjectSecurity.cs
- ByteBufferPool.cs
- CfgParser.cs
- HwndSubclass.cs
- CapiHashAlgorithm.cs
- InternalSendMessage.cs
- Style.cs
- GeneralTransform3DGroup.cs
- SessionParameter.cs
- RelOps.cs
- itemelement.cs
- XmlWrappingReader.cs
- CompiledELinqQueryState.cs
- CompositionTarget.cs
- ReceiveActivity.cs
- DataServiceQuery.cs
- Relationship.cs
- ItemList.cs
- XmlLoader.cs
- HostingEnvironmentException.cs
- XslTransform.cs
- InputManager.cs
- MetadataPropertyAttribute.cs
- GridViewPageEventArgs.cs
- DecimalStorage.cs
- StringDictionaryWithComparer.cs
- SymbolPair.cs
- CalendarDay.cs
- XsltCompileContext.cs
- BaseParser.cs
- Material.cs
- DeflateStreamAsyncResult.cs
- HeaderLabel.cs
- ControlPropertyNameConverter.cs
- PolicyValidationException.cs
- BoolExpressionVisitors.cs
- CreateUserWizardAutoFormat.cs
- Size3D.cs
- DependencyObject.cs
- Parameter.cs
- ManifestSignedXml.cs
- EventRoute.cs
- Button.cs
- EntityDataSourceWrapperCollection.cs
- EncodingNLS.cs
- EntityContainerRelationshipSetEnd.cs
- Storyboard.cs
- EntityDesignerDataSourceView.cs
- SqlComparer.cs
- UriExt.cs
- ScrollItemPattern.cs
- SerialErrors.cs
- StatusCommandUI.cs
- UriScheme.cs
- MenuItem.cs
- RightsManagementEncryptedStream.cs
- AnnotationHelper.cs
- DictionaryContent.cs
- _HTTPDateParse.cs
- AspNetCompatibilityRequirementsMode.cs
- _ConnectOverlappedAsyncResult.cs
- Storyboard.cs
- SecurityKeyType.cs
- MenuCommand.cs
- ColumnMapTranslator.cs
- BoolExpressionVisitors.cs
- XamlGridLengthSerializer.cs
- CapiHashAlgorithm.cs
- AppSettingsReader.cs
- AutomationIdentifier.cs
- InputBindingCollection.cs
- _StreamFramer.cs
- CacheAxisQuery.cs
- ListViewItem.cs
- EmptyEnumerator.cs
- PolygonHotSpot.cs
- RemoveStoryboard.cs
- Win32PrintDialog.cs
- TimelineGroup.cs
- WindowInteractionStateTracker.cs
- MultilineStringConverter.cs
- OdbcUtils.cs