This is what is done in the front end.
$.get("server.jag", { action: "createOrder"},
function(data){
alert(data);
});
};
server.jag is like bellow.
<%
function invokeGetVersion(){
var log = new Log();
var ws = require('ws');
var version = new ws.WSRequest();
var options = new Array();
options.useSOAP = 1.2;
options.useWSA = 1.0;
options.action = "urn:checkOrderCost";
var payload =<ns:checkOrderCost xmlns:ns="http://orderprocessorns
"><ns:orderId>5</ns:orderId></ns:checkOrderCost>;
var result;
try {
version.open(options,"http://localhost:8080/axis2/services/OrderProcessor",
false);
version.send(payload);
result = version.responseE4X;
} catch (e) {
log.error(e.toString());
return e.toString();
}
return result;
}
var response = invokeGetVersion();
print(response);
%>
On Mon, Dec 23, 2013 at 11:04 AM, Amila Maha Arachchi <[email protected]>wrote:
> Please post your code segment.
>
>
> On Mon, Dec 23, 2013 at 10:58 AM, Maduranga Siriwardena <
> [email protected]> wrote:
>
>> Hi all,
>> I'm trying to call a web service using jaggery application as described
>> in [1].
>> As described in the example, if I print the returned value of the
>> function directly and alerted in the front end, I get the XML response. But
>> if I assigned the returned value to a variable and print it, I get "{}".
>>
>> The response I'm getting from the service is like bellow.
>>
>> <ns:checkOrderCostResponse xmlns:ns="http://orderprocessorns
>> "><ns:cost>1120.0</ns:cost></ns:checkOrderCostResponse>
>>
>> So I must be able to get the value of the cost tag by just saying
>> response_variable.cost
>> But if I do that I get "null"
>>
>> Can someone please help me to understand what is happening here.
>>
>> [1] http://jaggeryjs.org/apidocs/ws.jag
>>
>> _______________________________________________
>> Dev mailing list
>> [email protected]
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> *Amila Maharachchi*
> Senior Technical Lead
> WSO2, Inc.; http://wso2.com
>
> Blog: http://maharachchi.blogspot.com
> Mobile: +94719371446
>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev