I'm developing a WCF service which should work with two clients: one is a native .Net client through netTcp binding, and ne written on Python.
I need to implement duplex communication between WCF service and native .Net client but it is not necessary for Python client.
I'm trying to implement one service contract for both. Just to keep things easier for me. Because it is duplex service I'm forced to use wsDualHttpBinding to communicate with Python.
On Python side I'm using Zeep library for consuming WCF service.
My service starts up, work with native .Net client. Zeep also can see it`s contract, and call one of it methods. Simple method Ping, which returns string "Pong".
The problem is that .Net client receives "Pong", but Python client always receive null.
I've googled about a little bit and I suppose that the problem is in kind of encoding between WCF service and Python. But i`ve got no idea how configure WCF service or Python Zeep client so they will communicate properly.
WCF service config:
<system.serviceModel>
<services>
<service name="NewAsterService.NewAsterService" behaviorConfiguration ="servicebehavior">
<endpoint address="NewAsterServiceDualHttp" binding="wsDualHttpBinding" contract="NewAsterService.INewAsterService">
</endpoint>
<endpoint address="NewAsterServiceTcp" binding="netTcpBinding" contract="NewAsterService.INewAsterService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://192.168.111.101:10001/" />
<add baseAddress="net.tcp://192.168.111.101:10002" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="servicebehavior">
<!-- To avoid disclosing metadata information, set the values below to false before deployment -->
<serviceMetadata httpGetEnabled="True" httpsGetEnabled="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="True" />
</behavior>
</serviceBehaviors>
<endpointBehaviors>
<behavior name="restBehavior">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
</system.serviceModel>
WCF service contract
[ServiceContract(CallbackContract = typeof(INewAsterServiceCallbacks))]
public interface INewAsterService //: INewAsterServiceHttpOnly
{
[OperationContract]
string Ping();
}
Python script:
import zeep
from zeep import Client, Settings
wsdl_url = "http://192.168.111.34:10001/?WSDL"
settings = Settings(xml_huge_tree=True)
client = Client(wsdl=wsdl_url, settings=settings, )
result = client.service.Ping()
I've tried different variants of attributes in WCF contract: WebGet, WebInvoke, etc. No luck.
Does anyone have any idea how to set this things up?