tags:

views:

172

answers:

2

We have a client that has been configured to connect to an asmx service. We don't want to ask our customers to update their configuration, but we would like to upgrade our service to use WCF. Does anyone know if WCF supports this? If so, what would the configuration file look like?

Our asmx service looks like this:

<bindings>
<binding name="ATransactionSoap" 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://.../atransaction.asmx" binding="basicHttpBinding" bindingConfiguration="ATransactionSoap" contract="ATransactionSoap" name="ATransactionSoap" />
A: 

Your client won't have to change, except to change the URL of the service.

John Saunders
any way to use WCF without changing the URL of the service? That is what I am really trying to ask.
Lucas B
If you can't even change the URL, then you've got a really bad design, and you should fix that first. What if you decided to move the service to a different web server???
John Saunders
I agree with you, but it isn't so much that we can't, it is that we don't want to. Changing the URL would be an expensive operation and would mean contacting our customers, dealing with incorrectly updated URLs, etc...
Lucas B
Again, if changing the URL in a config file is a major problem, then you really should fix that. That said, if you self-host a WCF service, then I don't believe that the file extension will matter. I think you could host a WCF service at http://host/service.asmx if you wanted to.
John Saunders
+1  A: 

In response to your follow-up question:

any way to use WCF without changing the URL of the service?

Yes, you can make the old .asmx url re-direct to your .svc url. It requires configuration changes on the service side as well as a change to your .asmx file. But your existing client can continue to connect unchanged in any way. See http://kaushikrabadiya.blogspot.com/2008/11/how-to-use-asmx-extension-to-handle-wcf.html.

Helder