Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / 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); } } }
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- SerializerProvider.cs
- ClientWindowsAuthenticationMembershipProvider.cs
- WebPartTransformerAttribute.cs
- QilXmlReader.cs
- NullableBoolConverter.cs
- CompilationRelaxations.cs
- TabOrder.cs
- LinearGradientBrush.cs
- GridViewUpdatedEventArgs.cs
- PositiveTimeSpanValidator.cs
- RelationshipEnd.cs
- ConfigurationManagerHelperFactory.cs
- BuildProvider.cs
- SmiEventSink_DeferedProcessing.cs
- CacheChildrenQuery.cs
- TreeNode.cs
- TreeViewImageIndexConverter.cs
- CryptographicAttribute.cs
- ConfigurationLocationCollection.cs
- FrameSecurityDescriptor.cs
- NonVisualControlAttribute.cs
- OleDbDataAdapter.cs
- RtType.cs
- BindingCollection.cs
- SqlCharStream.cs
- ServiceOperation.cs
- SecurityDescriptor.cs
- LongTypeConverter.cs
- PersonalizationProvider.cs
- HttpCacheVary.cs
- NativeRecognizer.cs
- RichTextBoxContextMenu.cs
- AnimationLayer.cs
- ContextMenuService.cs
- XPathDocumentNavigator.cs
- CompoundFileReference.cs
- TreeBuilderBamlTranslator.cs
- GenericTypeParameterBuilder.cs
- XmlSortKeyAccumulator.cs
- QueryParameter.cs
- DocumentViewerBaseAutomationPeer.cs
- TrackBar.cs
- ApplicationInterop.cs
- ProcessModelSection.cs
- PolyLineSegmentFigureLogic.cs
- BindingExpressionBase.cs
- Token.cs
- DataReaderContainer.cs
- UpdateTranslator.cs
- DataGridItemEventArgs.cs
- WorkflowView.cs
- WebPartConnectionsCancelVerb.cs
- WebHttpBindingCollectionElement.cs
- NumericUpDown.cs
- NestedContainer.cs
- CompileLiteralTextParser.cs
- WeakReferenceEnumerator.cs
- NavigationFailedEventArgs.cs
- ServiceProviders.cs
- UriScheme.cs
- PathFigureCollectionConverter.cs
- PreProcessInputEventArgs.cs
- CodeLinePragma.cs
- Crc32Helper.cs
- KeyManager.cs
- DataRowChangeEvent.cs
- DataSourceXmlElementAttribute.cs
- nulltextnavigator.cs
- XmlSchemaValidator.cs
- ResourceAttributes.cs
- Brushes.cs
- DynamicResourceExtensionConverter.cs
- PrintControllerWithStatusDialog.cs
- Brush.cs
- UserControlCodeDomTreeGenerator.cs
- SimpleTableProvider.cs
- SQLGuidStorage.cs
- SafeEventLogReadHandle.cs
- RemoteTokenFactory.cs
- PerformanceCounterNameAttribute.cs
- ReachPageContentSerializer.cs
- SiblingIterators.cs
- WebPartsPersonalization.cs
- PlatformCulture.cs
- Propagator.ExtentPlaceholderCreator.cs
- UIElementAutomationPeer.cs
- FolderBrowserDialogDesigner.cs
- HttpDictionary.cs
- BuildManagerHost.cs
- FormView.cs
- DataTableExtensions.cs
- XhtmlTextWriter.cs
- _CacheStreams.cs
- ZipIOExtraFieldPaddingElement.cs
- ParameterReplacerVisitor.cs
- StrokeSerializer.cs
- ScalarType.cs
- OdbcParameter.cs
- CheckBoxRenderer.cs
- RepeatInfo.cs