Try the <xsl:value-of select="$original-service-name"/> service ; e4x=1 ?stub &lang=e4x
Using endpoint
(expand to change...)
This service requires credentials:
username: password:
Warning! This service requires credentials beyond what this try-it can provide ().
xs: xs: restriction
(additional parameters)
(..*)
(xs:boolean)
(xs:boolean)
(..*)
(..*)
/* array of */ _ _ var browser = WSRequest.util._getBrowser(); // Workaround for IE, which treats ids as case insensitive, compliments of Mike Bulman. if (browser == "ie" || browser == "ie7") { document._getElementById = document.getElementById; document.getElementById = function(id) { var a = []; var o = document._getElementById(id); if (!o) return o; while (o && o.id != id) { a.push({i:o.id,e:o}); o.id=''; o = document._getElementById(id); } for (j=0,jj=a.length; j<jj; j++) a[j].e.id = a[j].i; a = null; return o; } } /* * do_ : collect form data into parameters and call the '' operation asynchronously. */ function do_(preview) { // First clear the log. if (!preview) clearlog("console_"); // set credentials .username = document.getElementById("username").value; .password = document.getElementById("password").value; input__additionalParameters input___0 // turn the '' form item into a parameter var paramInput = document.getElementById(''); var param_ = paramInput.value param_ = new Array(); var arrayDiv = document.getElementById('arrayparams__'); var arrayLength = arrayDiv.getElementsByTagName("div").length; var arrayItem; // iterate through each div representing an item in the array. for (var i=1; i<arrayLength; i++) { arrayItems = arrayDiv.getElementsByTagName("div").item(i).getElementsByTagName("*"); var param_ = param_.concat(arrayItems.item(0).checked ? true : false); if (arrayItems.item(1).className != 'emptyfield') { var param_ = param_.concat({ "uri" : (arrayItems.item(0).value.indexOf('(') >= 0 ? null : arrayItems.item(0).value), "localName" : arrayItems.item(1).value }); } if (arrayItems.item(0).className != 'emptyfield') var param_ = param_.concat(arrayItems.item(0).value); } if (paramInput.className!='emptyfield') { var param__ns = document.getElementById('input___ns_0').value; var param_ = { "uri" : (param__ns.indexOf('(') >= 0 ? null : param__ns), "localName" : paramInput.value }; } else { var param_ = null; } var param_ = null; if (paramInput.className!='emptyfield') param_ = paramInput.value var param_ = (paramInput.checked ? "true" : "false"); param_ = paramInput.className=='emptyfield' ? "" : paramInput.value; if (preview) { return ._payload(param_ , ); } else { // set up a callback function to log the result . .callback = function (payload) { log ("console_", payload); }; // set up an error callback function to log errors . .onError = function (error) { log ("console_", "Fault: " + error.reason, error.detail); }; // Invoke the operation/method. Since there is a callback defined, the call is asynchronous. . (param_ , ); } } /* * log : Serialize the result of an operation (successful or not) into a specified log div. * * consoleid: the id of an element into which the data should be placed. * data: the data (can be of any type) to display. * detail: fault detail information if available separately from the data. */ function log(consoleid, data, detail) { var console = document.getElementById(consoleid); // Type could be dynamically determined - run a smart serializer on it. console.innerHTML = serializeAnything(data); // If there's a separate fault detail, add it into the log (hidden, with a link to make // it visible on request.) if (detail != null) console.innerHTML += "\n<a class='showDetail' href='#' onclick='this.style.display=\"none\";this.parentNode.lastChild.style.display=\"block\"'>[detail]</a>\n<div class='faultDetail'>" + serializeAnything(detail) + "</div>"; } /* * clearlog : indicate that an asynchronous operation is in progress. * * consoleid: the id of an element into which the data should be placed. */ function clearlog(consoleid) { var console = document.getElementById(consoleid); console.innerHTML = "<img src='wso2pulse.gif' alt='invoking operation' title='Invoking service...' style='position:relative; top:-8px;'/>"; } /* * serializeAnyting : serialize simple types, XML, or arrays and objects * * data: data to serialize - can be of any type. * partOfList: a flag indicating whether this is a top-level invocation or a recursive one. * used for determining whether to quote strings and keep XML un-pretty printed * when serializing arrays and objects. */ function serializeAnything (data, partOfList) { var output = ""; if (data == null) { // not friendly just to output nothing - insert a visible marker representing a null return. output += "(null)"; } else if (typeof(data) == "string") { if (partOfList) { output += '"' + ._encodeXML(data) + '"'; } else { output += ._encodeXML(data); } } else if (typeof(data) == "xml") { output += serializeXML (payload, partOfList); } else if (typeof(data) == "xmlList") { for each (var item in data) { output += serializeXML (item, partOfList); } } else if (typeof(data) == "object") { if (Array.prototype.isPrototypeOf(data)) { // this "object" is really an "array" in disguise output += serializeArray(data); } else if (Date.prototype.isPrototypeOf(data)) { // this "object" is really a "date" in disguise output += data; } else if (data.nodeType != undefined) { // this "object" is really a DOM node in disguise output += serializeXML (data, partOfList); } else if (data.length != undefined && data.item(0) != undefined) { // this "object" is really a DOM node list in disguise for (var i=0; i<data.length; i++) { output += serializeXML (data.item(i), partOfList); } } else { // must be a generic object then... output += serializeObject(data); } } else { output += ._encodeXML(data); } return output; } /* * serializeXML : serialize XML in pretty-print mode * * xml: xml to serialize. */ function serializeXML (doc, plain) { var output; if (plain) { output = ._encodeXML(WSRequest.util._serializeToString(doc)); } else { if ((browser == "ie" || browser == "ie7") && xsltready) { output = doc.transformNode(formatxml); } else if (browser == "gecko" && xsltready) { var oProcessor = new XSLTProcessor(); oProcessor.importStylesheet(formatxml); output = WSRequest.util._serializeToString(oProcessor.transformToDocument(doc)); } else { output = ._encodeXML(WSRequest.util._serializeToString(doc)); } } return output; } formatxml = null; xsltready = false; /* * serializeObject : serialize objects in JSON-like notation * * obj: object to serialize. */ function preloadFormatxml () { if (browser == 'ie' || browser == 'ie7') { try { formatxml = new ActiveXObject("Microsoft.XMLDOM"); formatxml.async = true; formatxml.onreadystatechange = function () { if (formatxml.readyState == 4) { xsltready = true; } }; formatxml.load(''); } catch (e) {} } else if (browser == 'gecko') { try { formatxml = document.implementation.createDocument("", "", null); formatxml.onload = function () { xsltready = true; }; formatxml.load(""); } catch (e) {} } } /* * serializeObject : serialize objects in JSON-like notation * * obj: object to serialize. */ function serializeObject (obj) { var output = "{"; for (var i in obj) { if (output != '{') output += ", "; output += i + " : " + serializeAnything(obj[i], true); } output += "}"; return output; } /* * serializeArray : serialize arrays as comma-separated lists. Can't just use existing * JS functions since the array might contain xml, objects, or something * else requiring recursive treatment. * * arr: array to serialize. */ function serializeArray (arr) { var output = ""; for (var i in arr) { if (i != 0) output += ","; output += serializeAnything(arr[i]); } return output; } /* * prepareInput : A user is about to type into an empty parameter field. Clear out * the type hint. * * e: event triggering this call. */ function prepareInput(e) { var thisInput = sourceElement(e); if (thisInput.className == "emptyfield") { thisInput.value = ""; thisInput.className = "nonemptyfield"; } } /* * restoreInput : A user has finished typing into an empty parameter field. If he * left it empty, restore the type hint. * * e: event triggering this call. * hint: value of the type hint text */ function restoreInput(e, hint) { var thisInput = sourceElement(e); if (thisInput.value == "") { thisInput.value = hint; thisInput.className = "emptyfield"; } } /* * expand : Expand or contract the size of a parameter textarea. * * e: event triggering this call. */ function expand(e) { thisExpando = sourceElement(e); thisInput = thisExpando.parentNode.getElementsByTagName("*").item(0); if (thisExpando.className == "cornerExpand") { // increase the height and width of the textarea, and change the icon to "collapse". thisInput.style.width = "80%"; thisInput.style.height = "6em"; thisExpando.className = "cornerCollapse"; thisExpando.title = "Reduce typing space"; thisExpando.src = "collapse.gif"; } else { // decrease the height and width of the textarea, and change the icon to "expand". thisInput.style.width = ""; thisInput.style.height = "1.7em"; thisExpando.className = "cornerExpand"; thisExpando.title = "Increase typing space"; thisExpando.src = "expand.gif"; } } /* * toggleconfig : Generic function toggling a display between two elements. * * toHide: id of the element to hide * toShow: id of the element to show */ function toggleconfig(toHide, toShow) { document.getElementById(toHide).style.display = "none"; document.getElementById(toShow).style.display = "block"; // bug fix for relative items that might not update correctly. if (browser == "ie" || browser == "ie7") { selectOperation(); } } /* * addArrayItem : User wants an additional input field to accomodate array values * * e: event triggering this call. */ function addArrayItem(e) { // find the div grouping the array items together var arrayDiv = sourceElement(e).parentNode.getElementsByTagName("div").item(0); // find the element representing the last item var lastIndex = arrayDiv.getElementsByTagName("div").length - 1; // the first item [0] in an array is a hidden template for new items, clone it, // add it to the end, make it visible, and give it a unique identifier. var newItem = arrayDiv.getElementsByTagName("div").item(0).cloneNode(true); newItem.style.display = "block"; newItem.getElementsByTagName("*").item(0).id += lastIndex; arrayDiv.appendChild(newItem); // since we just added one, there must be more than one now, so enable the "remove" button. sourceElement(e).parentNode.lastChild.disabled = false; } /* * removeArrayItem : User wants to delete an input field from his array values * * e: event triggering this call. */ function removeArrayItem(e) { // find the div grouping the array items together var arrayDiv = sourceElement(e).parentNode.getElementsByTagName("div").item(0); // find the element representing the last item, and delete it. var lastIndex = arrayDiv.getElementsByTagName("div").length - 1; arrayDiv.removeChild(arrayDiv.getElementsByTagName("div").item(lastIndex)); // if we're down to a single textarea, disable the "remove" button. if (lastIndex <= 2) { sourceElement(e).disabled = true; } showRestTemplate(); } /* * sourceElement: Cross-browser function for determining the source element of * an event. * * e: event triggering this call. */ function sourceElement(e) { if (browser == "ie" || browser == "ie7") { return window.event.srcElement; } else { var node = e.target; while(node.nodeType != 1) node = node.parentNode; return node; } } /* * selectOperation : Present one of the operations to the user as a form. * * op: name of the operation to present. If omitted, refresh the last selected operation. */ var currentOperationName = ""; var currentOperation = ""; var currentOperationLabel = ""; function selectOperation(op) { // hide the currently presented operation, skipping it if this is the first time. if (currentOperation != "") { currentOperation.style.display = "none"; currentOperationLabel.className = "operation"; } // save the current operation name for automatic cleanup if (op == null) op = currentOperationName; else currentOperationName = op; // show the requested operation currentOperation = document.getElementById("params_" + op); currentOperation.style.display = "block"; // change the style of the operation tab currentOperationLabel = document.getElementById("operation_" + op); currentOperationLabel.className = "operation-selected"; showRestTemplate(); } function showRestTemplate() { var details = ._endpointDetails[.endpoint]; var restTemplateDiv = document.getElementById("resturl_" + currentOperationName); if (details.type == 'HTTP') { var options = ._setOptions(details, currentOperationName); if ((options["HTTPMethod"] == null || options["HTTPMethod"] == 'GET') && details.fitsInURLParams[currentOperationName]) { var payload = eval("do_" + currentOperationName + "(true)"); var restURL = WSRequest.util._buildHTTPpayload(options, details.address, payload)["url"]; restTemplateDiv.innerHTML = "Note: This operation is also available via HTTP GET at: <a href='" + restURL + "'>" + restURL + "</a>."; restTemplateDiv.style.display = "block"; } else { restTemplateDiv.style.display = "none"; } } else { restTemplateDiv.style.display = "none"; } } /* * fixEndpoints : cross-domain sharing violations may occur if the WSDL contains fixed IPs * but "localhost" is used to fetch the try-it page. The common case is where * the fixed IP actually is equivalent to localhost or 127.0.0.1 but XSS isn't * smart enough to determine this. This function (1) removes * endpoints that aren't reachable from this tryit (namely https vs http), * (2) generates a link a tryit page from which those endpoints can be invoked, * and (3) rewrites the domain (excluding port) of the endpoints to match the * page domain. */ function fixEndpoints() { var pageUrl = document.URL; var pageScheme = WebService.utils.scheme(pageUrl); var linkFixed = false; // only attempt fixup if we're from an http/https domain ('file:' works fine on IE without fixup) if (pageScheme == "http" || pageScheme == "https") { var pageDomain = WebService.utils.domain(pageUrl); var endpointName = document.getElementById("endpointSelect"); // start at the end and count down so we don't mess up indices as we delete options for (i=endpointName.options.length - 1; i>=0; i--) { var endpointAddress = .getAddress(endpointName.options[i].value); var endpointScheme = WebService.utils.scheme(endpointAddress); if ((endpointScheme == 'http' || endpointScheme == 'https') && endpointScheme != pageScheme) { // schemes don't match; if we haven't already added a link to the other // try-it, add it now. if (!linkFixed) { var link = document.getElementById("alternate-tryit"); link.innerHTML = (pageScheme == "http" ? "https" : "http"); link.href = pageUrl.replace(WebService.utils.scheme(pageUrl), WebService.utils.scheme(endpointAddress)).replace(WebService.utils.domain(pageUrl), WebService.utils.domain(endpointAddress)); linkFixed = true; } // and remove access to this endpoint from this page. endpointName.removeChild(endpointName.options[i]); } } } // If we didn't detect the necessity to present an alternate tryit link, remove it from view. if (!linkFixed) document.getElementById("alternate-bullet").style.display = "none"; // alternate try-it has been disabled for this service (e.g. not a WSO2 service) document.getElementById("alternate-bullet").style.display = "none"; } /* * selectEndpoint : When the user chooses a binding, tell the stub that's what we'll use for * future invocations. Also display the endpoint address associated * with that binding in the address textarea. */ function selectEndpoint() { var endpointName = document.getElementById("endpointSelect"); var endpoint = endpointName.options[endpointName.selectedIndex].value; .endpoint = endpoint; document.getElementById("endpoint-name").innerHTML = endpoint; document.getElementById("address").value = .getAddress(endpoint); addressChange(); showRestTemplate(); } /* * addressChange : When the user edits the address manually, tell the stub this new value * is now to be associated with the currently selected binding. */ function addressChange() { var endpoint = .endpoint; newEndpointAddress = document.getElementById("address").value; if (newEndpointAddress != null) { .setAddress(endpoint, newEndpointAddress); var xss = newEndpointAddress.substring(0,newEndpointAddress.indexOf("/", 8)) != document.URL.substring(0,document.URL.indexOf("/", 8)); document.getElementById("xssWarning").style.display = xss ? "inline" : "none"; showRestTemplate(); } }