I'm calling a WCF Service function
[OperationContract]
ProcessInfo GetPr开发者_如何学CocessInfo(); # ProcessInfo has a DataContract Attribute.
written in C# from a IronPython Script (v2.7).
The debugger proofs that the service is called and a correct object is returned.
But in the IPy script
import clr
clr.AddReference('System.ServiceModel')
import System.ServiceModel
clr.AddReference('Company.Service.Util')
from Company.Service.Util.Diagnostics import IServiceInspector 
bind = System.ServiceModel.BasicHttpBinding()
endpoint = System.ServiceModel.EndpointAddress("http://localhost:40099/ServiceInspector")
channel = System.ServiceModel.ChannelFactory[IServiceInspector](bind, endpoint)
client = channel.CreateChannel()
pi = client.GetProcessInfo()
print "GetProcessInfo() returned:\n%s" % pi
None is received.
Both basicHttpBinding and tcpBinding have the same behaviour.
Try to run the script with debug info: ipy.exe -X:Debug -X:ExceptionDetail
Try simplier service (e.g. return string) - I guess you might need to add reference to System.Web assembly where ProcessInfo is stored.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论