我有一个用C#创建的Web服务。它看起来如下:
import sys
from PyQt5.QtWidgets import *
from PyQt5 import uic
WCCMainWindow_Form_Class = uic.loadUiType("WCCMainWindows.ui")[0]
Form_DS_Form_Class = uic.loadUiType("Form_DS.ui")[0]
class WCCMainWindow(QMainWindow, WCCMainWindow_Form_Class):
def __init__(self):
super().__init__()
self.setupUi(self)
self.mdi = QMdiArea()
self.setCentralWidget(self.mdi)
self.Action_IGroup.triggered.connect(self.subWinIGroup)
def subWinIGroup(self):
sub = DSSubWindow(self)
self.mdi.addSubWindow(sub)
sub.show()
if __name__ == "__main__":
app = QApplication(sys.argv)
wccMainWindow = WCCMainWindow()
wccMainWindow.show()
app.exec_()
class DSSubWindow(QWidget, Form_DemandSupply_Form_Class):
def __init__(self):
super().__init__()
self.setupUi(self)
我有一个控制台应用程序,可以调用服务并创建对象,然后将其发送到服务。
namespace MyNamespace
{
public class MyService : IMyService
{
public InitializeResponse InitialiseConnection(InitializeRequest request)
{
InitializeConnectionLogic initializeConnectionLogic = new InitializeConnectionLogic();
return initializeConnectionLogic.CreateConnection(request.Map()).Map();
}
}
}
现在,我想做同样的事情,但是将对象作为JSON发送。 那有可能吗,如果可以,我该怎么做呢?