This Operation Is Not Supported Wcf Test Client Because It Uses Type

Автор:
-->

I am performing crud operation in asp.net mvc 2 using wcf and entity framework and i am getting error in wcf 'GetCustomer', the error is this 'This operation is not.

Windows Communication Foundation (WCF) Test Client (WcfTestClient.exe) is a GUI tool that enables users to input test parameters, submit that input to the service, and view the response that the service sends back. It provides a seamless service testing experience when combined with WCF Service Host.

You can typically find the WCF Test Client (WcfTestClient.exe) in the following location: C:Program Files (x86)Microsoft Visual Studio2017CommunityCommon7IDE - Community may be one of 'Enterprise', 'Professional' or 'Community' depending on which level of Visual Studio is installed.

Scenarios for Using Test Client

The following sections discuss the most common scenarios in which you can use WCF Test Client to streamline your development process.

Inside Visual Studio

WCF Service Host Starts WCF Test Client with a Single Service

After you create a new WCF service project and press F5 to start the debugger, the WCF Service Host begins to host the service in your project. Then, WCF Test Client opens and displays a list of service endpoints defined in the configuration file. You can test the parameters and invoke the service, and repeat this process to continuously test and validate your service.

WCF Service Host Starts WCF Test Client with Multiple Services

You can also use WCF Test Client to help debug a service project that contains multiple services. When WCF Test Client opens, it automatically iterates the list of services in your project and opens them for testing.

Outside Visual Studio

You can also invoke the WCF Test Client (WcfTestClient.exe) outside Visual Studio to test an arbitrary service on the Internet. To locate the tool, go to the following location:

C:Program Files (x86)Microsoft Visual Studio2017CommunityCommon7IDE (where community can be one of 'Enterprise', 'Professional' or 'Community' depending on which level of Visual Studio is installed on the machine)

To use the tool, double-click the file name to open it from this location, or launch it from a command line.

WCF Test Client takes an arbitrary number of URIs as command line arguments. These are the URIs of services that can be tested.

wcfTestClient.exe URI1 URI2 …

After the WCF Test Client window is opened, click File->Add Service, and enter the endpoint address of the service you want to open.

WCF Test Client User Interface

You can use WCF Test Client with a single service or multiple services.

Service Operations

The left pane of the WCF Test Client main window lists all the available services, along with their respective endpoints and operations.

When you double-click an operation, you can view its content in the right pane inside a new tab with the operation's name.

The left pane also lists client configuration files. Double-click any of the items to display the content of the file in a new tabbed window in the right pane.

Entering Test Parameters

To view the test parameters, double-click an operation to open it in the right pane. The parameters are showed in Formatted view by default, and you can enter arbitrary values for the parameters to test the service.

To view the message's XML, click XML. To send them to the service, click Invoke.

For a DataSet parameter, click the button next to Edit… to edit it in a new window showing the DataGrid. Notice the appearance of the Copy DataSet and Paste DataSet buttons. If the schema of the DataSet object is unknown upon the first edit, the DataGrid is empty. You have to paste a DataSet object with the same schema into the current object in the DataGrid. (Notice that you need to copy the schema from somewhere else before the paste operation.) You can also copy a Dataset object for future usage by clicking the Copy DataSet button.

The service's response appears below the test parameters.

Note

If the expected return value is a string, the result will be displayed as a quoted string even though the input provided was not in quotes.

If you specified a particular operation as one-way when you created the contract for the service, no service response is displayed. As soon as the message is queued for delivery, a dialog box pops up to notify you that the message was successfully sent.

Session Support

The Start a new proxy check box in a service operation's tab enables you to toggle session support. This box is cleared by default.

When you enter test parameters for a specific operation (or another operation in the same service endpoint) and click Invoke multiple times with the check box cleared, these operations share one proxy and the service status is persisted across multiple operations.

If the Start a new proxy check box is checked, a new proxy is started for each Invoke, the previous session scenario is ended, and the service status is reset.

Editing Client Configuration

The left pane of the WCF Test Client main window lists client configuration files. Double-click any of the items to display the contents of the file in the right pane.

Edit with Service Configuration Editor

Right-click Config File in the left pane and select the context menu Edit with SvcConfigEditor. Service Configuration Editor is launched with the client configuration content. You can edit the configuration and save it within the tool.

After saving the file in Service Configuration Editor, WCF Test Client displays a warning message to inform you that the file has been modified outside and asks whether you would like to reload it.

If you select Yes, the configuration content in the 'Client.dll.config' tab reflects the changes you made in the editor.

If you select No, the configuration content in the 'Client.dll.config' tab remains unchanged and the modified content is automatically saved to the source file.

Restore to Default Configuration

If you want to cancel all the changes and restore to the default client configuration, right-click Config File in the left pane and select the context menu Restore to Default Config. The default configuration value is loaded and content in 'Client.dll.config' tab is restored.

Validate Changes

When saved changes are being loaded in WCF Test Client, the configuration is checked for validity against WCF schema. If errors are found, a dialog box is displayed to show error details.

During proxy generation, binary compiling, or service invoking, menu items that support editing (that is, 'Edit …', 'Restore …', and so on) are disabled. Service invocation is also disabled when loading updated configuration to WCF Test Client.

Persist Client Configuration

The Tools->Options->Client Configuration tab contains an Always Regenerate Config When Launching Services option, which is enabled by default. This option specifies that every time WCF Test Client loads a service, it regenerates a configuration file based on the latest service contract and service App.config files.

If you have edited the client configuration for your WCF service and want to always use this updated file to debug your service, you can uncheck the Regenerate option. By doing so, even when you update the service and reopen WCF Test Client, the Client.dll.config file is the one you updated previously instead of a regenerated one based on the updated service.

However, you might need to edit the configuration file to make it consistent with the regenerated proxy. If the regenerated proxy and configuration file are mismatched due to an updated service, errors will occur when the service is invoked.

Caution

If you have modified the client configuration file and select to reuse it in the future, you can find the file in the following location:

Documents and Settings[User Account]My DocumentsTest Client Projects.

Any updated credential information stored to the client configuration file is protected by the Access Control List (ACL) of this folder.

Adding, Removing and Refreshing Services

Add Service

Click File->Add Service to add a service to WCF Test Client. You are then required to type the URI (endpoint address) of the service to be added. The service’s address can be a mex address or WSDL address.

You can also find a list of 10 recently added services' endpoints in the Recent Services submenu. If you select one of them, the specified service is added to WCF Test Client.

You can also right-click the root of service tree My Service Projects, and select Add Service to achieve the same result.

During proxy generation, binary compiling, or service invocation, menu items that support adding a service are disabled. Service invocation is also disabled.

Remove Service

Right-click the service root of the service to be removed, and select Remove Service to remove a service from WCF Test Client.

During proxy generation, binary compiling, or service invocation, menu items that support removing a service are disabled. Service invocation is also disabled.

Refresh Service

If a change is made to the service while WCF Test Client is running and you want to ensure that the WCF Test Client implementation for that service is up-to-date, right-click the service root of the service, and select Refresh Service. Note that after refreshing, the service status is reset.

During proxy generation, binary compiling, or service invocation, menu items that support refreshing a service are disabled. Service invocation is also disabled.

Location of Files Generated by the Test Client

By default, WCF Test Client stores generated client code and configuration files in the '%appdata%LocaltempTest Client Projects' folder. This folder is deleted after WCF Test Client exits. If a configuration file is modified in WCF Test Client and the Always Regenerate Config When Launching Services option is disabled, the modified file is copied to the 'CachedConfig' folder under 'My DocumentsTest Client Projects' with a mapping (metadata-address-to-file-name) XML file as an index.

You can also start WCF Test Client in a command line, use the /ProjectPath switch to specify a new desired path for storing generated files, or use the /RestoreProjectPath switch to restore the default location. The syntax is as follows:

wcfTestClient.exe /ProjectPath [desired location]

Running this command does not open WCF Test Client. Only the folder location is changed. You can run this command whether WCF Test Client is running or not. The new location is applied when WCF Test Client is restarted. The location information can be saved in registry, or in the WcfTestClient.exe.option file in the '%appdata%LocaltempTest Client Projects' folder.

Deluge fedora. Deluge review. A cross-platform torrent client that's highly extendable with a wide selection of plugins. By 2017-07-03T14:00:10.183Z. A perfect example of why you shouldn’t judge a book by its cover, Deluge is a powerful torrent client that has much more to offer than you might first think. Deluge is a BitTorrent client software through which you can download files with the help of torrent files. It is a completely free software. Also, it doesn't contain any type of advertisements, adware or any type of malware. Because of which, it is a fully clean software. Moreover, this software was first released in the year 2006. A free (gpl) app for Mac, by Deluge Team Deluge is a free (gpl) multiplatform software (also available for Windows). It belongs to the category 'Internet & Network' and the subcategory 'File Sharing & Peer to Peer', and has been developed by Deluge Team.

Features supported by WCF Test Client

The following is a list of features supported by WCF Test Client:

  • Service Invocation: Request/Response and One-way message.

  • Bindings: all bindings supported by Svcutil.exe.

  • Controlling Session.

  • Message Contract.

  • XML serialization.

The following is a list of features not supported by WCF Test Client:

  • Types: Stream, Message, XmlElement, XmlAttribute, XmlNode, types that implement the IXmlSerializable interface, including the related XmlSchemaProviderAttribute attribute, and the XDocument and XElement types and the ADO.NET DataTable type.

  • Duplex contract.

  • Transaction.

  • Security: CardSpace , Certificate, and Username/Password.

  • Bindings: WSFederationbinding, any Context bindings and Https binding, WebHttpbinding (Json response message support).

Closing WCF Test Client

You can close WCF Test Client in the following ways:

  • On the File menu, click Exit. Alternatively, in the WCF Test Client main window, click Close. Both of these actions also shut down WCF Service Auto Host and stop the Visual Studio debugging process if WCF Test Client was launched by Visual Studio.

  • Right-click the WCF Service Host icon in the notification area, and then click Exit. This shuts down both WCF Service Auto Host and WCF Test Client and stops the Visual Studio debugging process.

See also

Microsoft has been supported Web Api in CRM 2016. We can use it for many solutions, such as mobile app, OAuth, but sometime you do not want to public CRM Web API to internet, but you still want to use CRM Web API as data services…

This article will talk about how to call CRM Web Api using WCF services.

Wcf

Create 1 WCF Service project and install the Web API Client Libraries

You can use Nuget Package Manager to install from Visual, just type the following command

Install-Package Microsoft.AspNet.WebApi.Client

Create your method in your interface wcf

Implement this method

Create 1 method name RunAsync for Async (you can use any names that you want)

static async Task RunAsync()

{

//In Case you are using CRM Onpremise

ClientCredentials clientCred = new ClientCredentials();

clientCred.Windows.ClientCredential.Domain = “Your Domain”;

clientCred.Windows.ClientCredential.UserName = “Your User Name”;

clientCred.Windows.ClientCredential.Password = “Your Pass”;

var handler = new HttpClientHandler

{

Credentials = clientCred.Windows.ClientCredential

};

//CRM Online or IFD Deployment, you have to use OAuth

//Step to register your CRM with Azure

//Step 1: Login to Windows Azure portal

//Step 2: Select your organization and click on applications

//Step 3: To Add your CRM application click on Add button.

//Step 4: Add an application my organization is developing

//Step 5: Step 5: Enter name of your application

//Step 7: Once application is added, we need to configure it

//Step 8: Add Microsoft dynamics crm permission to this application

//Step 9: Assign Delegate Permission to Microsoft Dynamics CRM

//Step 10: Save the Changes

//Step 11: Copy Client ID, that we will use in native client application – Important to remember it

//Use the folowing code to OAuth:

/*——————————————————-

string clientId = “db329e3d-4d6d-4ef2-9195-bfad1daed689”;

string redirectUrl = “your crm url”;

// Authenticate the registered application with Azure Active Directory.

AuthenticationContext authContext = new AuthenticationContext(“https://login.windows.net/common”, false);

AuthenticationResult result = authContext.AcquireToken(resource, clientId, new Uri(redirectUrl));

———————————————————————————————*/

using (var client = new HttpClient(handler))

{

//http://korbsbvm34.apac.bosch.com:5555/CRM2016SandBox/api/data/v8.0/

client.BaseAddress = new Uri(“http://korbsbvm34.apac.bosch.com:5555/CRM2016SandBox/”);

client.DefaultRequestHeaders.Accept.Clear();

client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue(“application/json”));

HttpResponseMessage response = await client.GetAsync(“api/data/v8.0”);

if (response.IsSuccessStatusCode)

{

response = await client.GetAsync(“api/data/v8.0/accounts”);

string accountRespone = await response.Content.ReadAsStringAsync();

}

Entity account = new Entity(“account”);

account[“name”] = “Pham Hong an”;

response = await client.PostAsJsonAsync(“api/data/v8.0/account”, account);

if (response.IsSuccessStatusCode)

{

Uri accountUri = response.Headers.Location;

}

}

}

Then you just call this method to your wcf method.

To test it, you just create 1 Application win form, add service reference and call this service in your application.