GoodBoyNYC
GoodBoyNYC

Reputation: 159

Exposing WCF service for ASMX clients

I have a WCF service that plays nicely with WCF clients but the most crucial of clients I need it to work with is an ASMX client. How could I make my WCF service compatible with ASMX clients?

I've followed this guide but to no avail(albeit I'm know 100% sure I have implemented it correctly)

Below is my ServiceContract and OperationContracts. My Web.config has no MEX endpoints.

  <ServiceContract()>
<XmlSerializerFormat(Use:=OperationFormatUse.Literal, Style:=OperationFormatStyle.Document)>
Public Interface racoSMS
    <OperationContract(Action:="http://tempuri.org/ReceiveSMS", ReplyAction:="http://tempuri.org/ReceiveSMS")>
    Function ReceiveSMS(ByVal securityKey As String, ByVal from As String, ByVal message As String) As ServiceResult
    <OperationContract(Action:="http://tempuri.org/Test", ReplyAction:="http://tempuri.org/Test")>
    Function Test(ByVal securityKey As String) As ServiceResult
End Interface

Upvotes: 1

Views: 622

Answers (1)

Jeroen
Jeroen

Reputation: 63709

Your question is quite vague. A few things to note:

  • Yes, you can use WCF to create a service that's compatible with ASMX-style web services.
  • Use of BasicHttpBinding is highly recommended.
  • Transport security (SSL) should be possible, but other than that be wary of fancy features (e.g. I don't think ASMX's support message security, for one).
  • Pay attention to the namespace of your Data- and Service Contract, make sure it's what the ASMX side expects (or be prepared to change code on that side). Same with the Action and ReplyAction (I can see from your sample code you've taken care of that).
  • What serialization type and SOAP style you need can indeed depend on what the client is expecting, use attributes accordingly.
  • I've heard of Web Service Enhancements to etend the ASMX end with some capabilities, but haven't used it myself.

As it is, I guess this is pretty much an answer to your question. You said that you did all this "to no avail", but you'll need to be more specific (either here, or possibly even in new question(s)) for us to help you.

Upvotes: 1

Related Questions