none
XML-RPC endpoint behaviour in a WCF service under IIS

    Question

  • Hi

    I have created a web application using c# .net 3.5 and i have one web page talking to a wcf service in the same solution using soap. this works fine. the problem starts with the requirement that I have to expose my business rules to xml-rpc clients as well. i found this post by clemens vasters

    http://vasters.com/clemensv/PermaLink,guid,679ca50b-c907-4831-81c4-369ef7b85839.aspx

    which describes how to run a xml-rpc wcf service. i integrated that to my solution, adding a new extension with the xmlrpcendpointbehavior and now i can talk to the xml-rpc client. unfortunately all requests are chanelled through this extension though meaning that my soap clients get an error.

    to overcome that i created a new solution where i added the xmlrpc behaviour and used it as a proxy to my soap service. this way the xml-rpc clients go through the proxy and the soap clients go direct. everything works but this means that i have to maintain the proxy as well now and every time the service contract needs to change, the proxy interface has to change as well, which increases the effort - bad design.

    what i want to know is if there is another way of doing this in one wcf service by just configuring the endpoints so that the soap clients go through the soap endpoint and the xml-rpc clients through my custom xmlrpc endpoint and one does not affect the other.

    if you need any samples from my code let me know.

    the endpoint behaviour is

    <

     

    endpointBehaviors>

    <

     

    behavior name="xmlRpcEndpointBehavior">

    <

     

    xmlRpc/>

    </

     

    behavior>

    </

     

    endpointBehaviors>


    the endpoint is


    <

     

    endpoint address="xml" binding="webHttpBinding" behaviorConfiguration="xmlRpcEndpointBehavior" contract="WCFXMLRPC.ITime"/>


    and the extension is



    <

     

    extensions>

    <

     

    behaviorExtensions>

    <

     

    add name="xmlRpc" type="WCFXMLRPC.XmlRpcEndPointBehaviorElement, WCFXMLRPC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>

    </

     

    behaviorExtensions>

    </

     

    extensions>

    Tuesday, July 7, 2009 10:34 AM

Answers

  • Hi nicsyn,

    I understand the problem you encounter here is that you've applied a custom XML-RPC endpoint behavior to your webHttp endpoint to support xml-rpc communication, however, this makes those standard soap client fail.

    As for endpontBehavior, it will apply against the certain endpoint you configured to use it. WCF support adding multiple endpoints(even using the same binding and contract) in single service host. Therefore, you can consider adding another endpoint which use the standard binding without the XML-RPC behavior.




    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Monday, July 13, 2009 10:27 AM
    Moderator