[英]How to pass a string from web service to windows form application?
i have a web service which contains a string value into a method. 我有一个Web服务,其中包含一个方法中的字符串值。 Now i want to show that string to a windows form application.
现在,我想将该字符串显示给Windows窗体应用程序。 i know we can call methods and pass parameters to get the result from web service functions.
我知道我们可以调用方法并传递参数以从Web服务功能获取结果。
but i am not able to reverse it. 但我无法扭转它。 i only want that string into my form.
我只希望该字符串进入我的表单。 Can anybody tell me how to pass the string to my windows form from a web service???
有人可以告诉我如何从Web服务将字符串传递到我的Windows窗体吗?
public XmlDocument ScanProduct(string barcode)
{
ClsFunction fun = new ClsFunction();
XmlDocument dom = new XmlDocument();
XmlElement Reply = dom.CreateElement("Reply");
dom.AppendChild(Reply);
str1 = fun.RmvQuote(barcode);
try
{
Reply.SetAttribute("itemno", "1043");
Reply.SetAttribute("upcno", fun.RmvQuote(barcode));
Reply.SetAttribute("item_desc1", "Chio Red Paprika 12/175g");
Reply.SetAttribute("item_desc2", "CHIO RED PAPRIKA 12/175G");
}
//<Reply replycode="success" msg="You are successfully login." sid="0" />
catch (Exception ex)
{
XmlElement ReplyCode = dom.CreateElement("ReplyCode");
Reply.AppendChild(ReplyCode);
XmlText text = dom.CreateTextNode("invalid request");
ReplyCode.AppendChild(text);
XmlElement Message = dom.CreateElement("Message");
Reply.AppendChild(Message);
XmlText replymsg = dom.CreateTextNode("invalid request, or unauthorized access");
Message.AppendChild(replymsg);
}
return dom;
}
i want to print barcode in my windows form application. 我想在Windows窗体应用程序中打印条形码。
My webservice is in XML Format. 我的网络服务是XML格式。 Thanks in Advance...
提前致谢...
i think you need and web service which call the application: 我认为您需要和网络服务来调用该应用程序:
try to use Duplex service in which client act as a server and server act as a client. 尝试使用双工服务,其中客户端充当服务器,而服务器充当客户端。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.