// Example stubs for TempRetriever operations. This function is not intended
// to be called, but rather as a source for copy-and-paste development.
// Note that this stub has been generated for use in DOM environments.
function stubs() {
// callMyService operation
try {
/* string */
var callMyServiceReturn = TempRetriever.callMyService(/* string */ param_input);
} catch (e) {
// fault handling
}
}
stubs.visible = false;
var TempRetriever = new WebService("TempRetrieverSOAP12Endpoint");
TempRetriever.callMyService =
function callMyService(/* string */ _input)
{
var isAsync, request, response, resultValue;
this._options = new Array();
isAsync = (this.callMyService.callback != null && typeof(this.callMyService.callback) == 'function');
request = this.callMyService_payload(/* string */ _input);
if (isAsync) {
try {
this._call(
"callMyService",
request,
function(thisRequest, callbacks) {
if (thisRequest.error != null) {
callbacks[1](thisRequest.error);
} else {
response = thisRequest.responseXML;
if (response == null) {
resultValue = null;
} else {
var extractedValue = WSRequest.util._stringValue(response.documentElement);
resultValue = /* string */ extractedValue;
}
callbacks[0](resultValue);
}
},
new Array(this.callMyService.callback, this.callMyService.onError)
);
} catch (e) {
var error;
if (WebServiceError.prototype.isPrototypeOf(e)) {
error = e;
} else if (typeof(e) == "string") {
error = new WebServiceError(e, "Internal Error");
} else {
error = new WebServiceError(e.description, e.number, e.number);
}
this.callMyService.onError(error);
}
} else {
try {
response = this._call("callMyService", request);
var extractedValue = WSRequest.util._stringValue(response.documentElement);
resultValue = /* string */ extractedValue;
return resultValue;
} catch (e) {
if (typeof(e) == "string") throw(e);
if (e.message) throw(e.message);
throw (e.reason + e.detail);
}
}
return null; // Suppress warnings when there is no return.
}
TempRetriever.callMyService_payload =
function (/* string */ _input) {
return '' +
(_input == null ? '' : '' + this._encodeXML(_input) + '') +
'' ;
}
TempRetriever.callMyService_payload.visible = false;
TempRetriever.callMyService.callback = null;
// WebService object.
function WebService(endpointName)
{
this.readyState = 0;
this.onreadystatechange = null;
//public accessors for manually intervening in setting the address (e.g. supporting tcpmon)
this.getAddress = function (endpointName)
{
return this._endpointDetails[endpointName].address;
}
this.setAddress = function (endpointName, address)
{
this._endpointDetails[endpointName].address = address;
}
// private helper functions
this._getWSRequest = function()
{
var wsrequest;
try {
wsrequest = new WSRequest();
} catch(e) {
try {
wsrequest = new ActiveXObject("WSRequest");
} catch(e) {
try {
wsrequest = new SOAPHttpRequest();
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
} catch (e) {
throw new WebServiceError("WSRequest object not defined.", "WebService._getWSRequest() cannot instantiate WSRequest object.");
}
}
}
return wsrequest;
}
this._endpointDetails =
{
"TempRetrieverSOAP12Endpoint": {
"type" : "SOAP12",
"address" : "http://zneta:7762/services/kshaikh/TempRetriever",
"action" : {
"callMyService" : "http://services.mashup.wso2.org/TempRetriever/ServiceInterface/callMyServiceRequest"
},
"soapaction" : {
"callMyService" : "http://services.mashup.wso2.org/TempRetriever/ServiceInterface/callMyServiceRequest"
},
"httplocation" : {
"callMyService" : "TempRetriever/callMyService"
}
},
"SecureTempRetrieverSOAP12Endpoint": {
"type" : "SOAP12",
"address" : "https://zneta:7443/services/kshaikh/TempRetriever",
"action" : {
"callMyService" : "http://services.mashup.wso2.org/TempRetriever/ServiceInterface/callMyServiceRequest"
},
"soapaction" : {
"callMyService" : "http://services.mashup.wso2.org/TempRetriever/ServiceInterface/callMyServiceRequest"
},
"httplocation" : {
"callMyService" : "TempRetriever/callMyService"
}
},
"TempRetrieverSOAP11Endpoint": {
"type" : "SOAP11",
"address" : "http://zneta:7762/services/kshaikh/TempRetriever",
"action" : {
"callMyService" : "http://services.mashup.wso2.org/TempRetriever/ServiceInterface/callMyServiceRequest"
},
"soapaction" : {
"callMyService" : "http://services.mashup.wso2.org/TempRetriever/ServiceInterface/callMyServiceRequest"
},
"httplocation" : {
"callMyService" : "TempRetriever/callMyService"
}
},
"SecureTempRetrieverSOAP11Endpoint": {
"type" : "SOAP11",
"address" : "https://zneta:7443/services/kshaikh/TempRetriever",
"action" : {
"callMyService" : "http://services.mashup.wso2.org/TempRetriever/ServiceInterface/callMyServiceRequest"
},
"soapaction" : {
"callMyService" : "http://services.mashup.wso2.org/TempRetriever/ServiceInterface/callMyServiceRequest"
},
"httplocation" : {
"callMyService" : "TempRetriever/callMyService"
}
},
"TempRetrieverHTTPEndpoint": {
"type" : "HTTP",
"address" : "http://zneta:7762/services/kshaikh/TempRetriever",
"httplocation" : {
"callMyService" : "TempRetriever/callMyService"
},
"httpmethod" : {
"callMyService" : "POST"
},
"fitsInURLParams" : {
"callMyService" : true
}
},
"SecureTempRetrieverHTTPEndpoint": {
"type" : "HTTP",
"address" : "https://zneta:7443/services/kshaikh/TempRetriever",
"httplocation" : {
"callMyService" : "TempRetriever/callMyService"
},
"httpmethod" : {
"callMyService" : "POST"
},
"fitsInURLParams" : {
"callMyService" : true
}
}
};
this.endpoint = endpointName;
this._encodeXML = function (value) {
var str = value.toString();
str = str.replace(/&/g, "&");
str = str.replace(/= 48 && buffer.charCodeAt(p) <= 57) p++;
} else {
millisecond = 0;
}
} else {
hour = 0;
minute = 0;
second = 0;
millisecond = 0;
}
var tzhour = 0;
var tzminute = 0;
// parse time zone
if (buffer.charAt(p) != 'Z' && buffer.charAt(p) != '') {
var sign = (buffer.charAt(p) == '-' ? -1 : +1);
p++;
tzhour = sign * buffer.substr(p,2);
p += 3;
tzminute = sign * buffer.substr(p,2);
}
var thisDate = new Date();
thisDate.setUTCFullYear(year);
thisDate.setUTCMonth(month-1);
thisDate.setUTCDate(day);
thisDate.setUTCHours(hour);
thisDate.setUTCMinutes(minute);
thisDate.setUTCSeconds(second);
thisDate.setUTCMilliseconds(millisecond);
thisDate.setUTCHours(thisDate.getUTCHours() - tzhour);
thisDate.setUTCMinutes(thisDate.getUTCMinutes() - tzminute);
return thisDate;
},
_nextPrefixNumber : 0,
_QNameNamespaceDecl : function (qn) {
if (qn.uri == null) return "";
var prefix = qn.localName.substring(0, qn.localName.indexOf(":"));
if (prefix == "") {
prefix = "n" + ++this.utils._nextPrefixNumber;
}
return ' xmlns:' + prefix + '="' + qn.uri + '"';
},
_QNameValue : function(qn) {
if (qn.uri == null) return qn.localName;
var prefix, localName;
if (qn.localName.indexOf(":") >= 0) {
prefix = qn.localName.substring(0, qn.localName.indexOf(":"));
localName = qn.localName.substring(qn.localName.indexOf(":")+1);
} else {
prefix = "n" + this.utils._nextPrefixNumber;
localName = qn.localName;
}
return prefix + ":" + localName;
},
scheme : function (url) {
var s = url.substring(0, url.indexOf(':'));
return s;
},
domain : function (url) {
var d = url.substring(url.indexOf('://') + 3, url.indexOf('/',url.indexOf('://')+3));
return d;
},
domainNoPort : function (url) {
var d = this.domain(url);
if (d.indexOf(":") >= 0)
d = d.substring(0, d.indexOf(':'));
return d;
}
};
// library function for dynamically serializing an anyType value in xml, including setting xsi:type.
function serializeAnytype(name, value, namespace) {
var type = "xs:string";
if (value == null) {
value = "";
} else if (typeof(value) == "number") {
type = "xs:double";
} else if (typeof(value) == "object" && value.nodeType != undefined) {
type = "xs:anyType";
value = serializeXML(value);
} else if (typeof(value) == "boolean") {
type = "xs:boolean";
} else if (typeof(value) == "object" && Date.prototype.isPrototypeOf(value)) {
type = "xs:dateTime";
value = WebService.utils.toXSdateTime(value);
} else if (value.match(/^\s*true\s*$/g) != null) {
type = "xs:boolean";
} else if (value.match(/^\s*false\s*$/g) != null) {
type = "xs:boolean";
} else if (!isNaN(Date.parse(value))) {
type = "xs:dateTime";
value = WebService.utils.toXSdateTime(new Date(Date.parse(value)));
} else if (value.match(/^\s*\-?\d*\-\d\d\-\d\dZ?\s*$/g) != null) {
type = "xs:date";
} else if (value.match(/^\s*\-?\d*\-\d\d\-\d\d[\+\-]\d\d:\d\d\s*$/g) != null) {
type = "xs:date";
} else if (value.match(/^\s*\d\d:\d\d:\d\d\.?\d*Z?\s*$/g) != null) {
type = "xs:time";
} else if (value.match(/^\s*\d\d:\d\d:\d\d\.?\d*[\+\-]\d\d:\d\d\s*$/g) != null) {
type = "xs:time";
} else if (value.match(/^\s*\-?\d*\-\d\d\-\d\dT\d\d:\d\d:\d\d\.?\d*Z?\s*$/g) != null) {
type = "xs:dateTime";
} else if (value.match(/^\s*\-?\d*\-\d\d\-\d\dT\d\d:\d\d:\d\d\.?\d*[\+\-]\d\d:\d\d\s*$/g) != null) {
type = "xs:dateTime";
} else if (value.match(/^\s*\d\d*\.?\d*\s*$/g) != null) {
type = "xs:double";
} else if (value.match(/^\s*\d*\.?\d\d*\s*$/g) != null) {
type = "xs:double";
} else if (value.match(/^\s*\";
var endtag = "" + name + ">";
return starttag + value + endtag;
}
serializeAnytype.visible = false;
// library function for dynamically converting an element with js:type annotation to a Javascript type.
function convertJSType(element, isWrapped) {
if (element == null) return "";
var extractedValue = WSRequest.util._stringValue(element);
var resultValue, i;
var type = element.getAttribute("js:type");
if (type == null) {
type = "xml";
} else {
type = type.toString();
}
switch (type) {
case "string":
return extractedValue;
break;
case "number":
return parseFloat(extractedValue);
break;
case "boolean":
return extractedValue == "true" || extractedValue == "1";
break;
case "date":
return WebService.utils.parseXSdateTime(extractedValue);
break;
case "array":
resultValue = new Array();
for (i=0; i