invoke webservice with xmlhttprequest
-
hi all, i have code that i believe built in delphi as follows : xml_string: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> soap:Body <upload_item xmlns="http://tempuri.org/"> <batch>int</batch> <customer_id>string</customer_id> <customer>string</customer> <city>string</city> <location>string</location> <lot_no>string</lot_no> <net>double</net> <co_no>string</co_no> <ln>string</ln> <item_no>string</item_no> <del_date>string</del_date> <do_no>string</do_no> </upload_item> </soap:Body> </soap:Envelope> XMLHTTPRequest1.open('POST','http://localhost/tmsws/service.asmx?op=upload\_item',false); XMLHTTPRequest1.setRequestHeader('Content-Type','text/xml; charset=utf-8'); XMLHTTPRequest1.Send(xml_string); XMLResult := XMLHTTPRequest1.responseText; how can i do it in asp.net? thanks and regards, edi
gain new knowledge through knowledge-sharing
-
hi all, i have code that i believe built in delphi as follows : xml_string: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> soap:Body <upload_item xmlns="http://tempuri.org/"> <batch>int</batch> <customer_id>string</customer_id> <customer>string</customer> <city>string</city> <location>string</location> <lot_no>string</lot_no> <net>double</net> <co_no>string</co_no> <ln>string</ln> <item_no>string</item_no> <del_date>string</del_date> <do_no>string</do_no> </upload_item> </soap:Body> </soap:Envelope> XMLHTTPRequest1.open('POST','http://localhost/tmsws/service.asmx?op=upload\_item',false); XMLHTTPRequest1.setRequestHeader('Content-Type','text/xml; charset=utf-8'); XMLHTTPRequest1.Send(xml_string); XMLResult := XMLHTTPRequest1.responseText; how can i do it in asp.net? thanks and regards, edi
gain new knowledge through knowledge-sharing
-
You can use WebRequest class to do the same at server end. Or create a proxy for the web service using the wsdl tool provided by .Net to achieve Stong type safety
Regards, Cybernate
hi Cybernate, thanks for your reply. but i really new in this field and just a little of web programming. could you give me link where i have to go, meanwhile i am trying to googling. shall i create a webservice to consume it webservice since the target webservice provided by another party, or just create web page to consume the webservice? thanks and regards, edi
gain new knowledge through knowledge-sharing