Capture WCF client request with a proxy configuration - wcf

I need to capture trafic with fiddler but in my config i need to specify a proxy to perform the connection my .config looks like this:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="asdClientTest.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<system.net>
<defaultProxy enabled="true" useDefaultCredentials="true">
<proxy proxyaddress="http://zzzzz"></proxy>
</defaultProxy>
</system.net>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="ATEX">
<security mode="Transport" />
</binding>
<binding name="ATEX1">
<security mode="Transport" />
</binding>
<binding name="ATEX2" />
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://zzzzzzzz"
binding="basicHttpBinding" bindingConfiguration="ATEX" contract="WS.ConsultaATEX"
name="ATEX" />
</client>
</system.serviceModel>
</configuration>
but fiddler is not capturing nothing.
does anyone help me?

I believe here you will find how to properly configure Fiddler to achieve what you need.

If your server is running locally you may be missing bypassonlocal="False" in the <proxy> tag. I took this information from here.
Hope it helps!

Related

How to Enable GZip Compression when Communicating with a Remote Service Using WSDL and WCF

I'm trying to send data to the IRS using a WSDL file and WCF. I'm using .NET and Microsoft VS.NET, which created a proxy class I'm utilizing to communicate.
My problem is I keep getting a message saying GZip compression is required from the IRS:
The request message must be sent using HTTP compression (RFC 1952 - GZIP). Please review the transmission instructions outlined in Section 5 of Publication 5258, AIR Submission Composition and Reference Guide, located at https://www.irs.gov/e-file-providers/air/affordable-care-act-information-return-air-program, correct any issues, and try again.'
The publication referred to in the error message is very generic and is not specific to .NET and WCF. I did some research and found a way to enable GZip compression in web.config:
<binaryMessageEncoding compressionFormat="GZip" />
However, I now get this error:
The content type text/xml;charset=utf-8 of the response message does not match the content type of the binding (application/soap+msbin1+gzip). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.
Does anyone know what I'm doing wrong? Do I need to create a custom encoder? Here's is my full web.config file:
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.7.2"/>
<httpRuntime targetFramework="4.7.2"/>
</system.web>
<system.codedom>
<compilers>
<compiler language="c#;cs;csharp" extension=".cs"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:default /nowarn:1659;1699;1701"/>
<compiler language="vb;vbs;visualbasic;vbscript" extension=".vb"
type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=2.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
warningLevel="4" compilerOptions="/langversion:default /nowarn:41008 /define:_MYTYPE=\"Web\" /optionInfer+"/>
</compilers>
</system.codedom>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="GetACATransmitterStatusReqBinding">
<security mode="Transport" />
</binding>
<binding name="GetACATransmitterStatusReqBinding1" />
</basicHttpBinding>
<customBinding>
<binding name="BulkRequestTransmitterBinding">
<!--<textMessageEncoding messageVersion="Soap11WSAddressing10" />-->
<binaryMessageEncoding compressionFormat="GZip" />
<httpsTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="https://la.www4.irs.gov/airp/aca/a2a/1095BC_Transmission_AATS"
binding="customBinding" bindingConfiguration="BulkRequestTransmitterBinding"
contract="BulkRequestTransmitterService.BulkRequestTransmitterPortType"
name="BulkRequestTransmitterPort" />
<endpoint address="https://la.www4.irs.gov/airp/aca/a2a/1095BC_Status_Request_AATS"
binding="basicHttpBinding" bindingConfiguration="GetACATransmitterStatusReqBinding"
contract="ACAGetTransmitterBulkRequestStatus.ACATransmitterStatusReqPortType"
name="ACATransmitterStatusReqPort" />
</client>
</system.serviceModel>
</configuration>

The remote server returned an error: (413) Request Entity Too Large WCF Application

My Setup:
WCF application hosted in IIS Express
Windows Form Application to test WCF App
This is WCF Web.config:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="ArxivarBridgeService.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.6.1" />
<httpRuntime targetFramework="4.6.1" />
</system.web>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="myBasicBinding" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647" closeTimeout="01:50:00" openTimeout="01:50:00" sendTimeout="01:50:00" receiveTimeout="01:50:00" >
<readerQuotas maxDepth="128" maxStringContentLength="8388608" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="true" />
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="false" />
<dataContractSerializer ignoreExtensionDataObject="false" maxItemsInObjectGraph="2147483646" />
</behavior>
</serviceBehaviors>
</behaviors>
<protocolMapping>
<add binding="basicHttpsBinding" scheme="https" />
</protocolMapping>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" minFreeMemoryPercentageToActivateService="0" />
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<!--
To browse web app root directory during debugging, set the value below to true.
Set to false before deployment to avoid disclosing web app folder information.
-->
<directoryBrowse enabled="true" />
<security>
<requestFiltering>
<fileExtensions allowUnlisted="true">
<remove fileExtension="." />
<add fileExtension="." allowed="true" />
</fileExtensions>
</requestFiltering>
</security>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Microsoft.Practices.EnterpriseLibrary.Validation" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
This is app.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.2" />
</startup>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IArxivarBridgeService" />
</basicHttpBinding>
</bindings>
<behaviors>
<endpointBehaviors>
<behavior name="ServiceBehaviour">
<dataContractSerializer maxItemsInObjectGraph="2147483647"/>
</behavior>
</endpointBehaviors>
</behaviors>
<client>
<endpoint address="address"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IArxivarBridgeService"
contract="ServiceReference1.IArxivarBridgeService" name="BasicHttpBinding_IArxivarBridgeService" />
</client>
</system.serviceModel>
</configuration>
In the test application I recover a 3 MB pdf file, recalling a service method as input data, I have the byte arrey obtained from the pdf, the file name, a Dictionary and 3 strings, the method Returns the error "The remote server returned an error: (413) Request Entity Too Large", did I write the config wrong? Or is some parameter missing?

How can I set message encoding for a web reference

I've been given a service which I need to consume. This service is only happy when added to the project as a 'web reference' and NOT a 'service reference'. When I add the reference, the app.config is modified as shown here...
<configSections>
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="TestApp.My.MySettings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
</configSections>
<applicationSettings>
<TestApp.My.MySettings>
<setting name="TestApp_DemoService_Rfx" serializeAs="String">
<value>https://www.mydemosourcesite.com:443/common/services/Rfx/</value>
</setting>
</TestApp.My.MySettings>
</applicationSettings>
I can consume the service fine, except that the response it's returning uses MTOM. My question is - how can I configure this service to use MTOM for the message encoding. If I were doing this with a service reference, I'd do this...
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="RfxSOAP" messageEncoding="Mtom">
<security mode="Transport" />
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="https://www.mydemosourcesite.com:443/common/services/Rfx/" binding="basicHttpBinding" bindingConfiguration="RfxSOAP" contract="DemoService.Rfx" name="RfxSOAP" />
</client>
</system.serviceModel>
Sadly though, I'm not using a service reference and no idea how to get this configured for a web reference! This is in VB and .NET 4.
All help appreciated!

SOAP Create web-server for IIS with BizTalk

I have to configurate SOAP web-service with BizTalk involving
How it must works
1. Client has login/pass going to https://soap.mjr.ru/soap.svc
2. Client send Request like
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:doc="https://docflow.mjr.ru.Request">
<soapenv:Header/>
<soapenv:Body>
<doc:Request>
<MessageIdentifier>1231</MessageIdentifier>
<MessageType>3B18</MessageType>
<MessagePriority>1</MessagePriority>
<XmlRequest>kuehgiuehriveiveibveifbveifbviebfvieb</XmlRequest>
<Sender>123456789</Sender>
<Receiver>123456789</Receiver>
</doc:Request>
</soapenv:Body>
</soapenv:Envelope>
SOAP server at my side receive request and send back to Client answer about good receipt or error code
Server take from inbound message data from Request field and put it like XML into folder
What i have done
In Visual Studio I Have created new BT project with XSD for Request and Response
I have deployed this project into BTS
Within utilite BizTalk WCF service Publishing Wizard I have publicate schemas as service into /soap/soap.svc
Configurate subsite Application Spool by SQL user for DB connection
Create new site in IIS and bind it for https://soap.mjr.ru
Configurate permission for client user for this folder
In BizTalk Server Administrator configurate Receive Port & Receive Location (they have been created automatically). Rewrite address to file from /soap/soap.svc to `/soap.svc'
Run application in BTS and after i can see the file at https://soap.mjr.ru/soap.svc?WSDL
But i can't reach my service with SOAPUI. Here i have 401 error.. and that's all
Please help with correct configuration
listing of web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0">
<configSections>
<section name="bizTalkSettings" type="Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkConfigurationSection,
Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</configSections>
<bizTalkSettings>
<mexServiceHostFactory debug="false">
<receiveLocationMappings>
</receiveLocationMappings>
</mexServiceHostFactory>
<webServiceHostFactory debug="false" />
<isolatedReceiver disable="false" />
<btsWsdlExporter disable="false" />
</bizTalkSettings>
<appSettings />
<connectionStrings />
<system.web>
<customErrors mode="Off" />
<compilation defaultLanguage="c#" debug="false">
<assemblies>
<add assembly="mscorlib, version=2.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" />
<add assembly="Microsoft.BizTalk.Adapter.Wcf.Common, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add assembly="Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
</assemblies>
</compilation>
<authentication mode="Windows" />
<identity impersonate="false" />
</system.web>
<system.serviceModel>
<extensions><behaviorExtensions><add name="btsWsdlExporter" type="Microsoft.BizTalk.Adapter.Wcf.Metadata.BtsWsdlExporterElement,
Microsoft.BizTalk.Adapter.Wcf.Runtime, Version=3.0.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" /></behaviorExtensions></extensions>
<bindings>
<basicHttpBinding>
<binding name="httpBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Basic" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<diagnostics>
<endToEndTracing activityTracing="true" messageFlowTracing="true" propagateActivity="true">
</endToEndTracing>
</diagnostics>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehaviorConfiguration">
<serviceDebug httpHelpPageEnabled="true" httpsHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Microsoft.BizTalk.Adapter.Wcf.Runtime.BizTalkServiceInstance" behaviorConfiguration="ServiceBehaviorConfiguration">
<host>
<baseAddresses>
<add baseAddress="https://10.8.1.226/soap.svc" />
<add baseAddress="https://soap.mjr.ru/soap.svc" />
</baseAddresses>
</host>
<endpoint name="HttpMexEndpoint" address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
</configuration>

Slow cheetah not transforming endpoint tags in app.config

i love SlowCheetah for what it is, but having some issues with getting it to transform endpoints in my app.config. I was hoping maybe someone could take a look and see what I am missing or has had this issue in the past.
The app.config default
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/RFPModel.csdl|res://*/RFPModel.ssdl|res://*/RFPModel.msl;provider=System.Data.SqlClient;provider connection string="data source=developmentServer;initial catalog=databaseName;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMasterEngineService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://DevelopmentServer/WebServices/MasterEngine/MasterEngineService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMasterEngineService" contract="OverlayFarEnd.IMasterEngineService" name="BasicHttpBinding_IMasterEngineService" />
</client>
</system.serviceModel>
</configuration>
The Transform for Release is:
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/RFPModel.csdl|res://*/RFPModel.ssdl|res://*/RFPModel.msl;provider=System.Data.SqlClient;provider connection string="data source=releaseServer;initial catalog=databaseName;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" xdt:Transform="Replace" xdt:Locator="Match(name)" />
</connectionStrings>
<endpoint address="http://productionServer/WebServices/MasterEngine/MasterEngineService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMasterEngineService" contract="OverlayFarEnd.IMasterEngineService" name="BasicHttpBinding_IMasterEngineService" xdt:Transform="Replace" xdt:Locator="Match(name)">
</endpoint>
</configuration>
I do the normal, create Configurations and make sure before I build that I am in the correct configuration / enviornment, but no matter what I do it stays the same development server even when selecting the Release enviornment / configurations.
Any ideas?
-- UPDATE -- Per request, tried:
<?xml version="1.0" encoding="utf-8" ?>
<!-- For more information on using transformations
see the web.config examples at http://go.microsoft.com/fwlink/?LinkId=214134. -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<system.serviceModel>
<client>
<endpoint address="http://productionServer/WebServices/MasterEngine/MasterEngineService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMasterEngineService" contract="OverlayFarEnd.IMasterEngineService" name="BasicHttpBinding_IMasterEngineService" xdt:Transform="Replace" xdt:Locator="Match(name)" />
</client>
</system.serviceModel>
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/RFPModel.csdl|res://*/RFPModel.ssdl|res://*/RFPModel.msl;provider=System.Data.SqlClient;provider connection string="data source=databaseName;initial catalog=dash;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" xdt:Transform="Replace" xdt:Locator="Match(name)" />
</connectionStrings>
</configuration>
Didn't work
-UPDATE AGAIN ---
Tried your suggestion of connectionString first.. to no avail
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<connectionStrings>
<add name="MyEntities" connectionString="metadata=res://*/RFPModel.csdl|res://*/RFPModel.ssdl|res://*/RFPModel.msl;provider=System.Data.SqlClient;provider connection string="data source=databaseName;initial catalog=dash;integrated security=True;multipleactiveresultsets=True;App=EntityFramework"" providerName="System.Data.EntityClient" xdt:Transform="Replace" xdt:Locator="Match(name)" />
</connectionStrings>
<client>
<endpoint address="productionServerName/WebServices/MasterEngine/MasterEngineService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMasterEngineService" contract="OverlayFarEnd.IMasterEngineService" name="BasicHttpBinding_IMasterEngineService" xdt:Transform="Replace" xdt:Locator="Match(name)" />
</client>
</configuration>
This is working for me, after making the suggestion in my first comment:
It should be system.serviceModel/client/endpoint, not configuration/endpoint.
Web.config
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=152368
-->
<configuration>
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<system.web>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Web.Abstractions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Helpers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Routing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
<add assembly="System.Web.WebPages, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
</assemblies>
</compilation>
<authentication mode="Windows">
</authentication>
<pages>
<namespaces>
<add namespace="System.Web.Helpers" />
<add namespace="System.Web.Mvc" />
<add namespace="System.Web.Mvc.Ajax" />
<add namespace="System.Web.Mvc.Html" />
<add namespace="System.Web.Routing" />
<add namespace="System.Web.WebPages"/>
</namespaces>
</pages>
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
<bindingRedirect oldVersion="1.0.0.0-2.0.0.0" newVersion="3.0.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
<system.serviceModel>
<bindings>
<basicHttpBinding>
<binding name="BasicHttpBinding_IMasterEngineService" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="None">
<transport clientCredentialType="None" proxyCredentialType="None" realm="" />
<message clientCredentialType="UserName" algorithmSuite="Default" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<client>
<endpoint address="http://DevelopmentServer/WebServices/MasterEngine/MasterEngineService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMasterEngineService" contract="OverlayFarEnd.IMasterEngineService" name="BasicHttpBinding_IMasterEngineService" />
</client>
</system.serviceModel>
</configuration>
Web.Debug.config
<?xml version="1.0"?>
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<!--
In the example below, the "SetAttributes" transform will change the value of
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
finds an atrribute "name" that has a value of "MyDB".
<connectionStrings>
<add name="MyDB"
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
</connectionStrings>
-->
<system.web>
<!--
In the example below, the "Replace" transform will replace the entire
<customErrors> section of your web.config file.
Note that because there is only one customErrors section under the
<system.web> node, there is no need to use the "xdt:Locator" attribute.
<customErrors defaultRedirect="GenericError.htm"
mode="RemoteOnly" xdt:Transform="Replace">
<error statusCode="500" redirect="InternalError.htm"/>
</customErrors>
-->
</system.web>
<system.serviceModel>
<client>
<endpoint address="http://productionServer/WebServices/MasterEngine/MasterEngineService.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMasterEngineService" contract="OverlayFarEnd.IMasterEngineService" name="BasicHttpBinding_IMasterEngineService" xdt:Transform="Replace" xdt:Locator="Match(name)" />
</client>
</system.serviceModel>
</configuration>
And the preview transformation compare window:
Try SetAttributes transformation:
<system.serviceModel>
<client>
<endpoint name="BasicHttpBinding_IMasterEngineService"
address="http://productionServer/WebServices/MasterEngine/MasterEngineService.svc"
binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IMasterEngineService"
contract="OverlayFarEnd.IMasterEngineService" name="BasicHttpBinding_IMasterEngineService"
xdt:Transform="SetAttributes(address)" xdt:Locator="Match(name)"/>
</client>
</system.serviceModel>
You can have comma separated values of attributes, that you need to change.
Though there are only poor examples, hope this link will be helpful.