0
votes

i have a web service which contains a string value into a method. Now i want to show that string to a windows form application. i know we can call methods and pass parameters to get the result from web service functions.

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???

 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.

My webservice is in XML Format. Thanks in Advance...

1
how does your winform app call the web service? you can't push things from your web service unless you use a duplex connection.Daniel A. White
So i wanted to know what should i do to get barcode into my windows form. Barcode is coming from an android application.yash
make another request?Daniel A. White
can u give me an example about that?yash
how are you making any calls presently? do something similar to thatDaniel A. White

1 Answers

0
votes

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.

Duplex services