YKPN#40107 -- Ook verwijderde VC ruimten communiceren met Talk & Vision
svn path=/Website/branches/v2016.3/; revision=33415
This commit is contained in:
@@ -49,6 +49,8 @@ try {
|
||||
+'<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>'
|
||||
+' <Login xmlns="http://tempuri.org/">'
|
||||
// +' <username>kpntest</username>'
|
||||
// +' <password>waL3aejujz</password>'
|
||||
+' <username>Getronics</username>'
|
||||
+' <password>kpn456rt</password>'
|
||||
+' </Login>'
|
||||
@@ -89,7 +91,6 @@ try {
|
||||
WScript.Echo("SQL reservering = " + sql);
|
||||
var oRs_res = Oracle.Execute(sql);
|
||||
|
||||
var v_res_key_prev = -1;
|
||||
while (!oRs_res.eof)
|
||||
{
|
||||
v_reservering_key = oRs_res("res_reservering_key").Value;
|
||||
@@ -116,10 +117,8 @@ try {
|
||||
var oRs_rsv = Oracle.Execute(sql);
|
||||
|
||||
//var v_count = 0;
|
||||
var v_res_key_prev = -1;
|
||||
var v_xml_header = "";
|
||||
var v_xml_footer = "";
|
||||
var v_xml_body = "";
|
||||
var v_xml_loc = "";
|
||||
while (!oRs_rsv.eof)
|
||||
{
|
||||
@@ -138,6 +137,8 @@ try {
|
||||
|
||||
WScript.Echo("v_rsv_ruimte_key = " + v_rsv_ruimte_key);
|
||||
|
||||
// We kennen nieuwe boekingen of wijzigingen op bestaande boekingen.
|
||||
// Bij wijzigigen is er al een VC-id aanwezig.
|
||||
if (v_vc_id)
|
||||
{
|
||||
v_type = 'ModifyMeeting';
|
||||
@@ -253,7 +254,85 @@ try {
|
||||
|
||||
oRs_res.MoveNext();
|
||||
}
|
||||
}
|
||||
|
||||
// stuur cancel berichten als de afspraak in facilitor verwijderd is.
|
||||
sql = "SELECT res_reservering_key, vc_id "
|
||||
+ " FROM ykpn_v_cancel_vc ";
|
||||
WScript.Echo("SQL reservering = " + sql);
|
||||
var oRs_res = Oracle.Execute(sql);
|
||||
|
||||
while (!oRs_res.eof)
|
||||
{
|
||||
v_reservering_key = oRs_res("res_reservering_key").Value;
|
||||
v_vc_id = oRs_res("vc_id").Value;
|
||||
|
||||
XMLReq = '<?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>'
|
||||
+ ' <CancelMeeting xmlns="http://tempuri.org/">'
|
||||
+ ' <bookingid>' + v_vc_id + '</bookingid>'
|
||||
+ ' </CancelMeeting>'
|
||||
+ ' </soap:Body>'
|
||||
+ ' </soap:Envelope>';
|
||||
|
||||
var objXMLHTTP = new ActiveXObject("MSXML2.ServerXMLHTTP.6.0")
|
||||
var SXH_OPTION_SELECT_CLIENT_SSL_CERT = 3;
|
||||
var SXH_PROXY_SET_PROXY = 2;
|
||||
|
||||
if (debugFiddler)
|
||||
{
|
||||
var SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056
|
||||
objXMLHTTP.setProxy(SXH_PROXY_SET_PROXY, "127.0.0.1:8888")
|
||||
objXMLHTTP.setOption(2) = SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS
|
||||
}
|
||||
|
||||
objXMLHTTP.open("POST",
|
||||
"http://talkandvision.com//webservice/portal.asmx"
|
||||
);
|
||||
|
||||
objXMLHTTP.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
|
||||
objXMLHTTP.setRequestHeader ("SOAPAction", "http://tempuri.org/CancelMeeting");
|
||||
objXMLHTTP.setRequestHeader ("Cookie", v_cookie);
|
||||
WScript.Echo("Cookie = " + v_cookie);
|
||||
|
||||
WScript.Echo("Send XML: " + XMLReq);
|
||||
objXMLHTTP.send(XMLReq);
|
||||
WScript.Echo("XML received");
|
||||
if (objXMLHTTP.status==200)
|
||||
{
|
||||
var responseText = objXMLHTTP.responseText;
|
||||
WScript.Echo("Response.text:" + responseText);
|
||||
var xmlResp = new ActiveXObject("MSXML2.DOMDocument.6.0");
|
||||
xmlResp.setProperty("SelectionNamespaces", 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tv="http://tempuri.org/"');
|
||||
xmlResp.resolveExternals = false; // van mij hoef je geen DTD's te controleren
|
||||
xmlResp.validateOnParse = false; // van mij hoef je geen DTD's te controleren
|
||||
xmlResp.loadXML(objXMLHTTP.responseText); // for parsing
|
||||
var responseText = objXMLHTTP.responseText; // for debugging
|
||||
v_result = xmlResp.selectSingleNode("/soap:Envelope/soap:Body/tv:CancelMeetingResponse/tv:CancelMeetingResult");
|
||||
if (v_result)
|
||||
{
|
||||
WScript.Echo("Cancel result " + v_vc_id + ":" + v_result.text);
|
||||
if (v_result.text == 'true')
|
||||
{
|
||||
sql = "BEGIN ykpn.set_vc_status(" + v_reservering_key + ",''); END;";
|
||||
WScript.Echo("sql:" + sql);
|
||||
Oracle.Execute(sql);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
WScript.Echo("Request = " + XMLReq);
|
||||
var response = objXMLHTTP.responseXML;
|
||||
WScript.Echo("Response = " + response);
|
||||
WScript.Echo("Mislukt, status = " + objXMLHTTP.status);
|
||||
WScript.Echo(objXMLHTTP.statusText);
|
||||
}
|
||||
|
||||
oRs_res.MoveNext();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user