Skip to content

Instantly share code, notes, and snippets.

<soapenv:Body>
<urn:ProductService.getProductByHash
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<return xsi:type="getProductByHash ">.
<!-- response example -->
<product_id xsi:type="xsd:string">260891</emag_id>
</return>
</urn:ProductService.getProductByHash>
</soapenv:Body>
/**
* [main module]
* @return {[object]}
* [with methods: createRequest, createField, getResponseNode, getErrorNode, getFieldValue]
*/
export default function soap() {
return {
/**
* [request with xml attributes]
import soap from './soap'
const soap = soap();
const vRequestObj = soap.createRequest('urn:Webservices' + 'SERVICE_NAME', 'SERVICE_TYPE',
{
'pdf_hash' : soap.createField('string', '717fb24cc33821afb4bcd529696cdfce'),
'userid_hash' : soap.createField('string', '65a47daeabcb54e4ecc3923aecdab697')
});
function xml() {
return {
toJSONObject: function(xml) {
return (xml ? toJSON(xml) : xml);
},
fromJSONObject: function(json) {
return this.fromString(toXML(json));
},
$.soap({
url: 'http://my.server.com/soapservices/',
method: 'helloWorld',
data: {
name: 'Remy Blom',
msg: 'Hi!'
},
success: function (soapResponse) {
<!DOCTYPE HTML>
<html>
<head>
<!-- Meta tag to specify the encoding -->
<meta charset="utf-8">
</head>
<body>
<div style="font-size:1.5em">
My size is 1.5em
<div style="font-size:1.5em">My size is parrentSize * 1.5</div>
</div>
<div style="font-size:150%">
My size is 1.5em
<div style="font-size:150%">My size is parrentSize + 150%</div>
</div>
var module = angular.module('uploader', []);
module.service('uploader', ['$q', function($q) {
function readyStateChange(deferred, xhr) {
if(xhr.readyState == 4) {
if(xhr.status == 200) {
deferred.resolve(JSON.parse(xhr.responseText));
}
else {
deferred.reject('HTTP status ' + xhr.status);
@qetr1ck-op
qetr1ck-op / bdd.js
Last active December 7, 2015 19:02
describe(name, function() { ... })
it(name, function() { ... })
assert.equal(value1, value2)