मेरे पास डब्ल्यूसीएफ वेब सेवा और जावास्क्रिप्ट क्लाइंट है जो एसओएपी 1.2 का उपयोग करके AJAX के माध्यम से इस सेवा से जुड़ता है। मैं क्या करना चाहता हूं कि AJAX SOAP कॉल को पर केवल एक प्रॉक्सी का उपयोग करने के लिए कुछ पैरामीटर पास करना है, जैसा कि मैं इसे "एक नई प्रॉक्सी शुरू करें" अनचेक करके डब्ल्यूसीएफ टेस्ट क्लाइंट में करता हूं। एसओएपी का उपयोग करते हुए जावास्क्रिप्ट में एक प्रॉक्सी का उपयोग कैसे करें डब्ल्यूसीएफ टेस्ट क्लाइंट का उपयोग
और ये मेरे सोप AJAX कॉल है:
DoSoapAjax: function (soapMethodName, data, successHandler, errorHandler, isAsync, currentInstance) {
var service = this;
var soapResult = soapMethodName + "Result";
var soap12WithWsHttpBindRequest ='<s:Envelope xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:s="http://www.w3.org/2003/05/soap-envelope">' +
'<s:Header>' +
'<a:Action s:mustUnderstand="1">' + this.serviceContractNamespace + '/' + this.interfaceName + '/' + soapMethodName + '</a:Action>' +
'<a:MessageID>urn:uuid:605ea0c6-d09b-46bf-b61d-e61b377a135b</a:MessageID>' +
'<a:ReplyTo>' +
'<a:Address>http://www.w3.org/2005/08/addressing/anonymous</a:Address>' +
'</a:ReplyTo>' +
'<a:To s:mustUnderstand="1">' + this.tenantAdminService + '</a:To>' +
'</s:Header>' +
'<s:Body>';
if (data == emptyString)
{
soap12WithWsHttpBindRequest +=
'<' + soapMethodName + ' xmlns="' + this.serviceContractNamespace + '" />';
}
else
{
soap12WithWsHttpBindRequest +=
'<' + soapMethodName + ' xmlns="' + this.serviceContractNamespace + '">' +
data +
'</' + soapMethodName + '>';
}
soap12WithWsHttpBindRequest +=
'</s:Body>' +
'</s:Envelope>';
// in order for ajax to work on jQuery 1.8.2 we need to enable the following.
// found this answer on the link : http://stackoverflow.com/questions/9160123/no-transport-error-w-jquery-ajax-call-in-ie
$.support.cors = true;
// variable to save successData
var responseData = null;
// SOAP 1.2 query
var response = $.ajax({
type: "POST",
url: this.tenantAdminService,
data: soap12WithWsHttpBindRequest,
contentType: "application/soap+xml",
dataType: "xml",
processData: false,
async: isAsync,
success: function (data, status, xmlHttpRequest) {
responseData = data;
// inserting all data results into dictionary
var responseResults = {};
// delegating success function
if (successHandler != null)
{
responseResults = service.ParseResponse(soapMethodName, data);
successHandler(responseResults, currentInstance);
}
},
error: function (xmlHttpRequest, textStatus, errorThrown) {
if (errorHandler != null)
{
errorHandler(xmlHttpRequest, textStatus, errorThrown, currentInstance);
}
else if (!isAsync)
{
alert("Error : " + errorThrown);
alert("Error Description : " + xmlHttpRequest.responseText);
}
return;
}
});
if (!isAsync)
{
return service.ParseResponse(soapMethodName, response.responseXML);
}
}
क्या यह आपके अपने सर्वर या तृतीय पक्ष SOAP सेवा के लिए है? मैं क्रॉस साइट के मुद्दों के कारण सोच रहा हूं यदि आप क्लाइंट को वास्तव में इस फ़ंक्शन के माध्यम से तृतीय पक्ष SOAP ws पर XML भेजते हैं। मेरा मानना है कि अधिकतर ब्राउज़र आपको अपने मूल वेब पेज से जेएस के माध्यम से सीधे तीसरे पक्ष में एक्सएमएल पोस्ट करने की अनुमति नहीं देंगे। अपनी डब्ल्यूसीएफ स्क्रीन से, मैं इसे आंतरिक लेता हूं। तो ब्राउज़र क्लाइंट के बाद प्रॉक्सी द्वारा आपका क्या मतलब है? – williambq
@ विल्लियाम्बक आपकी टिप्पणी के लिए धन्यवाद। यह मेरा अपना सर्वर है।तीसरी पार्टी नहीं – liorafar
तो, मुझे लगता है कि आप जगह पर सिंगलटन प्रॉक्सी पाने की कोशिश कर रहे हैं? तो प्रत्येक अनुरोध प्रॉक्सी का एक नया उदाहरण बनाता है जब बुलाया जाता है? – williambq