PDA

View Full Version : [1.0] SoapPackage (client, connection, proxy & reader)



tarini
7 Jan 2008, 5:07 AM
Hi guys,
this is my first post in this ext forum.

i'm going to share with you a ext extension to connecting and retrieve data from a WebService.

I attach 4 file:
- SoapClient.js (a modified version of this script http://www.codeplex.com/JavaScriptSoapClient - thanks to author: Matteo Casati - http://www.guru4.net/)
- Ext.data.SoapConnection.js (an extension of Ext.data.Connection that use Ext.data.SoapClient to create a connection to a WebService)
- Ext.data.SoapProxy (an extension of Ext.data.DataProxy that implements a proxy for using SoapConnection)
- Ext.data.SoapReader (en extension of Ext.data.DataReader that convert data in an object undestandable for Ext.data.Store)

The code isn't commented :( but I think that is self-explained \:D/

Server-sidely I use JEE and CXF framework for generating wrapped WebService from Java method.


Comments, questions, critics and bug-fixes are accepted

PS sorry for my english


SoapClient


function SOAPClientParameters()
{
var _pl = new Array();
this.add = function(name, value)
{
_pl[name] = value;
return this;
}
this.toXml = function(ns)
{
var xml = "";
for(var p in _pl)
{
switch(typeof(_pl[p]))
{
case "string":
case "number":
case "boolean":
case "object":
xml += "<ns1:" + p + ">" + SOAPClientParameters._serialize(_pl[p], ns) + "</ns1:" + p + ">";
break;
default:
break;
}
}
return xml;
}
}
SOAPClientParameters._serialize = function(o, ns)
{
var s = "";
switch(typeof(o))
{
case "string":
s += o.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"); break;
case "number":
case "boolean":
s += o.toString(); break;
case "object":
// Date
if(o.constructor.toString().indexOf("function Date()") > -1)
{

var year = o.getFullYear().toString();
var month = (o.getMonth() + 1).toString(); month = (month.length == 1) ? "0" + month : month;
var date = o.getDate().toString(); date = (date.length == 1) ? "0" + date : date;
var hours = o.getHours().toString(); hours = (hours.length == 1) ? "0" + hours : hours;
var minutes = o.getMinutes().toString(); minutes = (minutes.length == 1) ? "0" + minutes : minutes;
var seconds = o.getSeconds().toString(); seconds = (seconds.length == 1) ? "0" + seconds : seconds;
var milliseconds = o.getMilliseconds().toString();
var tzminutes = Math.abs(o.getTimezoneOffset());
var tzhours = 0;
while(tzminutes >= 60)
{
tzhours++;
tzminutes -= 60;
}
tzminutes = (tzminutes.toString().length == 1) ? "0" + tzminutes.toString() : tzminutes.toString();
tzhours = (tzhours.toString().length == 1) ? "0" + tzhours.toString() : tzhours.toString();
var timezone = ((o.getTimezoneOffset() < 0) ? "+" : "-") + tzhours + ":" + tzminutes;
s += year + "-" + month + "-" + date + "T" + hours + ":" + minutes + ":" + seconds + "." + milliseconds + timezone;
}
// Array
else if(o.constructor.toString().indexOf("function Array()") > -1)
{
for(var p in o)
{
if(!isNaN(p)) // linear array
{
(/function\s+(\w*)\s*\(/ig).exec(o[p].constructor.toString());
var type = RegExp.$1;
switch(type)
{
case "":
type = typeof(o[p]);
case "String":
type = "string"; break;
case "Number":
type = "int"; break;
case "Boolean":
type = "bool"; break;
case "Date":
type = "DateTime"; break;
}
s += "<ns2:" + type + " xmlns:ns2=\""+ns+"\">" + SOAPClientParameters._serialize(o[p], ns) + "</ns2:" + type + ">"
}
else // associative array
s += "<ns2:" + p + " xmlns:ns2=\""+ns+"\">" + SOAPClientParameters._serialize(o[p], ns) + "</ns2:" + p + ">"
}
}
// Object or custom function
else
for(var p in o)
s += "<ns2:" + p + " xmlns:ns2=\""+ns+"\">" + SOAPClientParameters._serialize(o[p], ns) + "</ns2:" + p + ">";
break;
default:
break; // throw new Error(500, "SOAPClientParameters: type '" + typeof(o) + "' is not supported");
}
return s;
}


function SoapClient(url, method, parameters, async, callback, scope, arg) {
this.url = url;
this.method = method;
this.parameters = parameters;
this.async = async;
this.callback = callback;
this.scope = scope || this;
this.arg = arg || null;
}

SoapClient._cacheWsdl = new Array(); //static

SoapClient.prototype.invoke = function() {
if(this.async)
this._loadWsdl();
else
return this._loadWsdl();
}

SoapClient.prototype._loadWsdl = function() {
// load from cache?
var wsdl = SoapClient._cacheWsdl[this.url];
if(wsdl + "" != "" && wsdl + "" != "undefined") {
this.wsdl = wsdl;
return this._sendSoapRequest();
}
// get wsdl
var xmlHttp = SoapClient._getXmlHttp();
xmlHttp.open("GET", this.url + "?wsdl", this.async);
if(this.async) {
var that = this;
xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState == 4)
that._onLoadWsdl(xmlHttp);
}
}
xmlHttp.send(null);
if (!this.async)
return this._onLoadWsdl(xmlHttp);
}

SoapClient.prototype._onLoadWsdl = function(req) {
var wsdl = req.responseXML;
this.wsdl = wsdl;
SoapClient._cacheWsdl[this.url] = wsdl; // save a copy in cache
return this._sendSoapRequest();
}

SoapClient.prototype._sendSoapRequest = function() {
var wsdl = this.wsdl;
// get namespace
var ns = (wsdl.documentElement.attributes["targetNamespace"] + "" == "undefined") ? wsdl.documentElement.attributes.getNamedItem("targetNamespace").nodeValue : wsdl.documentElement.attributes["targetNamespace"].value;
var ns2 = wsdl.getElementsByTagName("schema")[0].getAttribute("targetNamespace");
// build SOAP request
var sr = "<?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>" +
"<ns1:" + this.method + " xmlns:ns1=\"" + ns + "\">" +
this.parameters.toXml(ns2) +
"</ns1:" + this.method + "></soap:Body></soap:Envelope>";
// send request
var xmlHttp = SoapClient._getXmlHttp();
/* not implemented */
if (SoapClient.userName && SoapClient.password){
xmlHttp.open("POST", url, async, SoapClient.userName, SoapClient.password);
// Some WS implementations (i.e. BEA WebLogic Server 10.0 JAX-WS) don't support Challenge/Response HTTP BASIC, so we send authorization headers in the first request
xmlHttp.setRequestHeader("Authorization", "Basic " + SoapClient_toBase64(SoapClientuserName + ":" + SoapClientpassword));
}
/* end of not implemented */
else
xmlHttp.open("POST", this.url, this.async);
var soapaction = ((ns.lastIndexOf("/") != ns.length - 1) ? ns + "/" : ns) + this.method;
xmlHttp.setRequestHeader("SOAPAction", soapaction);
xmlHttp.setRequestHeader("Content-Type", "text/xml; charset=utf-8");
if(this.async) {
var that = this;
xmlHttp.onreadystatechange = function() {
if(xmlHttp.readyState == 4)
that._onSendSoapRequest(xmlHttp);
}
}
xmlHttp.send(sr);
if (!this.async)
return this._onSendSoapRequest(xmlHttp);
}

SoapClient.prototype._onSendSoapRequest = function(req) {
var wsdl = this.wsdl;
var o = null;
var nd = SoapClient._getElementsByTagName(req.responseXML, this.method + "Response");
if(nd.length == 0)
nd = SoapClient._getElementsByTagName(req.responseXML, "return"); // PHP web Service?
if(nd.length == 0)
{
if(req.responseXML.getElementsByTagName("faultcode").length > 0)
{
if(this.async || this.callback)
o = new Error(500, req.responseXML.getElementsByTagName("faultstring")[0].childNodes[0].nodeValue);
else
throw new Error(500, req.responseXML.getElementsByTagName("faultstring")[0].childNodes[0].nodeValue);
}
}
else
o = this._soapresult2object(nd[0]);
if(this.callback)
Ext.callback(this.callback, this.scope, [this.arg, true, o]);
if(!this.async)
return o;
}

SoapClient.prototype._soapresult2object = function(node) {
var wsdl = this.wsdl;
this.wsdlTypes = this._getTypesFromWsdl();
return this._node2object(node);
}
SoapClient.prototype._node2object = function(node) {
wsdlTypes = this.wsdlTypes
// null node
if(node == null)
return null;
// text node
if(node.nodeType == 3 || node.nodeType == 4)
return this._extractValue(node);
// leaf node
if (node.childNodes.length == 1 && (node.childNodes[0].nodeType == 3 || node.childNodes[0].nodeType == 4))
return this._node2object(node.childNodes[0]);
var isarray = this._getTypeFromWsdl(node.nodeName.substring(node.nodeName.indexOf(":")+1)).toLowerCase().indexOf("arrayof") != -1;
// object node
if(!isarray)
{
var obj = null;
if(node.hasChildNodes())
obj = new Object();
for(var i = 0; i < node.childNodes.length; i++)
{
var p = this._node2object(node.childNodes[i]);
obj[node.childNodes[i].nodeName.substring(node.childNodes[i].nodeName.indexOf(":")+1)] = p;
}
return obj;
}
// list node
else
{
// create node ref
var l = new Array();
for(var i = 0; i < node.childNodes.length; i++)
l[l.length] = this._node2object(node.childNodes[i]);
return l;
}
return null;
}
SoapClient.prototype._extractValue = function(node) {
var wsdlTypes = this.wsdlTypes;
var value = node.nodeValue;
switch(this._getTypeFromWsdl(node.nodeName.substring(node.nodeName.indexOf(":")+1)).toLowerCase())
{
default:
case "s:string":
return (value != null) ? value + "" : "";
case "s:boolean":
return value + "" == "true";
case "s:int":
case "s:long":
return (value != null) ? parseInt(value + "", 10) : 0;
case "s:double":
return (value != null) ? parseFloat(value + "") : 0;
case "s:datetime":
if(value == null)
return null;
else
{
value = value + "";
value = value.substring(0, (value.lastIndexOf(".") == -1 ? value.length : value.lastIndexOf(".")));
value = value.replace(/T/gi," ");
value = value.replace(/-/gi,"/");
var d = new Date();
d.setTime(Date.parse(value));
return d;
}
}
}
SoapClient.prototype._getTypesFromWsdl = function() {
var wsdl = this.wsdl;
var wsdlTypes = new Array();
// IE
var ell = wsdl.getElementsByTagName("s:element");
var useNamedItem = true;
// MOZ
if(ell.length == 0)
{
ell = wsdl.getElementsByTagName("element");
useNamedItem = false;
}
for(var i = 0; i < ell.length; i++)
{
if(useNamedItem)
{
if(ell[i].attributes.getNamedItem("name") != null && ell[i].attributes.getNamedItem("type") != null)
wsdlTypes[ell[i].attributes.getNamedItem("name").nodeValue] = ell[i].attributes.getNamedItem("type").nodeValue;
}
else
{
if(ell[i].attributes["name"] != null && ell[i].attributes["type"] != null)
wsdlTypes[ell[i].attributes["name"].value] = ell[i].attributes["type"].value;
}
}
return wsdlTypes;
}
SoapClient.prototype._getTypeFromWsdl = function(elementname) {
var wsdlTypes = this.wsdlTypes;
var type = wsdlTypes[elementname] + "";
return (type == "undefined") ? "" : type;
}



/* Static method */


// private: utils
SoapClient._getElementsByTagName = function(document, tagName) {
try {
// trying to get node omitting any namespaces (latest versions of MSXML.XMLDocument)
return document.selectNodes(".//*[local-name()=\""+ tagName +"\"]");
}
catch (ex) {}
// old XML parser support
return document.getElementsByTagName(tagName);
}
// private: xmlhttp factory
SoapClient._getXmlHttp = function() {
try
{
if(window.XMLHttpRequest)
{
var req = new XMLHttpRequest();
// some versions of Moz do not support the readyState property and the onreadystate event so we patch it!
if(req.readyState == null)
{
req.readyState = 1;
req.addEventListener("load",
function()
{
req.readyState = 4;
if(typeof req.onreadystatechange == "function")
req.onreadystatechange();
},
false);
}
return req;
}
if(window.ActiveXObject)
return new ActiveXObject(SoapClient_getXmlHttpProgID());
}
catch (ex) {}
throw new Error("Your browser does not support XmlHttp objects");
}

SoapClient._getXmlHttpProgID = function()
{
if(SOAPClient._getXmlHttpProgID.progid)
return SOAPClient._getXmlHttpProgID.progid;
var progids = ["Msxml2.XMLHTTP.5.0", "Msxml2.XMLHTTP.4.0", "MSXML2.XMLHTTP.3.0", "MSXML2.XMLHTTP", "Microsoft.XMLHTTP"];
var o;
for(var i = 0; i < progids.length; i++)
{
try
{
o = new ActiveXObject(progids[i]);
return SOAPClient._getXmlHttpProgID.progid = progids[i];
}
catch (ex) {};
}
throw new Error("Could not find an installed XML parser");
}

SoapClient._toBase64 = function(input)
{
var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
var output = "";
var chr1, chr2, chr3;
var enc1, enc2, enc3, enc4;
var i = 0;

do {
chr1 = input.charCodeAt(i++);
chr2 = input.charCodeAt(i++);
chr3 = input.charCodeAt(i++);

enc1 = chr1 >> 2;
enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
enc4 = chr3 & 63;

if (isNaN(chr2)) {
enc3 = enc4 = 64;
} else if (isNaN(chr3)) {
enc4 = 64;
}

output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) +
keyStr.charAt(enc3) + keyStr.charAt(enc4);
} while (i < input.length);

return output;
}



Ext.data.SoapConnection


Ext.data.SoapConnection = function(config){
Ext.apply(this, config);
Ext.data.SoapConnection.superclass.constructor.call(this);
}

Ext.extend(Ext.data.SoapConnection, Ext.data.Connection, {
request : function(o){
if(this.fireEvent("beforerequest", this, o) !== false){
var url = o.url || this.url;
var method = o.method || this.method;
var param = o.param || this.param;
var callback = o.callback || this.callback;
var scope = o.scope || this.scope;
var pl = new SOAPClientParameters();
if(param) for(i in param) pl.add(i, param[i]);
var client = new SoapClient(url, method, pl, true, callback, scope, o);
client.invoke();
}else{
Ext.callback(o.callback, this, [o, null, null]);
}
}
});


Ext.data.SoapProxy


/* Costruttore */
Ext.data.SoapProxy = function(config){
Ext.data.SoapProxy.superclass.constructor.call(this);
this.conn = new Ext.data.SoapConnection(config);
};

Ext.extend(Ext.data.SoapProxy, Ext.data.DataProxy, {
getConnection : function(){
return this.conn;
},

load : function(params, reader, callback, scope, arg){
if(this.fireEvent("beforeload", this, params) !== false){
params.callback = this.loadResponse;
params.scope = this;
params.request = {};
params.request.callback = callback;
params.request.reader = reader;
params.request.scope = scope || this;
params.request.arg = arg || null;
this.conn.request(params);
}else{
callback.call(scope||this, null, arg, false);
}
},

// private
loadResponse : function(o, success, response){
delete this.activeRequest;
if(!success){
this.fireEvent("loadexception", this, o, response);
o.request.callback.call(o.request.scope, null, o.request.arg, false);
return;
}
var result;
try {
result = o.request.reader.read(response);
}catch(e){
this.fireEvent("loadexception", this, o, response, e);
o.request.callback.call(o.request.scope, null, o.request.arg, false);
return;
}
this.fireEvent("load", this, o, o.request.arg);
o.request.callback.call(o.request.scope, result, o.request.arg, true);
},

// private
update : function(dataSet){

},

// private
updateResponse : function(dataSet){

}
});



Ext.data.SoapReader


Ext.data.SoapReader = function(meta, recordType){
meta = meta || {};
Ext.data.SoapReader.superclass.constructor.call(this, meta, recordType || meta.fields);
};

Ext.extend(Ext.data.SoapReader, Ext.data.DataReader, {
read: function(request) {
var recordType = this.recordType, fields = recordType.prototype.fields;
for(i in request) request = request[i];
for(i in request) {
var id = request[i][this.meta.id];
request[i] = new recordType(request[i], id);
}
return {
success : true,
records : request,
totalRecords : request.length
};
}
});



And now... a usage sample for creating a store using SOAP



var o = {
url : "http://localhost:8080/SoapTest/ws/MyService",
method : "MyWebMethod"
}
var proxy = new Ext.data.SoapProxy(o);

var reader = new Ext.data.SoapReader({
id:'id'
}, ['name','title','birthdate']);

var store = new Ext.data.Store({
proxy: proxy,
reader: reader
});

store.load();

soreport
7 Jan 2008, 4:20 PM
nice work!

tarini
13 Jan 2008, 5:37 AM
i've upgraded my post...
the extension is complete (it's possible to download the code as an attachment) and there is a simple usage example

have a good ext-time

Choleriker
21 Jan 2008, 8:30 AM
Hey,

i have revied your soap client code. Why you havent updated the http-requests to Ext.Ajax.request? Is there any reason for let it be like it is?

Michael

Hadrien
21 Jan 2008, 2:48 PM
Hi, thanks to your code I wrote custom classes using Mozilla's wsdl API (http://www.mozilla.org/projects/webservices/) :

To use mozilla API you have to read security model (http://lxr.mozilla.org/mozilla/source/extensions/webservices/docs/New_Security_Model.html)


In Firefox, go to about:config
Toggle signed.applets.codebase_principal_support true.
Enjoy (http://hadrien.neuf.fr/projects/extwsdl/src/applayout.html)
Don't forget toggle back signed.applets.codebase_principal_support to false !!

Here's a simple example using amazon webservices:




var KeywordSearchRequest = new Object();
KeywordSearchRequest.keyword="Hadrien"
KeywordSearchRequest.mode="books";
KeywordSearchRequest.tag="webservices-20";
KeywordSearchRequest.type="lite";
KeywordSearchRequest.devtag="D2Z2KU2NWTOHI";
KeywordSearchRequest.format="xml";
KeywordSearchRequest.version="1.0";

var o = {
url : "http://soap.amazon.com/schemas2/AmazonWebServices.wsdl",
port: "AmazonSearchPort",
method : "KeywordSearchRequest"
}

var proxy = new Ext.data.SoapProxy(o);

var reader = new Ext.data.SoapReader({
id:'Asin',
record: "Details",
totalRecords: "TotalPages"
}, [
{ name : 'productName', mapping : 'ProductName'},
{ name : 'url', mapping : 'Url'},
{ name : 'authors', mapping : 'Authors'},
{ name : 'availability', mapping : 'Availability'},
{ name : 'manufacturer', mapping : 'Manufacturer'},
{ name : 'imgUrl', mapping : 'ImageUrlSmall' },
{ name : 'price', mapping : 'ListPrice'}, // type : 'float'},
{ name : 'releaseDate', mapping : 'ReleaseDate', type : 'date'}]);

var store = new Ext.data.Store({
proxy: proxy,
reader: reader,
baseParams : KeywordSearchRequest
});

grid = new Ext.grid.GridPanel({
store: store,
columns: [
{id:'product',header: "Product Name", width: 160, sortable: true, dataIndex: 'productName'},
{header: "List price", width: 75, sortable: true, dataIndex: 'price'},
{header: "Manufacturer", width: 75, sortable: true, dataIndex: 'manufacturer'},
{header: "Release date", width: 85, sortable: true, renderer: Ext.util.Format.dateRenderer('m/d/Y'), dataIndex: 'releaseDate'}
],
viewConfig: {
forceFit:true
},
loadMask: true,
height:350,
width:600,
title:'Amazon',
renderTo: document.body
});

store.load();

tarini
21 Jan 2008, 2:50 PM
I've used the soap js library technic for creating connection but i'm actually working for a better version of this package, more Ext-able with hierarchy, static classes and implementation of Ext pseudo-interface...

I'm analysing source/data/Connection.js because i want to extends this class but i read this method invocation Ext.lib.Ajax.request (row 219). This is very different from Ext.Ajax but i can't find its source code.
I think that Ext.lib.Ajax is a low-level object to open connection with XmlHttpRequest but without documentation and source code is too difficult to use :(

can someone help me??

for newer version stay tuned :)

Choleriker
22 Jan 2008, 12:50 AM
Hi,

i have extended source/data/Connection.js before. I have not had to change the ajax request for my purposes. Is it important for you to do so? If yes, why dont use Ext.Ajax.request for http-requests? What do you want to have changed? Maybe i can help.

Michael

Choleriker
22 Jan 2008, 3:49 AM
Your extension only works in FF, but not in IE7 (XP).

tarini
22 Jan 2008, 5:15 AM
Hi,

i have extended source/data/Connection.js before. I have not had to change the ajax request for my purposes. Is it important for you to do so? If yes, why dont use Ext.Ajax.request for http-requests? What do you want to have changed? Maybe i can help.

Michael


I would like to use the Ext-technique because if I use Ext.ajax I will use another connection and not the current one...
It's not strange creating a connection object that uses another connection??

i hope my bad english will be understood...

Choleriker
22 Jan 2008, 5:19 AM
It's not strange creating a connection object that uses another connection??

Yes its strange :) But for me its strange why to change the http requests byself. Why dont let it like it is and change only the content to send and the handling after recive?

tarini
22 Jan 2008, 7:34 AM
Yes its strange :) But for me its strange why to change the http requests byself. Why dont let it like it is and change only the content to send and the handling after recive?

maybe I can create a SoapProxy that creates two connection, for WSDL and for SOAP request, using <<standard>> Ext.data.Connection

but in this way all the code is in the proxy .js file

this evening I'll try this approach...

stay tuned :)

Hadrien
22 Jan 2008, 7:52 AM
Your extension only works in FF, but not in IE7 (XP).

Yes, SOAP and WSDL API are only availble on mozilla based browser.

tarini
22 Jan 2008, 8:24 AM
Yes, SOAP and WSDL API are only availble on mozilla based browser.

yes, but in my extension i DON'T use some specific API...
just simple xml parsing with DOM method

Hadrien
22 Jan 2008, 4:25 PM
yes, but in my extension i DON'T use some specific API...
just simple xml parsing with DOM method

Yes... but your-extension-witch-does'nt-use-some-specific-API DO NOT parse wsdl file to know if the SOAP message is valid, because SOAPClient does'nt check anything from the wsdl exept the name spaces (with a limit of one), the customs types, and because it use DOM, that it is well formed.. It does'nt event test if the method is in the wsdl...

And unluckily (or not), my firt test of your one fail because of a name space problem.

So, it's just an helper class for SOAP messages.

You upset me. But it's okay, I'll work on this by myself.

Good luck.

tarini
23 Jan 2008, 3:32 AM
Yesterday i thinked about a new extension structure and this is the result:
- a Ext.ux.soap.WsdlContainer (a static class that manages wsdl request, cache and parsing (just types and namespaces :) ))
- a Ext.ux.soap.SoapProxy (a DataProxy that opens a connection (using Ext.Ajax), parses result using a reader and calls a user-defined callback passing the parsed object)
- a Ext.us.soap.SoapReader (a DataReader that parses SOAP response in a json object and passes it to a JsonReader to parse with a recordType)


what do you think?
biggest problem is to understand SOAP protocol and messages (for example usage of namespaces) and not only my CXF-implementation

tarini
28 Jan 2008, 3:10 AM
I attached my first version of this new SoapPackage...
zip file included 3 file explained in my previous post

i think there will be some namespace problems because this extension is actually optimized for my web service implementation

sierk
14 Feb 2008, 11:24 AM
I like what you created but have some problems with understanding your Italian comments in your new solution. Would it be possible to give a translation or a example how to use the new version.

Sierk

dolfelt
28 Feb 2008, 9:41 AM
I am trying to use this to connect to a SOAP database that used object oriented functions. I am fairly new to SOAP, so bear with me.

<?
try {
$client = new SoapClient(NULL,
array(
"location"=>"http://some.server.com/MRcgi/MRWebServices.pl",
"uri"=>"MRWebServices",
"style"=>SOAP_RPC,
"use" => SOAP_ENCODED
)
);
$issues = $client->MRWebServices__search("WebServices",'myPassword','',
"select mrID, mrTITLE from MASTER99 WHERE lower(mrTITLE) LIKE 'test%'");
print "<BR><b> Search:<hr><br>\n";
print "<pre>";
print_r($issues);
print"</pre><br>\n";
} catch (SoapFault $exception) {
print "ERROR! - Got a SOAP exception:<br>";
echo $exception;
}
?>

I need to convert this working method into Javascript. Here is what I have tried:

var MRWebServices__search = new Object();
MRWebServices__search.userid = 'webservice';
MRWebServices__search.password = '1234';
MRWebServices__search.extraInfo = '';
MRWebServices__search.query = "SELECT mrid,mrtitle,mrsubmitdate FROM MASTER9 WHERE mrref_to_mr LIKE '%R%' AND mrstatus<>'Closed' ORDER BY mrsubmitdate DESC";
var o = {
url : "http://footprints.wheaton.edu/MRcgi/MRWebServices.pl",
method : "MRWebServices__search"
/*param : ['webservice','all4114all','',"SELECT mrid,mrtitle,mrsubmitdate FROM MASTER9 WHERE mrref_to_mr LIKE '%R%' AND mrstatus<>'Closed' ORDER BY mrsubmitdate DESC"]
scope : 'uri:MRWebServices'*/
}
var proxy = new Ext.data.SoapProxy(o);

var reader = new Ext.data.SoapReader({
id:'mr'
}, ['mrtitle','mrsubmitdate']);

var store = new Ext.data.Store({
proxy: proxy,
reader: reader
});

store.load();


As you can see from my commented out lines that I have also tried the param: variable to pass the needed variables by the MRWebServices__search method. Either way, I get a null value somewhere in the SoapClient.js script.

Basically I need a way to call the MRWebServices__search with those 4 variables.

Please help! Thanks.

sierk
29 Feb 2008, 10:17 AM
Hi,

We had also some problems getting an example to work and had to make some changes to the original code. I provided our changed code including example and webproxy.

We had some problems in the first release. So we changed the code and added a demo.

Hopes this helps

Sierk



/**
Include Ext.ux.Soap.js in you main page
Add the example code and change settings for your webservices.
The namespace setting is needed for IE to parse wsdl: default (xs)

We changed the code so it now supports a webservice proxy (ws_proxy.php) which
enables us to call any webservice from Javascript by redirecting it through the proxy. when
When proxy is not needed remove wsproxy as setting.
*/

var o = {
wsproxy : "http://localhost/webservice/ws_proxy.php",
url : "http://localhost/webservice/customer/index.php",
disableCaching: false,
method : "FindCustomer",
namespace:'xs',
params : {
CustomerSearchCriteria : [{
CustomerId : 'Test'
}]
}
}
var proxy = new Ext.ux.soap.SoapProxy(o);

var reader = new Ext.ux.soap.SoapReader(
[
{name:'lastname', mapping:'Customer.NaturalPersonDetails.LastName'},
{name:'title', mapping:'Customer.NaturalPersonDetails.Title'},
{name:'birthdate',mapping:'Customer.NaturalPersonDetails.BirthDate'}
]
);

var store = new Ext.data.Store({
proxy: proxy,
reader: reader
});

store.load();

egobits
5 Mar 2008, 2:03 PM
Hi Sierk,
i tried to use your code with my settings:



var o = {
url : "http://e3virt002:8080/Viajes?WSDL",
method : "ListaViajes",
disableCaching: false,
namespace:'xs',
params : {
CustomerSearchCriteria : [{
vCod_Cabecera : '6',
vCod_Detalle : 'all',
iXml : '0',
vUsrC : 'sa'
}]
}
}
var proxy = new Ext.ux.soap.SoapProxy(o);
var reader = new Ext.ux.soap.SoapReader(
[
{name:'Puerto', mapping:'row.Column5'},
{name:'FArribo', mapping:'row.Column6'}
]
);

var store = new Ext.data.Store({
proxy: proxy,
reader: reader
});

store.load();


The problem is that at the end of the page i am using:
alert(store);
and im getting "UNDEFINED".

What could be wrong?

egobits
5 Mar 2008, 2:25 PM
...And please, could you give me an example of the index.html that will make all the proper calls? These are the errors im getting on my index.html:




Ext.ux.menu has no properties
[Break on this error] Ext.ux.menu.RangeMenu.prototype.icons = {
grid-editor-mysql... (line 1799)
GET http://localhost/ext-2.0.2/examples/grid/sheldon.xml?_dc=1204751859000 (110ms)ext-base.js (line 10)
Ext.ux.soap.WsdlContainer has no properties
[Break on this error] Ext.ux.soap.WsdlContainer.cachedWsdl = new Array();
Ext.ux.Soap.js (line 188)
Ext.ux.soap.SoapReader is not a constructor
[Break on this error] {name:'FArribo', mapping:'row.Column6'}
example.js (line 29)

sierk
5 Mar 2008, 10:33 PM
Hi Sierk,
i tried to use your code with my settings:



The problem is that at the end of the page i am using:
alert(store);
and im getting "UNDEFINED".

What could be wrong?

You should not add the WSDL part at the end of your url this will be added by the WSDL container.
I also found out that i did not upload the correct file. Therefor i changed my code and uploaded it again. It now includes a working demo. To download go to page 2 (http://extjs.com/forum/showthread.php?t=22347&page=2).

Sierk

tarini
6 Mar 2008, 5:32 AM
hi guys... i attached my new version of this little library..

i added english comment... i hope that they will be understood ;)

i have some namespaces problems. this version is optimized with my soap implementation and i am not sure will works with every implementation...


tell me what you think :)

PS i use it in this way



var proxy = new Ext.ux.soap.SoapProxy({
url : "http://localhost:8080/SoapTest/ws/MyService",
loadMethod : "dammiTantiUser"
});
var reader = new Ext.ux.soap.SoapReader([
'name',
'title',
{name:'role', mapping:'role.description', defaultValue:'N/A'}
]);
var store = new Ext.data.Store({
proxy: proxy,
reader: reader
});

dolfelt
6 Mar 2008, 7:33 AM
I am using this with HTTPS SSL. What is happening is that there is no response. The responseXML variable is returning blank, causing the script to have an undefined variable error. Is there any way to use this with ssl? Also, I am using Adobe AIR to do this.

Thanks,
Daniel

egobits
6 Mar 2008, 7:45 AM
@Sierk:
Just tested it, and worked fine! Im gonna make a few tests with your script and my own webservice and i'll let you know about any glitches. Greets!

egobits
7 Mar 2008, 7:47 AM
@Sierk:

The example works alright! Still, when trying to use it with a webservice on my SQL Server 2005 i have a issue that doesnt let your ext.soap class retrieve any information.

This is what i get on my HTTP Sniffer when accesing the webservice directly from a URL (code 200 OK):


GET /Viajes?wsdl HTTP/1.1
Accept: */*
Accept-Language: en-us
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
Host: e3virt002:8080
Connection: Keep-Alive
Authorization: Negotiate YIIFHgYGKwYBBQUCoIIFEjCCBQ6gMDAuBgkqhkiC9xIBAgIGCSqGSIb3EgECAgYKKoZIhvcSAQICAwYKKwYBBAGCNwICCqKCBNgEggTUYIIE0AYJKoZIhvcSAQICAQBuggS/MIIEu6ADAgEFoQMCAQ6iBwMFACAAAACjggPgYYID3DCCA9igAwIBBaEUGxJGQVZPUklUQUZSVUlULkNPUlCiLzAtoAMCAQKhJjAkGwRIVFRQGxxlM3ZpcnQwMDIuZmF2b3JpdGFmcnVpdC5jb3Jwo4IDiDCCA4SgAwIBF6EDAgEDooIDdgSCA3LB4cQ0pYcrjGv+8vlQNQ5LLss+v5QGOouND8BfJKY4XC2mazZQc/KLSuJrHoaEbfJD4FD4TcrbDvXCAQbiaE/7xvoHKrogzn3lG27wepdkNTah7NXMevidKIAbiWk9lasy0CcQR9WQJ7pt969/E8fXDavZt/7nmsLVkm5Rpu1eIq9yA0eHXKglAXth/03TarymjyHXBTipDEik2FalO3ZpcW6kid68vH5vE7SreN5io30hqKoEjodd1Tz1i/j6gF5TAYuMipQ4ZTrF6ksKVOiy6h2lx2mWibvQxOGddaJ3WtpUl5wuMsGPQgRcm6R5za1L1gwCVCPeKERmUAE2t8ZFV+KgWKz/7OlRqAMz4JkNeJ+7PfXEEYfG4NQAqFYg74TAjUWQRnGI0F6EGXSPicuAOMC0chaZX8UPzbvjeYjtjbwULiH9/ZLWO0sXBe4RX1Zfql75ODXjiX097aVDqOd0723tiVvk6YTw6ZI+vQzYx14bvszUPH09bDG+9xPKS1MVn58i/mZF6Zpra/OCd/o2bxcdj6tOZxV21KrYsVgSVUbMcp1jtQaojvaL+EhOsW6NoiNClvSt0mbBZWVUd7sZXEHrwHyRYDhiBJkehnw9gmlk1PpZ4+JuU2NchCNkkc75satPMNn2S/XlkB6Nq+qX0FkEXVg6LawELOU3h24YPXcn/WuewNXNJ10ONkP/iNMHsef6JFCDCe3nF/Q+Qpp8mL4eCqpmR11VbJm0Gr3KzZ8DNOWgzTo6qVeK7xYZBq4lBTLcVjRjsjIJ7vHBunVEZQbAkPEVwNcL74gkP8ot9iJy+tKX7P5aUWKB+MpDXKUkQaQs5dDe+5q6t5hdbFbBGNZOdKNVTDsSCqK4oNKa///PeyS9mMhqaT0o8m/G9


And this is what i get in the sniffer log when trying to access the webservice from your soap extension (code 500 Internal server error):

GET /Viajes?wsdl&wsdl HTTP/1.1
Accept: */*
Accept-Language: en-us
Referer: http://localhost/viajes/index.html
x-requested-with: XMLHttpRequest
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
Host: e3virt002:8080
Connection: Keep-Alive
Authorization: Negotiate YIIFHgYGKwYBBQUCoIIFEjCCBQ6gMDAuBgkqhkiC9xIBAgIGCSqGSIb3EgECAgYKKoZIhvcSAQICAwYKKwYBBAGCNwICCqKCBNgEggTUYIIE0AYJKoZIhvcSAQICAQBuggS/MIIEu6ADAgEFoQMCAQ6iBwMFACAAAACjggPgYYID3DCCA9igAwIBBaEUGxJGQVZPUklUQUZSVUlULkNPUlCiLzAtoAMCAQKhJjAkGwRIVFRQGxxlM3ZpcnQwMDIuZmF2b3JpdGFmcnVpdC5jb3Jwo4IDiDCCA4SgAwIBF6EDAgEDooIDdgSCA3LB4cQ0pYcrjGv+8vlQNQ5LLss+v5QGOouND8BfJKY4XC2mazZQc/KLSuJrHoaEbfJD4FD4TcrbDvXCAQbiaE/7xvoHKrogzn3lG27wepdkNTah7NXMevidKIAbiWk9lasy0CcQR9WQJ7pt969/E8fXDavZt/7nmsLVkm5Rpu1eIq9yA0eHXKglAXth/03TarymjyHXBTipDEik2FalO3ZpcW6kid68vH5vE7SreN5io30hqKoEjodd1Tz1i/j6gF5TAYuMipQ4ZTrF6ksKVOiy6h2lx2mWibvQxOGddaJ3WtpUl5wuMsGPQgRcm6R5za1L1gwCVCPeKERmUAE2t8ZFV+KgWKz/7OlRqAMz4JkNeJ+7PfXEEYfG4NQAqFYg74TAjUWQRnGI0F6EGXSPicuAOMC0chaZX8UPzbvjeYjtjbwULiH9/ZLWO0sXBe4RX1Zfql75ODXjiX097aVDqOd0723tiVvk6YTw6ZI+vQzYx14bvszUPH09bDG+9xPKS1MVn58i/mZF6Zpra/OCd/o2bxcdj6tOZxV21KrYsVgSVUbMcp1jtQaojvaL+EhOsW6NoiNClvSt0mbBZWVUd7sZXEHrwHyRYDhiBJkehnw9gmlk1PpZ4+JuU2NchCNkkc75satPMNn2S/XlkB6Nq+qX0FkEXVg6LawELOU3h24YPXcn/WuewNXNJ10ONkP/iNMHsef6JFCDCe3nF/Q+Qpp8mL4eCqpmR11VbJm0Gr3KzZ8DNOWgzTo6qVeK7xYZBq4lBTLcVjRjsjIJ7

As you can see, the key sent in the ext.soap has a few less characters at the end. Also, the ext.soap extension tries to negotiate with the webservice with Kerberos (fails) and the with NTLM (fails again).

Any ideas?

sierk
10 Mar 2008, 9:54 PM
@Sierk:

The example works alright! Still, when trying to use it with a webservice on my SQL Server 2005 i have a issue that doesnt let your ext.soap class retrieve any information.

This is what i get on my HTTP Sniffer when accesing the webservice directly from a URL (code 200 OK):


And this is what i get in the sniffer log when trying to access the webservice from your soap extension (code 500 Internal server error):


As you can see, the key sent in the ext.soap has a few less characters at the end. Also, the ext.soap extension tries to negotiate with the webservice with Kerberos (fails) and the with NTLM (fails again).

Any ideas?

I see some strange stuff at the begining of you trace:
GET /Viajes?wsdl&wsdl
It looks like you added wsdl as a parameter. This should not be done because we will do it automaticly.

Sierk

egobits
12 Mar 2008, 9:29 AM
@Sierk:

Thanks, i fixed that prob. Now i have another one... it seems that the server is not validating

1) GET http://e3virt002:8080/Viajes?wsdl (1938ms)
* here i get the whole WS scheme.

2) POST http://e3virt002:8080/Viajes?_dc=1205342452429&undefined 500 (625ms)
* Post:

<?xml version="1.0" encoding="utf-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soap:Header xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"></soap:Header><soapenv:Body><ns1:ListaViajes xmlns:ns1="http://e3virt002/"></ns1:ListaViajes></soapenv:Body></soapenv:Envelope>

* Response:

<?xml version="1.0" encoding="utf-8"?><SOAP-ENV:Envelope xml:space="preserve" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:sql="http://schemas.microsoft.com/sqlserver/2004/SOAP" xmlns:sqlsoaptypes="http://schemas.microsoft.com/sqlserver/2004/SOAP/types" xmlns:sqlrowcount="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlRowCount" xmlns:sqlmessage="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlMessage" xmlns:sqlresultstream="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlResultStream" xmlns:sqltransaction="http://schemas.microsoft.com/sqlserver/2004/SOAP/types/SqlTransaction" xmlns:sqltypes="http://schemas.microsoft.com/sqlserver/2004/sqltypes" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"><SOAP-ENV:Body><SOAP-ENV:Fault xmlns:sqlsoapfaultcode="http://schemas.microsoft.com/sqlserver/2004/SOAP/SqlSoapFaultCode"><SOAP-ENV:Code><SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value><SOAP-ENV:Subcode><SOAP-ENV:Value>sqlsoapfaultcode:ParsingError</SOAP-ENV:Value><SOAP-ENV:Subcode><SOAP-ENV:Value>sqlsoapfaultcode:InvalidContentType</SOAP-ENV:Value></SOAP-ENV:Subcode></SOAP-ENV:Subcode></SOAP-ENV:Code><SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en-US">There was an error in the incoming SOAP request packet: Sender, ParsingError, InvalidContentType</SOAP-ENV:Text></SOAP-ENV:Reason><SOAP-ENV:Node>http://e3virt002:8080/Viajes?_dc=1205342452429&amp;undefined</SOAP-ENV:Node><SOAP-ENV:Role>http://schemas.microsoft.com/sqlserver/2004/SOAP</SOAP-ENV:Role><SOAP-ENV:Detail/></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

* The parameters sent to the POST are:
- _dc = 1205342452429
- undefined = (EMPTY) ?

Obviously it is a SERVER error (500)... any ideas on why this could be happening?

sierk
12 Mar 2008, 9:57 PM
@Sierk:

* The parameters sent to the POST are:
- _dc = 1205342452429
- undefined = (EMPTY) ?

Obviously it is a SERVER error (500)... any ideas on why this could be happening?

First _dc can be disabled by setting disableCaching: false within loadWsdl. The undefined i cannot explain but will look for it are you using the proxy php script ?

Sierk

egobits
13 Mar 2008, 10:00 AM
@Sierk:
Is it possible to use your class without the ws_proxy.php? the CURL library is giving us to much trouble on our windows based server :s

The errors we still get is because the curl_init() function doesnt work properly.

sierk
13 Mar 2008, 10:14 AM
@Sierk:
Is it possible to use your class without the ws_proxy.php? the CURL library is giving us to much trouble on our windows based server :s

The errors we still get is because the curl_init() function doesnt work properly.

Yes you can, but then the webservice must be on same server as your webserver. In this case just remove the wsproxy parameter.

Sierk

brumby007
22 Mar 2008, 6:02 AM
hi everyone, i have some problems in using ext.soappackage
At first,i deploy gsoap-linux-2.7 in the server to be a webservice server(just running the webserver sample with ./webserver 9000 which under its sample foler).
Then i open my browser to check if the webservice server is ready(visit the url http://192.168.1.103:9000/calc.htm).You can find my attatchment to see the screenshot,i saw it works fine..it can do a calculate when i input two numbers,and the webservice return the result with the xml format.
At last,i deploy my test page to the tomcat webserver.But in the firebug,it tells me there is a uncaught exception:XMLHttpRequest.open.
Is there anything wrong?

testWebService.jsp


<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<html>
<title>Test Web Service</title>
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/ext-all.css" />
<body>
</body>
</html>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/ext-base.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/ext-all.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/ext-lang-zh_CN.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/Ext.ux.Soap.js"></script>
<script>
var o = {
//wsproxy : "http://localhost/webservice/ws_proxy.php",
url : "http://192.168.1.103:9000",
//disableCaching: false,
method : "calc",
params : {
addRequest : [
{
a : 100,
o: 'a',
b : 300
}
]
}
}

var proxy = new Ext.ux.soap.SoapProxy(o);
var reader = new Ext.ux.soap.SoapReader(
[
{name:'result', mapping:'result'}
]
);
var store = new Ext.data.Store({
proxy: proxy,
reader: reader
});
store.load();
var grid = new Ext.grid.GridPanel({
store: store,
columns: [
{id:'id',header: "addResponse", width: 160, sortable: true, dataIndex: 'addResponse'}
],
viewConfig: {forceFit:true},
loadMask: true,
title:'Test'
});
view = new Ext.Viewport({
layout : 'fit',
items: grid
});
</script>


my wsdl :



<?xml version="1.0" encoding="UTF-8"?>
<definitions name="webserver"
targetNamespace="http://www.cs.fsu.edu/~engelen/webserver.wsdl"
xmlns:tns="http://www.cs.fsu.edu/~engelen/webserver.wsdl"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:demowebserver"
xmlns:SOAP="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:MIME="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:DIME="http://schemas.xmlsoap.org/ws/2002/04/dime/wsdl/"
xmlns:WSDL="http://schemas.xmlsoap.org/wsdl/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<schema targetNamespace="urn:demowebserver"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:ns="urn:demowebserver"
xmlns="http://www.w3.org/2001/XMLSchema"
elementFormDefault="unqualified"
attributeFormDefault="unqualified">
<import namespace="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</schema>
</types>
<message name="addRequest">
<part name="param-1" type="xsd:double"/>
<part name="param-2" type="xsd:double"/>
</message>
<message name="addResponse">
<part name="param-3" type="xsd:double"/>
</message>
<message name="subRequest">
<part name="param-4" type="xsd:double"/>
<part name="param-5" type="xsd:double"/>
</message>
<message name="subResponse">
<part name="param-6" type="xsd:double"/>
</message>
<message name="mulRequest">
<part name="param-7" type="xsd:double"/>
<part name="param-8" type="xsd:double"/>
</message>
<message name="mulResponse">
<part name="param-9" type="xsd:double"/>
</message>
<message name="divRequest">
<part name="param-10" type="xsd:double"/>
<part name="param-11" type="xsd:double"/>
</message>
<message name="divResponse">
<part name="param-12" type="xsd:double"/>
</message>
<message name="addResponseRequest">
<part name="param-13" type="xsd:double"/>
</message>
<message name="subResponseRequest">
<part name="param-15" type="xsd:double"/>
</message>
<message name="mulResponseRequest">
<part name="param-17" type="xsd:double"/>
</message>
<message name="divResponseRequest">
<part name="param-19" type="xsd:double"/>
</message>
<portType name="webserverPortType">
<operation name="add">
<documentation>Service definition of function ns__add</documentation>
<input message="tns:addRequest"/>
<output message="tns:addResponse"/>
</operation>
<operation name="sub">
<documentation>Service definition of function ns__sub</documentation>
<input message="tns:subRequest"/>
<output message="tns:subResponse"/>
</operation>
<operation name="mul">
<documentation>Service definition of function ns__mul</documentation>
<input message="tns:mulRequest"/>
<output message="tns:mulResponse"/>
</operation>
<operation name="div">
<documentation>Service definition of function ns__div</documentation>
<input message="tns:divRequest"/>
<output message="tns:divResponse"/>
</operation>
<operation name="addResponse">
<documentation>Service definition of function ns__addResponse_</documentation>
<input message="tns:addResponseRequest"/>
</operation>
<operation name="subResponse">
<documentation>Service definition of function ns__subResponse_</documentation>
<input message="tns:subResponseRequest"/>
</operation>
<operation name="mulResponse">
<documentation>Service definition of function ns__mulResponse_</documentation>
<input message="tns:mulResponseRequest"/>
</operation>
<operation name="divResponse">
<documentation>Service definition of function ns__divResponse_</documentation>
<input message="tns:divResponseRequest"/>
</operation>
</portType>
<binding name="webserver" type="tns:webserverPortType">
<SOAP:binding style="rpc" transport="<A href="http://schemas.xmlsoap.org/soap/http"/">http://schemas.xmlsoap.org/soap/http"/>
<operation name="add">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="sub">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="mul">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="div">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
<operation name="addResponse">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
</operation>
<operation name="subResponse">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
</operation>
<operation name="mulResponse">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
</operation>
<operation name="divResponse">
<SOAP:operation style="rpc" soapAction=""/>
<input>
<SOAP:body use="encoded" namespace="urn:demowebserver" encodingStyle="<A href="http://schemas.xmlsoap.org/soap/encoding/"/">http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
</operation>
</binding>
<service name="webserver">
<documentation>gSOAP 2.7.0e generated service definition</documentation>
<port name="webserver" binding="tns:webserver">
<SOAP:address location="<A href="http://localhost:8080"/">http://localhost:8080"/>
</port>
</service>
</definitions>

brumby007
23 Mar 2008, 1:47 AM
My screen shot here.

brumby007
23 Mar 2008, 1:52 AM
That is the screenshot when i run my client in firefox2.it shows there is an uncaught exception.i test it in ie7 ,it can't work too.
Can anyone help me?:)

hendricd
23 Mar 2008, 6:16 AM
@brumby007 - I believe the 'same-origin' policy is what's causing you trouble:

192.168.1.103:80 != 192.168.1.103:9000

brumby007
23 Mar 2008, 5:02 PM
what's your mean?can you say more detail?
Sorry.:>

hendricd
24 Mar 2008, 11:48 AM
Your port numbers are different. To qualify as a "same-origin" XHR request, the service ports (9000) must be the same as that by which the main page was served up(80).

sierk
24 Mar 2008, 9:52 PM
Your port numbers are different. To qualify as a "same-origin" XHR request, the service ports (9000) must be the same as that by which the main page was served up(80).

This means you need a proxy services to run on your webserver to redirect the service call from webserver to webserviceserver. In the example of myself you will find a simple PHP example of a proxy server.

Sierk

brumby007
25 Mar 2008, 12:23 AM
Hi sierk, i am using your example in my apache web server.but there seems some errors were reported by firebug.You can get the screenshot in my attachment.
Thanks for your reply.:)

sierk
27 Mar 2008, 9:44 PM
Hi sierk, i am using your example in my apache web server.but there seems some errors were reported by firebug.You can get the screenshot in my attachment.
Thanks for your reply.:)

Hi looked at the stuff you provide and i think it is in the WSDL you use. We search for the Element tag prefix with a namespace to buildup a name list. Default this is xs:element. In your WSDL is see no elements.

Sierk

brumby007
27 Mar 2008, 11:22 PM
Hi,Sierk,i just put your example in my apache server's root folder.and the wsdl file is just in the example you offered which named service.wsdl.
the wsdl file is :


<?xml version="1.0" encoding="utf-8"?>
<s0:definitions name="CustomerServiceDefinitions" targetNamespace="http://services.local/" xmlns:s0="http://schemas.xmlsoap.org/wsdl/" xmlns:s1="http://services.local/" xmlns:s2="http://schemas.xmlsoap.org/wsdl/soap/">
<s0:types>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://services.local/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="RetrieveCustomerDetails">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="RetrieveCustomerDetailsResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreateCustomer">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreateCustomerResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FindCustomer">
<xs:complexType>
<xs:sequence>
<xs:element name="CustomerSearchCriteria" type="ser:CustomerSearchType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FindCustomerResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Customers" type="ser:CustomersType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ModifyCustomerAddresses">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ModifyCustomerAddressesResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ModifyCustomerContactPerson">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ModifyCustomerContactPersonResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreateCustomerContactPerson">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreateCustomerContactPersonResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ModifyCustomerDetails">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="ModifyCustomerDetailsResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreateCustomerAddresses">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CreateCustomerAddressesResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Customer" type="ser:CustomerType" xmlns:ser="<A href="http://services.local/"/">http://services.local/"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</s0:types>
<s0:message name="RetrieveCustomerDetails">
<s0:part element="s1:RetrieveCustomerDetails" name="parameters"/>
</s0:message>
<s0:message name="RetrieveCustomerDetailsResponse">
<s0:part element="s1:RetrieveCustomerDetailsResponse" name="parameters"/>
</s0:message>
<s0:message name="CreateCustomer">
<s0:part element="s1:CreateCustomer" name="parameters"/>
</s0:message>
<s0:message name="CreateCustomerResponse">
<s0:part element="s1:CreateCustomerResponse" name="parameters"/>
</s0:message>
<s0:message name="FindCustomer">
<s0:part element="s1:FindCustomer" name="parameters"/>
</s0:message>
<s0:message name="FindCustomerResponse">
<s0:part element="s1:FindCustomerResponse" name="parameters"/>
</s0:message>
<s0:message name="ModifyCustomerAddresses">
<s0:part element="s1:ModifyCustomerAddresses" name="parameters"/>
</s0:message>
<s0:message name="ModifyCustomerAddressesResponse">
<s0:part element="s1:ModifyCustomerAddressesResponse" name="parameters"/>
</s0:message>
<s0:message name="ModifyCustomerContactPerson">
<s0:part element="s1:ModifyCustomerContactPerson" name="parameters"/>
</s0:message>
<s0:message name="ModifyCustomerContactPersonResponse">
<s0:part element="s1:ModifyCustomerContactPersonResponse" name="parameters"/>
</s0:message>
<s0:message name="CreateCustomerContactPerson">
<s0:part element="s1:CreateCustomerContactPerson" name="parameters"/>
</s0:message>
<s0:message name="CreateCustomerContactPersonResponse">
<s0:part element="s1:CreateCustomerContactPersonResponse" name="parameters"/>
</s0:message>
<s0:message name="ModifyCustomerDetails">
<s0:part element="s1:ModifyCustomerDetails" name="parameters"/>
</s0:message>
<s0:message name="ModifyCustomerDetailsResponse">
<s0:part element="s1:ModifyCustomerDetailsResponse" name="parameters"/>
</s0:message>
<s0:message name="CreateCustomerAddresses">
<s0:part element="s1:CreateCustomerAddresses" name="parameters"/>
</s0:message>
<s0:message name="CreateCustomerAddressesResponse">
<s0:part element="s1:CreateCustomerAddressesResponse" name="parameters"/>
</s0:message>
<s0:portType name="Customer">
<s0:operation name="RetrieveCustomerDetails" parameterOrder="parameters">
<s0:input message="s1:RetrieveCustomerDetails"/>
<s0:output message="s1:RetrieveCustomerDetailsResponse"/>
</s0:operation>
<s0:operation name="CreateCustomer" parameterOrder="parameters">
<s0:input message="s1:CreateCustomer"/>
<s0:output message="s1:CreateCustomerResponse"/>
</s0:operation>
<s0:operation name="FindCustomer" parameterOrder="parameters">
<s0:input message="s1:FindCustomer"/>
<s0:output message="s1:FindCustomerResponse"/>
</s0:operation>
<s0:operation name="ModifyCustomerAddresses" parameterOrder="parameters">
<s0:input message="s1:ModifyCustomerAddresses"/>
<s0:output message="s1:ModifyCustomerAddressesResponse"/>
</s0:operation>
<s0:operation name="ModifyCustomerContactPerson" parameterOrder="parameters">
<s0:input message="s1:ModifyCustomerContactPerson"/>
<s0:output message="s1:ModifyCustomerContactPersonResponse"/>
</s0:operation>
<s0:operation name="CreateCustomerContactPerson" parameterOrder="parameters">
<s0:input message="s1:CreateCustomerContactPerson"/>
<s0:output message="s1:CreateCustomerContactPersonResponse"/>
</s0:operation>
<s0:operation name="ModifyCustomerDetails" parameterOrder="parameters">
<s0:input message="s1:ModifyCustomerDetails"/>
<s0:output message="s1:ModifyCustomerDetailsResponse"/>
</s0:operation>
<s0:operation name="CreateCustomerAddresses" parameterOrder="parameters">
<s0:input message="s1:CreateCustomerAddresses"/>
<s0:output message="s1:CreateCustomerAddressesResponse"/>
</s0:operation>
</s0:portType>
<s0:binding name="CustomerServiceSoapBinding" type="s1:Customer">
<s2:binding style="document" transport="<A href="http://schemas.xmlsoap.org/soap/http"/">http://schemas.xmlsoap.org/soap/http"/>
<s0:operation name="RetrieveCustomerDetails">
<s2:operation soapAction="" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
<s0:operation name="CreateCustomer">
<s2:operation soapAction="" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
<s0:operation name="FindCustomer">
<s2:operation soapAction="" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
<s0:operation name="ModifyCustomerAddresses">
<s2:operation soapAction="" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
<s0:operation name="ModifyCustomerContactPerson">
<s2:operation soapAction="" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
<s0:operation name="CreateCustomerContactPerson">
<s2:operation soapAction="" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
<s0:operation name="ModifyCustomerDetails">
<s2:operation soapAction="" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
<s0:operation name="CreateCustomerAddresses">
<s2:operation soapAction="" style="document"/>
<s0:input>
<s2:body parts="parameters" use="literal"/>
</s0:input>
<s0:output>
<s2:body parts="parameters" use="literal"/>
</s0:output>
</s0:operation>
</s0:binding>
<s0:service name="CustomerServiceSoapBindingQSService">
<s0:port binding="s1:CustomerServiceSoapBinding" name="CustomerServiceSoapBindingQSPort">
<s2:address location="<A href="http://bcota03.nuon.local:5300/sierk"/">http://bcota03.nuon.local:5300/sierk"/>
</s0:port>
</s0:service>

</s0:definitions>

Is there anything wrong?;)

addphil
14 Apr 2008, 1:54 AM
Hi,




* The parameters sent to the POST are:
- _dc = 1205342452429
- undefined = (EMPTY) ?

Obviously it is a SERVER error (500)... any ideas on why this could be happening?I don't know if this issue has already been resolved, but I post this anyway.

I found that the axis implementation I use, will not reply to SOAP calls if any URL Parameters are passed.

I changed the Ajax.request Call in Ext.ux.SOAP.js to:


Ext.Ajax.request({
url: this.url,
callback: this.loadResponse,
xmlData : xml,
scope: this,
extraParams: ' ',
params: ' '
});

This solved the problem for me, although it removes some functionality.

sneddo
30 Jul 2008, 12:42 AM
Hello all, Im having what seems like a really stupid problem.

I can not get my data to go into the store.. when I inspect the dom my data is in my reader. my code is as follows:


Ext.onReady(function(){
Ext.namespace('Soap');
Soap.o = {

wsproxy : "http://localhost:1994/webservice/messagingservice.asmx",
url : "http://localhost:1994/webservice/messagingservice.asmx",

disableCaching: false,

method : "GetNewMessages",


params : [{ value : '1',
name : 'param1'
}]

}

Soap.proxy = new Ext.ux.soap.SoapProxy(Soap.o);

Soap.reader = new Ext.ux.soap.SoapReader(
['Content', 'RecipientId', 'SenderId', 'EventId', 'MessageId']
)


Soap.store = new Ext.data.Store({
proxy: Soap.proxy,
reader: Soap.reader

});

Soap.store.load();

var grid = new Ext.grid.GridPanel({
store: Soap.store,
columns: [
{header: "cont", width: 135, dataIndex: 'Content', sortable: true},
{header: "Recipient", width: 80, dataIndex: 'RecipientId', sortable: true},
{header: "sender", width: 110, dataIndex: 'SenderId', sortable: true},
{header: "champ event id", width: 75, dataIndex: 'ChampionshipSeasonEventId', sortable: true}
],
renderTo:'rightBottom',
width:430,
height:180
});

});Can anyone see a blatant error in my reader? the columns declared in my reader are all my columns that are returned my the webservice.

##### Update #####

I have found that the above works in FF2 but NOT FF3 and IE6 or 7.

Is it known issue that this little library only works in FF2?? or have I made a mistake in my code? I have edited the SoapProxy.js to be like this


/*
* Private method thats builds an XML envelope
*/
getXmlEnvelope : function(method, params, namespaces) {
var soapHeaderBody = "xmlns='http://messaging.mysite.com/'";
var paramxml = "";
for (i = 0; i < Soap.o.params.length; i++){
paramxml = paramxml + "<" + Soap.o.params[i].name + ">" + Soap.o.params[i].value + "</" + Soap.o.params[i].name + ">";
}
var sr = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
"<soap12:Envelope " +
"xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" " +
"xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +
"xmlns:soap12=\"http://www.w3.org/2003/05/soap-envelope\">" +
"<soap12:Body>" +

"<" + this.method + " " + soapHeaderBody + ">" +
paramxml +
"</" + this.method + ">" +
"</soap12:Body></soap12:Envelope>";
return sr;
},

would the changes I have made there broken things ?? I do not think that they would have.

Thank you,

sneddo
30 Jul 2008, 12:05 PM
After stepping through the code several times using Visual studio, this is what I can see is happening:

In the parseSoapRequest method (shown below), req.responseXML is not poulated in ie7, ie6 or FF3. ( it works in FF2). req.responseText does contain the correct xml though. It's as though its failing to parse my xml in these browsers. I have listed my xml below as well.
Does anyone have any ideas why this may be the case?


parseSoapRequest: function(req) {
var o = null;
var nd = this.getElementsByTagName(req.responseXML, this.method + "Response");
if(nd.length == 0) {
if(req.responseXML.getElementsByTagName("faultcode").length > 0) {
return new Error(500, req.responseXML.getElementsByTagName("faultstring")[0].childNodes[0].nodeValue);
}
} else
o = this.node2object(nd[0]);
return o;
},
The xml that is returned:


<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetNewMessagesResponse xmlns="http://xxx.com/"><GetNewMessagesResult><Message><ChampionshipSeasonEventId>1</ChampionshipSeasonEventId><MessageId>3</MessageId><Content>hello lee</Content><RecipientId>c99d3b96-2efc-43e3-9ddb-fa12aaad5009</RecipientId><SenderId>9c61fa7a-3e2e-42d3-a10a-806b352e03fe</SenderId></Message><Message><ChampionshipSeasonEventId>1</ChampionshipSeasonEventId><MessageId>4</MessageId><Content>saa</Content><RecipientId>c99d3b96-2efc-43e3-9ddb-fa12aaad5009</RecipientId><SenderId>9c61fa7a-3e2e-42d3-a10a-806b352e03fe</SenderId></Message></GetNewMessagesResult></GetNewMessagesResponse></soap:Body></soap:Envelope>

addphil
1 Sep 2008, 4:26 AM
Hi,

im using the SOAP Package along with WebObjects Axis Server and I am very happy with it.

I had to patch the following method to get it working with IE:



Ext.ux.soap.SoapReader.prototype.getElementsByTagName = function(aDocument, tagName)
{
try{
try {
return aDocument.selectNodes(".//*[local-name()=\""+ tagName +"\"]");
}
catch (anException) {
var searchResult =aDocument.evaluate(".//*[local-name()=\""+ tagName +"\"]", aDocument, null, XPathResult.ANY_TYPE, null);
return new Array(searchResult.iterateNext());
}
}catch(anotherException)
{
// Had to do this quick and dirty for my purposes:
// return aDocument.getElementsByTagName("soapenv:"+tagName);

// This should be more general
return aDocument.getElementsByTagName(tagName);
}
}

sam.wang
18 Nov 2008, 7:34 PM
This is a good tool for call webservice by Ext,
but, can everybody give me a finally version?

Email: BinB.Wang@ge.com

thanks :)

wayne_o
20 Nov 2008, 4:52 AM
Hi

This - when it works - will be every ExtJs/.NET devs dream!

I'm having an issue when it's parsing the WSDL on:



Ext.ux.data.soap.WsdlContainer.loadWsdlCallback


Specifically



namespaces.push(xml.getElementsByTagName(tagname)[0].getAttribute("targetNamespace"));


My WSDL looks like the following:



<?xml version="1.0"?>
<wsdl:definitions
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns="http://tempuri.org/" xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
targetNamespace="http://tempuri.org/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/">
<s:element name="GetHierarchyTopLevel">
<s:complexType/>
</s:element>
[...]


I have no xsd:schema - is there anyone who has this workign with .NET and has overcome this?

w://

arpitnetserv
19 Aug 2012, 9:23 PM
I am new to Sencha Touch 2.x App development.

Please help me using SoapExt.zip in my project to consume a web service.
Thanks in Advance!

jyotis017
14 Sep 2012, 10:20 PM
I m trying out with this code. It is giving me error - Result of Expression 'Ext.Data' is not an object in SoapReader.js, SoapConnection.js and SoapProxy.js.
Why so?

jyotis017
15 Sep 2012, 2:14 AM
Along with these .js file i need to use any other api or library? as it is showing refernce error of 'Ext' variable not recognised.
Please help how to use these .js

Thanx.

nurul89
25 Sep 2013, 7:44 PM
it is support for sencha touch? by this way can use to call the external database from the web and display on the sencha touch application?