Welcome to MSDN Blogs Sign in | Join | Help

Metadata Search Browse User Control

Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse.MetadataUserControl is a custom System.Windows.Forms.UserControl used within both Add Adapter Service Reference Visual Studio Plug-In and Consume Adapter Service BizTalk Project Add-In.  It is available in Microsoft.ServiceModel.Channels.Tools.dll assembly. 

namespace Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse

{

    public class MetadataUserControl : UserControl

    {

        public MetadataUserControl();

 

        [Browsable(false)]

        public System.ServiceModel.Channels.Binding Adapter { get; set; }

        public string SecureConnectionUriString { get; }

        public ContractType SelectedContractType { get; }

 

        public event EventHandler<AdapterChangedEventArgs> OnAdapterChanged;

        public event EventHandler<ConnectionStateChangedEventArgs> OnConnectionStateChanged;

        public event EventHandler<MetadataOperationsChangedEventArgs> OnMetadataOperationsChanged;

        public event EventHandler<PropertiesEventArgs> OnPropertiesViewed;

 

        protected override void Dispose(bool disposing);

        public MetadataRetrievalNode[] GetMetadataOperations();

        public ServiceDescription GetWsdl();

    }

}

 

Follow these steps to use this custom metadata user control in your application:

Step 1: Create a Windows Application

Select File > New > Project > Windows > Windows Application

 Step 2: Select the Form

 Step 3: Add MetadataUserControl to the Toolbox

Select Toolbox > General.  Right Click and select “Choose Items…”.  In the Filter text box, add “Microsoft.ServiceModel.Channels.Tools”.  Select MetadataUserControl.  This control should now appear in the toolbox.

Step 4: Drag MetadataUserControl on the form and position/resize accordingly.

Step 5: Customize the form, build and run

 

Now you can browse (and search) the metadata from your adapter, using the same control that the Add Adapter Service Reference Visual Studio Plug-In and Consume Adapter Service BizTalk Project Add-In tools use.

  

For example, I added a button called “Generate WSDL” to generate WSDL from the selected operations using MetadataUserControl.GetWsdl method.   

 

 

Here is the code behind Click event of “Generate WSDL” push button. 

 

    public partial class AdapterMetadataExplorer : Form

    {

        private void btGetWsdl_Click(object sender, EventArgs e)

        {

            ServiceDescription sd = mdUserControl.GetWsdl();

            // write the WSDL to a file

            FileStream myFileStream = new FileStream(tbWsdlFileName.Text, FileMode.OpenOrCreate, FileAccess.Write);

            StreamWriter myStreamWriter = new StreamWriter(myFileStream);

            sd.Write(myStreamWriter);

            myStreamWriter.Flush();

            myStreamWriter.Close();

            MessageBox.Show("WSDL file " + tbWsdlFileName.Text + " is created.");

        }

    }

 

See attached ZIP file that contains a Visual Studio Project with a sample windows form application using this custom metadata user control.

Published Thursday, July 05, 2007 7:00 PM by sonua

Attachment(s): ASDK_MetadataExplorer_GetWsdl.zip

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# How to: Browse/Search metadata in a WCF LOB Adapter

Adapter consumer can browse/search metadata from WCF LOB Adapter using following ways: Using Add Adapter

Sunday, July 08, 2007 4:30 PM by Developing adapters using WCF

# How to: Generate a WSDL from a WCF LOB Adapter

Add Adapter Service Reference Visual Studio Plug-In generates a CLR objects and Consume Adapter Service

Sunday, July 08, 2007 5:54 PM by Developing adapters using WCF

# re: Metadata Search Browse User Control

I tried to use the MetadataUserControl, but I simply get this error and the control remains read only:

No valid adpaters installed on the machine.

I would like to use the control to browse basic WSDL endpoints.  Can this be done?

scott_prugh at csgsystems dot com

Friday, August 10, 2007 6:59 PM by Scott Prugh

# WCF Siebel Adapter

I installed the WCF LOB Adapter SDK and tried to use it in a vb.net application. When I right click and select the Add Adapter Service Reference. I get the error message "No valid adapters installed on the machine" and then i get the grayed out screen for "Metadata Search Browse User Control". Do i need to have Biztalk server installed to get access to the adapters for Siebel.

Thanks,

Lionel

Monday, October 29, 2007 5:24 PM by Lionel Alva

# re: OnAdapterChangedEvent for control

I'm trying to use the events for the browser control.  I can get the "OnMetadataOperationsChangedEvent" to work, however, the event below NEVER fires.  Does anyone know if this works?   Thanks:

private void OnAdapterChangedEvent(object sender, Microsoft.ServiceModel.Channels.Tools.MetadataSearchBrowse.AdapterChangedEventArgs e)

      {

              myAadapterName = e.Adapter.Name;

      }

Tuesday, March 25, 2008 12:58 PM by Marty W

Leave a Comment

(required) 
required 
(required) 

  
Enter Code Here: Required
 
Page view tracker