How to Create an OMCF Web Service Proxy

Updated: January 31, 2012

Applies To: System Center 2012 - Operations Manager

Before you can create a connector by using the Operations Manager Connector Framework (OMCF) Web service, you must create a web service proxy. The proxy allows you to use the methods and types that are exposed by the web service in your client application.

You can create an OMCF Web service proxy by using the Service Model Metadata Utility Tool (SvcUtil.exe) that is included in the Windows software development kit (SDK). For more information, see the () documentation.

noteNote
You do not need to create a web service proxy if you are accessing the OMCF by using the Operations Manager class libraries.

To create an OMCF Web service proxy

  1. Start a command prompt session.

  2. Navigate to the directory where you want to place the proxy code.

  3. Use the command-line tool SvcUtil.exe with the appropriate switches to create the proxy code. The following example generates a C# code file and configuration file for the OMCF service that is running on the localhost:

    Svcutil /language:c# /config:app.config http://localhost:6272/ConnectorFramework?svc
    
  4. Add the code and configuration files that are generated by the tool to your client application.

  5. Open the configuration file that is generated by the SvcUtil.exe tool.

  6. Under the system.serviceModel section, find the endpoint element. The following example has one endpoint defined:

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
    	<system.serviceModel>
    		<bindings>
    			<wsHttpBinding>
    				<binding name="WSHttpBinding_IConnectorFramework" closeTimeout="00:01:00"
    					openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
    					bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
    					maxBufferPoolSize="524288" maxReceivedMessageSize="65536"
    					messageEncoding="Text" textEncoding="utf-8" useDefaultWebProxy="true"
    					allowCookies="false">
    					<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
    						maxBytesPerRead="4096" maxNameTableCharCount="16384" />
    					<reliableSession ordered="true" inactivityTimeout="00:10:00"
    						enabled="false" />
    					<security mode="Message">
    						<transport clientCredentialType="Windows" proxyCredentialType="None"
    							realm="" />
    						<message clientCredentialType="Windows" negotiateServiceCredential="true"
    							algorithmSuite="Default" establishSecurityContext="true" />
    					</security>
    				</binding>
    			</wsHttpBinding>
    		</bindings>
    		<client>
    			<endpoint address="http://localhost:6272/ConnectorFramework"
    				binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IConnectorFramework"
    				contract="IConnectorFramework" name="WSHttpBinding_IConnectorFramework">
    				<identity>
    					<servicePrincipalName value="host/mycomputer.mydomain.com" />
    				</identity>
    			</endpoint>
    		</client>
    	</system.serviceModel>
    </configuration>
    
  7. Copy the name attribute value to the clipboard. Use this value when you construct the web service proxy in your client application, as shown in the following code:

    ConnectorFrameworkClient OMCFProxy = new ConnectorFrameworkClient("WSHttpBinding_IConnectorFramework");
    

    The constructed proxy (in this example, OMCFProxy) can now be used to access the methods and types in the OMCF.

    ImportantImportant
    Your client application must include references to the .NET Framework 3.0 libraries System.ServiceModel.dll and System.Runtime.Serialization.
  8. When you are finished with the proxy, close the connection to the client application, as shown in the following example:

    OMCFProxy.Close();
    

See Also