01-23-2005, 09:00 PM
This code really works.
2010.6.16: now this service does not work.
Look here: Translate text using Google
Output:
<?xml version="1.0"?>
<soap:Envelope xmlnsoap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><TranslateResponse xmlns="http://www.webservicex.net"><TranslateResult>ein</TranslateResult></TranslateResponse></soap:Body></soap:Envelope>
2010.6.16: now this service does not work.
Look here: Translate text using Google
typelib MSXML2 {F5078F18-C551-11D3-89B9-0000F81FE221} 4.0
MSXML2.XMLHTTP a._create
str xml =
;<?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>
;;;;<Translate xmlns="http://www.webservicex.net">
;;;;;;<LanguageMode>EnglishTOGerman</LanguageMode>
;;;;;;<Text>one</Text>
;;;;</Translate>
;;</soap:Body>
;</soap:Envelope>
a.open("POST","http://www.webservicex.net/TranslateService.asmx",0)
a.setRequestHeader("Content-Type","text/xml")
a.setRequestHeader("SOAPAction" "http://www.webservicex.net/Translate")
a.send(xml)
MSXML2.DOMDocument doc=a.responseXML
out doc.xml
Output:
<?xml version="1.0"?>
<soap:Envelope xmlnsoap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><TranslateResponse xmlns="http://www.webservicex.net"><TranslateResult>ein</TranslateResult></TranslateResponse></soap:Body></soap:Envelope>