Adding a new field inside an already implemented Axis request - java
I will try to explain that briefly.
I need to include a new field called shipToStoreGLN inside an Axis request implemented long ago using a WSDL descriptor.
It has to appear in the path OrderRequest -> PedidosIn(OrdersIn) -> Pedido (Order)-> Cabecera (Header)
I tryed to add the field like any other field is added, but it doesn't work, it doesn't appear in the final request.
Which is even stranger is that there's another field called shipToStore which has the added added to the class but it's not added in the types description but it appears on the final request.
Can someone tell me how to add that field, and if possible, explain why that other field appears?
I'll paste the code, a stub of how the request has to look like and how does it looks right now.
Thanks to everybody.
The relevant code of the class OrderRequestPedidosInPedidoCabecera.java (I'm not able to copy the full java source because it's too long):
//The getters and setters
public java.lang.String getShipToStoreGLN() {
return shipToStoreGLN;
}
public void setShipToStoreGLN(java.lang.String shipToStoreGLN) {
this.shipToStoreGLN = shipToStoreGLN;
}
//Applying it to the type descriptor
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("shipToStoreGLN");
elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/GatewayService/", "shipToStoreGLN"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);
The Stub on how the request has to look like:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gat="http://tempuri.org/GatewayService/">
<soapenv:Header/>
<soapenv:Body>
<gat:OrderRequest>
<gat:PedidosIn>
<gat:Identificacion>
<gat:IdUsuario>?</gat:IdUsuario>
<gat:Password>?</gat:Password>
</gat:Identificacion>
<gat:Pedido>
<gat:Cabecera>
<gat:NumeroPedido>?</gat:NumeroPedido>
<gat:shipToStore>?</gat:shipToStore>
<gat:shipToStoreGLN>?</gat:shipToStoreGLN>
<gat:FechaPedido>?</gat:FechaPedido>
<gat:Facturacion>
<gat:Nombre>?</gat:Nombre>
<gat:Apellidos>?</gat:Apellidos>
<gat:Direccion>?</gat:Direccion>
<gat:CodigoPostal>?</gat:CodigoPostal>
<gat:Poblacion>?</gat:Poblacion>
<gat:Provincia>?</gat:Provincia>
<gat:NIF>?</gat:NIF>
<gat:Telefono>?</gat:Telefono>
</gat:Facturacion>
<gat:Entrega>
<gat:Nombre>?</gat:Nombre>
<gat:Apellidos>?</gat:Apellidos>
<gat:Direccion>?</gat:Direccion>
<gat:CodigoPostal>?</gat:CodigoPostal>
<gat:Poblacion>?</gat:Poblacion>
<gat:Provincia>?</gat:Provincia>
<gat:NIF>?</gat:NIF>
<gat:Telefono>?</gat:Telefono>
</gat:Entrega>
<gat:Total>?</gat:Total>
<gat:Email>?</gat:Email>
<gat:CodigoTrackingTrans>?</gat:CodigoTrackingTrans>
<gat:NumeroExpedicion>?</gat:NumeroExpedicion>
<gat:CodigoRuta>?</gat:CodigoRuta>
<gat:NombreRuta>?</gat:NombreRuta>
<gat:CodigoAgenciaDestino>?</gat:CodigoAgenciaDestino>
<gat:NombreAgenciaDestino>?</gat:NombreAgenciaDestino>
</gat:Cabecera>
<gat:Lineas>
<!--Zero or more repetitions:-->
<gat:Linea>
<gat:IdPedidoLinea>?</gat:IdPedidoLinea>
<gat:Referencia>?</gat:Referencia>
<gat:ReferenciaMS>?</gat:ReferenciaMS>
<gat:Posicion>?</gat:Posicion>
<gat:Cantidad>?</gat:Cantidad>
<gat:Descripcion>?</gat:Descripcion>
<gat:PrecioUnitario>?</gat:PrecioUnitario>
<gat:Total>?</gat:Total>
</gat:Linea>
</gat:Lineas>
</gat:Pedido>
</gat:PedidosIn>
</gat:OrderRequest>
</soapenv:Body>
</soapenv:Envelope>
How the request looks like now:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<OrderRequest xmlns="http://tempuri.org/GatewayService/">
<PedidosIn>
<Identificacion>
<IdUsuario>MMKTTEST</IdUsuario>
<Password>H23mLu3RieDr</Password>
</Identificacion>
<Pedido>
<Cabecera>
<NumeroPedido>000123657</NumeroPedido>
<FechaPedido>20140911 122523</FechaPedido>
<CodigoTiendaFacturacion>E290</CodigoTiendaFacturacion>
<CodigoTiendaEntrega>E290</CodigoTiendaEntrega>
<Facturacion>
<Nombre>Cristina</Nombre>
<Apellidos>Franco</Apellidos>
<Direccion>barcelona,gggg gggg</Direccion>
<CodigoPostal>08022</CodigoPostal>
<Poblacion>BARCELONA</Poblacion>
<Provincia>BARCELONA</Provincia>
<CodigoProvincia>08</CodigoProvincia>
<NIF>52173198K</NIF>
<Telefono>677714997</Telefono>
<pais>es</pais>
</Facturacion>
<Entrega>
<Nombre>MEDIA MARKT DIAGONAL MAR-BARCELONA VIDEO-TV-HIFI-E</Nombre>
<Apellidos>LEKTRO-COMPUTER-FOTO, S.A </Apellidos>
<Direccion>C.C DIAGONAL MAR AVDA DIAGONAL Nº3, planta B local 14000</Direccion>
<CodigoPostal>08019</CodigoPostal>
<Poblacion>BARCELONA</Poblacion>
<Provincia>BARCELONA</Provincia>
<NIF/>
<Telefono>934857200</Telefono>
<direccion1>C.C DIAGONAL MAR AVDA DIAGONAL Nº3, planta B local 14000</direccion1>
<direccion2/>
<direccion3/>
</Entrega>
<Total>219.0</Total>
<Email>crisfrancob#gmail.com</Email>
<CodigoTrackingTrans/>
<NumeroExpedicion/>
<CodigoRuta/>
<NombreRuta/>
<CodigoAgenciaDestino/>
<NombreAgenciaDestino/>
<shipToStore>1</shipToStore>
</Cabecera>
<Lineas>
<Linea>
<IdPedidoLinea>0</IdPedidoLinea>
<Referencia>B99B329</Referencia>
<ReferenciaMS>1148842</ReferenciaMS>
<ReferenciaUni/>
<Posicion>1</Posicion>
<Cantidad>1.0</Cantidad>
<Descripcion>GF EN210 SILENT/DI/1GD3/V2 CTLR 1GB DDR3 PCI-E DVI-I HDMI IN</Descripcion>
<PrecioUnitario>0.0</PrecioUnitario>
<Total>0.0</Total>
</Linea>
</Lineas>
</Pedido>
</PedidosIn>
</OrderRequest>
</soapenv:Body>
I was setting a null on shipToStoreGLN field. Now I know you can't set a null and expect the XML tag to appear.
Related
How can I stop all this verbose output in maven
I am running web browser automation using maven and have noticed all this verbose output. There are lots of people working on the project and no one is sure when the verbose output started appearing. Ideally I just want the cucumber test status and the output from writing to the console. The output is slowing down my execution and I want to get rid of it, here's an example of some of the output: "script": "return (function(){return (function(){var k=this;function l(a){return void 0!==a}function n(a){return\"string\"==typeof a}function aa(a,b){a=a.split(\".\");var c=k;a[0]in c||\"undefined\"==typeof c.execScript||c.execScript(\"var \"+a[0]);for(var d;a.length&&(d=a.shift());)!a.length&&l(b)?c [d]=b:c[d]&&c[d]!==Object.prototype[d]?c=c[d]:c=c[d]={}}\nfunction ba(a){var b=typeof a;if(\"object\"==b)if(a){if(a instanceof Array)return\"array\";if(a instanceof Object)return b;var c=Object.prototype.toString.call(a);if(\"[object Window]\"==c)return\"object\";if(\"[object Array]\"==c||\"number\"==ty peof a.length&&\"undefined\"!=typeof a.splice&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"splice\"))return\"array\";if(\"[object Function]\"==c||\"undefined\"!=typeof a.call&&\"undefined\"!=typeof a.propertyIsEnumerable&&!a.propertyIsEnumerable(\"call\"))return\"function\"}e lse return\"null\";\nelse if(\"function\"==b&&\"undefined\"==typeof a.call)return\"object\";return b}function ca(a,b,c){return a.call.apply(a.bind,arguments)}function da(a,b,c){if(!a)throw Error();if(2\u003Carguments.length){var d=Array.prototype.slice.call(arguments,2);return function(){var e=Array.pro totype.slice.call(arguments);Array.prototype.unshift.apply(e,d);return a.apply(b,e)}}return function(){return a.apply(b,arguments)}}\nfunction ea(a,b,c){Function.prototype.bind&&-1!=Function.prototype.bind.toString().indexOf(\"native code\")?ea=ca:ea=da;return ea.apply(null,arguments)}function fa(a,b){v ar c=Array.prototype.slice.call(arguments,1);return function(){var d=c.slice();d.push.apply(d,arguments);return a.apply(this,d)}}function t(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};/*\n\n The MIT License\n\n Copyright (c) 2007 Cybozu Labs, Inc.\n Copyright (c) 2012 Google Inc.\n\n Permission is hereby granted, free of charge, to any person obtaining a copy\n of this software and associated documentation files (the \"Software\"), to\n deal in the Software without restriction, including without limitation the\n rights to use, copy, modify, merge, publish, d istribute, sublicense, and/or\n sell copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n\n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n T HE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n IN THE SOFTWARE.\n*/\nfunction ha(a,b,c){this.a=a;this.b=b||1;this.f=c||1};var ia=Array.prototype.indexOf?function(a,b){return Array.prototype.indexOf. call(a,b,void 0)}:function(a,b){if(n(a))return n(b)&&1==b.length?a.indexOf(b,0):-1;for(var c=0;c\u003Ca.length;c++)if(c in a&&a[c]===b)return c;return-1},u=Array.prototype.forEach?function(a,b){Array.prototype.forEach.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=n(a)?a.split(\"\"):a,e=0;e\u003Cc ;e++)e in d&&b.call(void 0,d[e],e,a)},ja=Array.prototype.filter?function(a,b){return Array.prototype.filter.call(a,b,void 0)}:function(a,\nb){for(var c=a.length,d=[],e=0,f=n(a)?a.split(\"\"):a,g=0;g\u003Cc;g++)if(g in f){var h=f[g];b.call(void 0,h,g,a)&&(d[e++]=h)}return d},ka=Array.prototype.reduce?fun ction(a,b,c){return Array.prototype.reduce.call(a,b,c)}:function(a,b,c){var d=c;u(a,function(e,f){d=b.call(void 0,d,e,f,a)});return d},la=Array.prototype.some?function(a,b){return Array.prototype.some.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=n(a)?a.split(\"\"):a,e=0;e\u003Cc;e++)if(e in d&&b .call(void 0,d[e],e,a))return!0;return!1},ma=Array.prototype.every?\nfunction(a,b){return Array.prototype.every.call(a,b,void 0)}:function(a,b){for(var c=a.length,d=n(a)?a.split(\"\"):a,e=0;e\u003Cc;e++)if(e in d&&!b.call(void 0,d[e],e,a))return!1;return!0};function na(a,b){a:{for(var c=a.length,d=n(a)? a.split(\"\"):a,e=0;e\u003Cc;e++)if(e in d&&b.call(void 0,d[e],e,a)){b=e;break a}b=-1}return 0>b?null:n(a)?a.charAt(b):a[b]}function oa(a){return Array.prototype.concat.apply([],arguments)}\nfunction pa(a,b,c){return 2>=arguments.length?Array.prototype.slice.call(a,b):Array.prototype.slice.call(a,b,c)}; var qa=String.prototype.trim?function(a){return a.trim()}:function(a){return/^[\\s\\xa0]*([\\s\\S]*?)[\\s\\xa0]*$/.exec(a)[1]};function ra(a,b){return a\u003Cb?-1:a>b?1:0};var v;a:{var sa=k.navigator;if(sa){var ta=sa.userAgent;if(ta){v=ta;break a}}v=\"\"}function x(a){return-1!=v.indexOf(a)};function ua (){return x(\"Firefox\")||x(\"FxiOS\")}function va(){return(x(\"Chrome\")||x(\"CriOS\"))&&!x(\"Edge\")};function wa(a){return String(a).replace(/\\-([a-z])/g,function(b,c){return c.toUpperCase()})};function xa(){return x(\"iPhone\")&&!x(\"iPod\")&&!x(\"iPad\")};function ya(a,b){var c=za;return Object.pr ototype.hasOwnProperty.call(c,a)?c[a]:c[a]=b(a)};var Aa=x(\"Opera\"),y=x(\"Trident\")||x(\"MSIE\"),Ba=x(\"Edge\"),Ca=x(\"Gecko\")&&!(-1!=v.toLowerCase().indexOf(\"webkit\")&&!x(\"Edge\"))&&!(x(\"Trident\")||x(\"MSIE\"))&&!x(\"Edge\"),Da=-1!=v.toLowerCase().indexOf(\"webkit\")&&!x(\"Edge\");function Ea() {var a=k.document;return a?a.documentMode:void 0}var Fa;\na:{var Ga=\"\",Ha=function(){var a=v;if(Ca)return/rv:([^\\);]+)(\\)|;)/.exec(a);if(Ba)return/Edge\\/([\\d\\.]+)/.exec(a);if(y)return/\\b(?:MSIE|rv)[: ]([^\\);]+)(\\)|;)/.exec(a);if(Da)return/WebKit\\/(\\S+)/.exec(a);if(Aa)return/(?:Version)[ \\/] ?(\\S+)/.exec(a)}();Ha&&(Ga=Ha?Ha[1]:\"\");if(y){var Ia=Ea();if(null!=Ia&&Ia>parseFloat(Ga)){Fa=String(Ia);break a}}Fa=Ga}var za={};\nfunction Ja(a){return ya(a,function(){for(var b=0,c=qa(String(Fa)).split(\".\"),d=qa(String(a)).split(\".\"),e=Math.max(c.length,d.length),f=0;0==b&&f\u003Ce;f++){var g=c [f]||\"\",h=d[f]||\"\";do{g=/(\\d*)(\\D*)(.*)/.exec(g)||[\"\",\"\",\"\",\"\"];h=/(\\d*)(\\D*)(.*)/.exec(h)||[\"\",\"\",\"\",\"\"];if(0==g[0].length&&0==h[0].length)break;b=ra(0==g[1].length?0:parseInt(g[1],10),0==h[1].length?0:parseInt(h[1],10))||ra(0==g[2].length,0==h[2].length)||ra(g[2],h[2]);g=g[3];h =h[3]}while(0==b)}return 0\u003C=b})}var Ka;var La=k.document;\nKa=La&&y?Ea()||(\"CSS1Compat\"==La.compatMode?parseInt(Fa,10):5):void 0;var z=y&&!(9\u003C=Number(Ka)),Ma=y&&!(8\u003C=Number(Ka));function Na(a,b,c,d){this.a=a;this.nodeName=c;this.nodeValue=d;this.nodeType=2;this.parentNode=this.ownerElem ent=b}function Oa(a,b){var c=Ma&&\"href\"==b.nodeName?a.getAttribute(b.nodeName,2):b.nodeValue;return new Na(b,a,b.nodeName,c)};function Pa(a){this.b=a;this.a=0}function Qa(a){a=a.match(Ra);for(var b=0;b\u003Ca.length;b++)Sa.test(a[b])&&a.splice(b,1);return new Pa(a)}var Ra=/\\$?(?:(?![0-9-\\.])(?:\\*|[ \\w-\\.]+):)?(?![0-9-\\.])(?:\\*|[\\w-\\.]+)|\\/\\/|\\.\\.|::|\\d+(?:\\.\\d*)?|\\.\\d+|\"[^\"]*\"|'[^']*'|[!\u003C>]=|\\s+|./g,Sa=/^\\s/;function A(a,b){return a.b[a.a+(b||0)]}function B(a){return a.b[a.a++]}function Ta(a){return a.b.length\u003C=a.a};function Ua(a,b){this.x=l(a)?a:0;this.y=l(b)?b:0}Ua. prototype.ceil=function(){this.x=Math.ceil(this.x);this.y=Math.ceil(this.y);return this};Ua.prototype.floor=function(){this.x=Math.floor(this.x);this.y=Math.floor(this.y);return this};Ua.prototype.round=function(){this.x=Math.round(this.x);this.y=Math.round(this.y);return this};function Va(a,b){this.wid th=a;this.height=b}Va.prototype.aspectRatio=function(){return this.width/this.height};Va.prototype.ceil=function(){this.width=Math.ceil(this.width);this.height=Math.ceil(this.height);return this};Va.prototype.floor=function(){this.width=Math.floor(this.width);this.height=Math.floor(this.height);return t his};Va.prototype.round=function(){this.width=Math.round(this.width);this.height=Math.round(this.height);return this};function Wa(a,b){if(!a||!b)return!1;if(a.contains&&1==b.nodeType)return a==b||a.contains(b);if(\"undefined\"!=typeof a.compareDocumentPosition)return a==b||!!(a.compareDocumentPosition(b )&16);for(;b&&a!=b;)b=b.parentNode;return b==a}\nfunction Xa(a,b){if(a==b)return 0;if(a.compareDocumentPosition)return a.compareDocumentPosition(b)&2?1:-1;if(y&&!(9\u003C=Number(Ka))){if(9==a.nodeType)return-1;if(9==b.nodeType)return 1}if(\"sourceIndex\"in a||a.parentNode&&\"sourceIndex\"in a.parentNode ){var c=1==a.nodeType,d=1==b.nodeType;if(c&&d)return a.sourceIndex-b.sourceIndex;var e=a.parentNode,f=b.parentNode;return e==f?Ya(a,b):!c&&Wa(e,b)?-1*Za(a,b):!d&&Wa(f,a)?Za(b,a):(c?a.sourceIndex:e.sourceIndex)-(d?b.sourceIndex:f.sourceIndex)}d=C(a);c=d.createRange();\nc.selectNode(a);c.collapse(!0);a=d. createRange();a.selectNode(b);a.collapse(!0);return c.compareBoundaryPoints(k.Range.START_TO_END,a)}function Za(a,b){var c=a.parentNode;if(c==b)return-1;for(;b.parentNode!=c;)b=b.parentNode;return Ya(b,a)}function Ya(a,b){for(;b=b.previousSibling;)if(b==a)return-1;return 1}function C(a){return 9==a.node Type?a:a.ownerDocument||a.document}function $a(a,b){a&&(a=a.parentNode);for(var c=0;a;){if(b(a))return a;a=a.parentNode;c++}return null}\nfunction ab(a){this.a=a||k.document||document}ab.prototype.getElementsByTagName=function(a,b){return(b||this.a).getElementsByTagName(String(a))};function E(a){var b=n ull,c=a.nodeType;1==c&&(b=a.textContent,b=void 0==b||null==b?a.innerText:b,b=void 0==b||null==b?\"\":b);if(\"string\"!=typeof b)if(z&&\"title\"==a.nodeName.toLowerCase()&&1==c)b=a.text;else if(9==c||1==c){a=9==c?a.documentElement:a.firstChild;c=0;var d=[];for(b=\"\";a;){do 1!=a.nodeType&&(b+=a.nodeValue ),z&&\"title\"==a.nodeName.toLowerCase()&&(b+=a.text),d[c++]=a;while(a=a.firstChild);for(;c&&!(a=d[--c].nextSibling););}}else b=a.nodeValue;return b}\nfunction F(a,b,c){if(null===b)return!0;try{if(!a.getAttribute)return!1}catch(d){return!1}Ma&&\"class\"==b&&(b=\"className\");return null==c?!!a.getAttrib ute(b):a.getAttribute(b,2)==c}function bb(a,b,c,d,e){return(z?cb:db).call(null,a,b,n(c)?c:null,n(d)?d:null,e||new G)}\nfunction cb(a,b,c,d,e){if(a instanceof eb||8==a.b||c&&null===a.b){var f=b.all;if(!f)return e;a=fb(a);if(\"*\"!=a&&(f=b.getElementsByTagName(a),!f))return e;if(c){for(var g=[],h=0;b=f[h+ +];)F(b,c,d)&&g.push(b);f=g}for(h=0;b=f[h++];)\"*\"==a&&\"!\"==b.tagName||e.add(b);return e}gb(a,b,c,d,e);return e}\nfunction db(a,b,c,d,e){b.getElementsByName&&d&&\"name\"==c&&!y?(b=b.getElementsByName(d),u(b,function(f){a.a(f)&&e.add(f)})):b.getElementsByClassName&&d&&\"class\"==c?(b=b.getElementsByCl assName(d),u(b,function(f){f.className==d&&a.a(f)&&e.add(f)})):a instanceof H?gb(a,b,c,d,e):b.getElementsByTagName&&(b=b.getElementsByTagName(a.f()),u(b,function(f){F(f,c,d)&&e.add(f)}));return e}\nfunction hb(a,b,c,d,e){var f;if((a instanceof eb||8==a.b||c&&null===a.b)&&(f=b.childNodes)){var g=fb(a);if (\"*\"!=g&&(f=ja(f,function(h){return h.tagName&&h.tagName.toLowerCase()==g}),!f))return e;c&&(f=ja(f,function(h){return F(h,c,d)}));u(f,function(h){\"*\"==g&&(\"!\"==h.tagName||\"*\"==g&&1!=h.nodeType)||e.add(h)});return e}return ib(a,b,c,d,e)}function ib(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling )F(b,c,d)&&a.a(b)&&e.add(b);return e}\nfunction gb(a,b,c,d,e){for(b=b.firstChild;b;b=b.nextSibling)F(b,c,d)&&a.a(b)&&e.add(b),gb(a,b,c,d,e)}function fb(a){if(a instanceof H){if(8==a.b)return\"!\";if(null===a.b)return\"*\"}return a.f()};function G(){this.b=this.a=null;this.l=0}function jb(a){this.f=a;thi s.a=this.b=null}function lb(a,b){if(!a.a)return b;if(!b.a)return a;var c=a.a;b=b.a;for(var d=null,e,f=0;c&&b;){e=c.f;var g=b.f;e==g||e instanceof Na&&g instanceof Na&&e.a==g.a?(e=c,c=c.a,b=b.a):0\u003CXa(c.f,b.f)?(e=b,b=b.a):(e=c,c=c.a);(e.b=d)?d.a=e:a.a=e;d=e;f++}for(e=c||b;e;)e.b=d,d=d.a=e,f++,e=e.a;a .b=d;a.l=f;return a}function mb(a,b){b=new jb(b);b.a=a.a;a.b?a.a.b=b:a.a=a.b=b;a.a=b;a.l++}\nG.prototype.add=function(a){a=new jb(a);a.b=this.b;this.a?this.b.a=a:this.a=this.b=a;this.b=a;this.l++};function nb(a){return(a=a.a)?a.f:null}function ob(a){return(a=nb(a))?E(a):\"\"}function I(a,b){return new p b(a,!!b)}function pb(a,b){this.f=a;this.b=(this.s=b)?a.b:a.a;this.a=null}function J(a){var b=a.b;if(null==b)return null;var c=a.a=b;a.b=a.s?b.b:b.a;return c.f};function K(a){this.i=a;this.b=this.g=!1;this.f=null}function L(a){return\"\\n \"+a.toString().split(\"\\n\").join(\"\\n \")}function qb(a,b){a .g=b}fun15:50:14.984 [AsyncHttpClient-timer-1-1] DEBUG org.asynchttpclient.netty.channel.DefaultChannelPool - Entry count for : http://localhost:58784 : 1 ction rb(a,b){a.b=b}function O(a,b){a=a.a(b);return a instanceof G?+ob(a):+a}function P(a,b){a=a.a(b);return a instanceof G?ob(a):\"\"+a}function sb(a,b){a=a.a(b);return a instanceof G?!!a.l:!!a};function tb(a,b,c){K.call(this,a.i);this.c=a;this.h=b;this.o=c;this.g=b.g||c.g;this.b=b.b||c.b;this.c==ub&&( c.b||c.g||4==c.i||0==c.i||!b.f?b.b||b.g||4==b.i||0==b.i||!c.f||(this.f={name:c.f.name,u:b}):this.f={name:b.f.name,u:c})}t(tb,K);\nfunction vb(a,b,c,d,e){b=b.a(d);c=c.a(d);var f;if(b instanceof G&&c instanceof G){b=I(b);for(d=J(b);d;d=J(b))for(e=I(c),f=J(e);f;f=J(e))if(a(E(d),E(f)))return!0;return!1}if(b instanceof G||c instanceof G){b instanceof G?(e=b,d=c):(e=c,d=b);f=I(e);for(var g=typeof d,h=J(f);h;h=J(f)){switch(g){case \"number\":h=+E(h);break;case \"boolean\":h=!!E(h);break;case \"string\":h=E(h);break;default:throw Error(\"Illegal primitive type for comparison.\");}if(e==b&&a(h,d)||e==c&&a(d,h) )return!0}return!1}return e?\"boolean\"==\ntypeof b||\"boolean\"==typeof c?a(!!b,!!c):\"number\"==typeof b||\"number\"==typeof c?a(+b,+c):a(b,c):a(+b,+c)}tb.prototype.a=function(a){return this.c.m(this.h,this.o,a)};tb.prototype.toString=function(){var a=\"Binary Expression: \"+this.c;a+=L(this.h);return a+=L(this.o)};function wb(a,b,c,d){this.H=a;this.C=b;this.i=c;this.m=d}wb.prototype.toString=function(){return this.H};var xb={};\nfunction Q(a,b,c,d){if(xb.hasOwnProperty(a))throw Error(\"Binary operator already created: \"+a);a=new wb(a,b,c,d);return xb[a.toString()]=a}Q(\"div\",6,1,function(a,b,c){r eturn O(a,c)/O(b,c)});Q(\"mod\",6,1,function(a,b,c){return O(a,c)%O(b,c)});Q(\"*\",6,1,function(a,b,c){return O(a,c)*O(b,c)});Q(\"+\",5,1,function(a,b,c){return O(a,c)+O(b,c)});Q(\"-\",5,1,function(a,b,c){return O(a,c)-O(b,c)});Q(\"\u003C\",4,2,function(a,b,c){return vb(function(d,e){return d\u003Ce},a, b,c)});\nQ(\">\",4,2,function(a,b,c){return vb(function(d,e){return d>e},a,b,c)});Q(\"\u003C=\",4,2,function(a,b,c){return vb(function(d,e){return d\u003C=e},a,b,c)});Q(\">=\",4,2,function(a,b,c){return vb(function(d,e){return d>=e},a,b,c)});var ub=Q(\"=\",3,2,function(a,b,c){return vb(function(d,e){ret urn d==e},a,b,c,!0)});Q(\"!=\",3,2,function(a,b,c){return vb(function(d,e){return d!=e},a,b,c,!0)});Q(\"and\",2,2,function(a,b,c){return sb(a,c)&&sb(b,c)});Q(\"or\",1,2,function(a,b,c){return sb(a,c)||sb(b,c)});function yb(a,b){if(b.a.length&&4!=a.i)throw Error(\"Primary expression must evaluate to node set if filter has predicate(s).\");K.call(this,a.i);this.c=a;this.h=b;this.g=a.g;this.b=a.b}t(yb,K);yb.prototype.a=function(a){a=this.c.a(a);return zb(this.h,a)};yb.prototype.toString=function(){var a=\"Filter:\"+L(this.c);return a+=L(this.h)};function Ab(a,b){if(b.length\u003Ca.B)throw Error(\"Function \"+a.j+\" expects at least\"+a.B+\" arguments, \"+b.length+\" given\");if(null!==a.A&&b.length>a.A)throw Error(\"Function \"+a.j+\" expects at most \"+a.A+\" arguments, \"+b.length+\" given\");a.G&&u(b,function(c,d){if(4!=c.i)throw Error(\"Argument \"+d+\" to function \"+a.j+\" is not of type Nodeset: \"+c);});K.call(this,a.i);this.v=a;this.c=b;qb(this,a.g||la(b,function(c){return c.g}));rb(this,a.F&&!b.length||a.D&&!!b.length||la(b,function(c){return c.b}))}\nt(Ab,K);Ab.prototype.a=function(a){return this.v.m.apply(null,oa(a,this.c))};Ab.prototype.toString=function(){var a=\"Function: \"+this.v;if(t his.c.length){var b=ka(this.c,function(c,d){return c+L(d)},\"Arguments:\");a+=L(b)}return a};function Bb(a,b,c,d,e,f,g,h){this.j=a;this.i=b;this.g=c;this.F=d;this.D=!1;this.m=e;this.B=f;this.A=l(g)?g:f;this.G=!!h}Bb.prototype.toString=function(){return this.j};var Cb={};\nfunction R(a,b,c,d,e,f,g,h){if( Cb.hasOwnProperty(a))throw Error(\"Function already created: \"+a+\".\");Cb[a]=new Bb(a,b,c,d,e,f,g,h)}R(\"boolean\",2,!1,!1,function(a,b){return sb(b,a)},1);R(\"ceiling\",1,!1,!1,function(a,b){return Math.ceil(O(b,a))},1);R(\"concat\",3,!1,!1,function(a,b){return ka(pa(arguments,1),function(c,d){return c+P(d,a)},\"\")},2,null);R(\"contains\",2,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);return-1!=b.indexOf(a)},2);R(\"count\",1,!1,!1,function(a,b){return b.a(a).l},1,1,!0);\nR(\"false\",2,!1,!1,function(){return!1},0);R(\"floor\",1,!1,!1,function(a,b){return Math.floor(O(b,a))},1);R(\"id\",4,!1,!1,function (a,b){function c(h){if(z){var m=e.all[h];if(m){if(m.nodeType&&h==m.id)return m;if(m.length)return na(m,function(w){return h==w.id})}return null}return e.getElementById(h)}var d=a.a,e=9==d.nodeType?d:d.ownerDocument;a=P(b,a).split(/\\s+/);var f=[];u(a,function(h){h=c(h);!h||0\u003C=ia(f,h)||f.push(h)});f .sort(Xa);var g=new G;u(f,function(h){g.add(h)});return g},1);\nR(\"lang\",2,!1,!1,function(){return!1},1);R(\"last\",1,!0,!1,function(a){if(1!=arguments.length)throw Error(\"Function last expects ()\");return a.f},0);R(\"local-name\",3,!1,!0,function(a,b){return(a=b?nb(b.a(a)):a.a)?a.localName||a.nodeN ame.toLowerCase():\"\"},0,1,!0);R(\"name\",3,!1,!0,function(a,b){return(a=b?nb(b.a(a)):a.a)?a.nodeName.toLowerCase():\"\"},0,1,!0);R(\"namespace-uri\",3,!0,!1,function(){return\"\"},0,1,!0);\nR(\"normalize-space\",3,!1,!0,function(a,b){return(b?P(b,a):E(a.a)).replace(/[\\s\\xa0]+/g,\" \").replace(/^\\s+ |\\s+$/g,\"\")},0,1);R(\"not\",2,!1,!1,function(a,b){return!sb(b,a)},1);R(\"number\",1,!1,!0,function(a,b){return b?O(b,a):+E(a.a)},0,1);R(\"position\",1,!0,!1,function(a){return a.b},0);R(\"round\",1,!1,!1,function(a,b){return Math.round(O(b,a))},1);R(\"starts-with\",2,!1,!1,function(a,b,c){b=P(b,a);a= P(c,a);return 0==b.lastIndexOf(a,0)},2);R(\"string\",3,!1,!0,function(a,b){return b?P(b,a):E(a.a)},0,1);\nR(\"string-length\",1,!1,!0,function(a,b){return(b?P(b,a):E(a.a)).length},0,1);R(\"substring\",3,!1,!1,function(a,b,c,d){c=O(c,a);if(isNaN(c)||Infinity==c||-Infinity==c)return\"\";d=d?O(d,a):Infinit y;if(isNaN(d)||-Infinity===d)return\"\";c=Math.round(c)-1;var e=Math.max(c,0);a=P(b,a);return Infinity==d?a.substring(e):a.substring(e,c+Math.round(d))},2,3);R(\"substring-after\",3,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);c=b.indexOf(a);return-1==c?\"\":b.substring(c+a.length)},2);\nR(\"substring-before \",3,!1,!1,function(a,b,c){b=P(b,a);a=P(c,a);a=b.indexOf(a);return-1==a?\"\":b.substring(0,a)},2);R(\"sum\",1,!1,!1,function(a,b){a=I(b.a(a));b=0;for(var c=J(a);c;c=J(a))b+=+E(c);return b},1,1,!0);R(\"translate\",3,!1,!1,function(a,b,c,d){b=P(b,a);c=P(c,a);var e=P(d,a);a={};for(d=0;d\u003Cc.length;d++){ var f=c.charAt(d);f in a||(a[f]=e.charAt(d))}c=\"\";for(d=0;d\u003Cb.length;d++)f=b.charAt(d),c+=f in a?a[f]:f;return c},3);R(\"true\",2,!1,!1,function(){return!0},0);function H(a,b){this.h=a;this.c=l(b)?b:null;this.b=null;switch(a){case \"comment\":this.b=8;break;case \"text\":this.b=3;break;case \"pro cessing-instruction\":this.b=7;break;case \"node\":break;default:throw Error(\"Unexpected argument\");}}function Db(a){return\"comment\"==a||\"text\"==a||\"processing-instruction\"==a||\"node\"==a}H.prototype.a=function(a){return null===this.b||this.b==a.nodeType};H.prototype.f=function(){return this.h} ;\nH.prototype.toString=function(){var a=\"Kind Test: \"+this.h;null===this.c||(a+=L(this.c));return a};function Eb(a){K.call(this,3);this.c=a.substring(1,a.length-1)}t(Eb,K);Eb.prototype.a=function(){return this.c};Eb.prototype.toString=function(){return\"Literal: \"+this.c};function eb(a,b){this.j=a.t oLowerCase();a=\"*\"==this.j?\"*\":\"http://www.w3.org/1999/xhtml\";this.c=b?b.toLowerCase():a}eb.prototype.a=function(a){var b=a.nodeType;if(1!=b&&2!=b)return!1;b=l(a.localName)?a.localName:a.nodeName;return\"*\"!=this.j&&this.j!=b.toLowerCase()?!1:\"*\"==this.c?!0:this.c==(a.namespaceURI?a.namespaceUR I.toLowerCase():\"http://www.w3.org/1999/xhtml\")};eb.prototype.f=function(){return this.j};\neb.prototype.toString=function(){return\"Name Test: \"+(\"http://www.w3.org/1999/xhtml\"==this.c?\"\":this.c+\":\")+this.j};function Fb(a){K.call(this,1);this.c=a}t(Fb,K);Fb.prototype.a=function(){return this.c };Fb.prototype.toString=function(){return\"Number: \"+this.c};function Gb(a,b){K.call(this,a.i);this.h=a;this.c=b;this.g=a.g;this.b=a.b;1==this.c.length&&(a=this.c[0],a.w||a.c!=Hb||(a=a.o,\"*\"!=a.f()&&(this.f={name:a.f(),u:null})))}t(Gb,K);function Ib(){K.call(this,4)}t(Ib,K);Ib.prototype.a=function(a) {var b=new G;a=a.a;9==a.nodeType?b.add(a):b.add(a.ownerDocument);return b};Ib.prototype.toString=function(){return\"Root Helper Expression\"};function Jb(){K.call(this,4)}t(Jb,K);Jb.prototype.a=function(a){var b=new G;b.add(a.a);return b};Jb.prototype.toString=function(){return\"Context Helper Expressio n\"};\nfunction Kb(a){return\"/\"==a||\"//\"==a}Gb.prototype.a=function(a){var b=this.h.a(a);if(!(b instanceof G))throw Error(\"Filter expression must evaluate to nodeset.\");a=this.c;for(var c=0,d=a.length;c\u003Cd&&b.l;c++){var e=a[c],f=I(b,e.c.s);if(e.g||e.c!=Lb)if(e.g||e.c!=Mb){var g=J(f);for(b=e.a( new ha(g));null!=(g=J(f));)g=e.a(new ha(g)),b=lb(b,g)}else g=J(f),b=e.a(new ha(g));else{for(g=J(f);(b=J(f))&&(!g.contains||g.contains(b))&&b.compareDocumentPosition(g)&8;g=b);b=e.a(new ha(g))}}return b};\nGb.prototype.toString=function(){var a=\"Path Expression:\"+L(th15:50:16.296 [AsyncHttpClient-timer -1-1] DEBUG org.asynchttpclient.netty.channel.DefaultChannelPool - Entry count for : http://localhost:58784 : 1 is.h);if(this.c.length){var b=ka(this.c,function(c,d){return c+L(d)},\"Steps:\");a+=L(b)}return a};function Nb(a,b){this.a=a;this.s=!!b}\nfunction zb(a,b,c){for(c=c||0;c\u003Ca.a.length;c++)for(var d=a.a[c],e=I(b),f=b.l,g,h=0;g=J(e);h++){var m=a.s?f-h:h+1;g=d.a(new ha(g,m,f));if(\"number\"==typeof g)m=m ==g;else if(\"string\"==typeof g||\"boolean\"==typeof g)m=!!g;else if(g instanceof G)m=0\u003Cg.l;else throw Error(\"Predicate.evaluate returned an unexpected type.\");if(!m){m=e;g=m.f;var w=m.a;if(!w)throw Error(\"Next must be called at least once before remove.\");var r=w.b;w=w.a;r?r.a=w:g.a=w;w?w.b=r :g.b=r;g.l--;m.a=null}}return b}\nNb.prototype.toString=function(){return ka(this.a,function(a,b){return a+L(b)},\"Predicates:\")};function Ob(a,b,c,d){K.call(this,4);this.c=a;this.o=b;this.h=c||new Nb([]);this.w=!!d;b=this.h;b=0\u003Cb.a.length?b.a[0].f:null;a.I&&b&&(a=b.name,a=z?a.toLowerCase():a,this .f={name:a,u:b.u});a:{a=this.h;for(b=0;b\u003Ca.a.length;b++)if(c=a.a[b],c.g||1==c.i||0==c.i){a=!0;break a}a=!1}this.g=a}t(Ob,K);\nOb.prototype.a=function(a){var b=a.a,c=this.f,d=null,e=null,f=0;c&&(d=c.name,e=c.u?P(c.u,a):null,f=1);if(this.w)if(this.g||this.c!=Pb)if(b=I((new Ob(Qb,new H(\"node\"))).a(a )),c=J(b))for(a=this.m(c,d,e,f);null!=(c=J(b));)a=lb(a,this.m(c,d,e,f));else a=new G;else a=bb(this.o,b,d,e),a=zb(this.h,a,f);else a=this.m(a.a,d,e,f);return a};Ob.prototype.m=function(a,b,c,d){a=this.c.v(this.o,a,b,c);return a=zb(this.h,a,d)};\nOb.prototype.toString=function(){var a=\"Step:\"+L(\"Opera tor: \"+(this.w?\"//\":\"/\"));this.c.j&&(a+=L(\"Axis: \"+this.c));a+=L(this.o);if(this.h.a.length){var b=ka(this.h.a,function(c,d){return c+L(d)},\"Predicates:\");a+=L(b)}return a};function Rb(a,b,c,d){this.j=a;this.v=b;this.s=c;this.I=d}Rb.prototype.toString=function(){return this.j};var Sb={};functio n S(a,b,c,d){if(Sb.hasOwnProperty(a))throw Error(\"Axis already created: \"+a);b=new Rb(a,b,c,!!d);return Sb[a]=b}\nS(\"ancestor\",function(a,b){for(var c=new G;b=b.parentNode;)a.a(b)&&mb(c,b);return c},!0);S(\"ancestor-or-self\",function(a,b){var c=new G;do a.a(b)&&mb(c,b);while(b=b.parentNode);return c},!0);\nvar Hb=S(\"attribute\",function(a,b){var c=new G,d=a.f();if(\"style\"==d&&z&&b.style)return c.add(new Na(b.style,b,\"style\",b.style.cssText)),c;var e=b.attributes;if(e)if(a instanceof H&&null===a.b||\"*\"==d)for(a=0;d=e[a];a++)z?d.nodeValue&&c.add(Oa(b,d)):c.add(d);else(d=e.getNamedItem(d))&&( z?d.nodeValue&&c.add(Oa(b,d)):c.add(d));return c},!1),Pb=S(\"child\",function(a,b,c,d,e){return(z?hb:ib).call(null,a,b,n(c)?c:null,n(d)?d:null,e||new G)},!1,!0);S(\"descendant\",bb,!1,!0);\nvar Qb=S(\"descendant-or-self\",function(a,b,c,d){var e=new G;F(b,c,d)&&a.a(b)&&e.add(b);return bb(a,b,c,d,e)},!1, !0),Lb=S(\"following\",function(a,b,c,d){var e=new G;do for(var f=b;f=f.nextSibling;)F(f,c,d)&&a.a(f)&&e.add(f),e=bb(a,f,c,d,e);while(b=b.parentNode);return e},!1,!0);S(\"following-sibling\",function(a,b){for(var c=new G;b=b.nextSibling;)a.a(b)&&c.add(b);return c},!1);S(\"namespace\",function(){return n ew G},!1);\nvar Tb=S(\"parent\",function(a,b){var c=new G;if(9==b.nodeType)return c;if(2==b.nodeType)return c.add(b.ownerElement),c;b=b.parentNode;a.a(b)&&c.add(b);return c},!1),Mb=S(\"preceding\",function(a,b,c,d){var e=new G,f=[];do f.unshift(b);while(b=b.parentNode);for(var g=1,h=f.length;g\u003Ch;g+ +){var m=[];for(b=f[g];b=b.previousSibling;)m.unshift(b);for(var w=0,r=m.length;w\u003Cr;w++)b=m[w],F(b,c,d)&&a.a(b)&&e.add(b),e=bb(a,b,c,d,e)}return e},!0,!0);\nS(\"preceding-sibling\",function(a,b){for(var c=new G;b=b.previousSibling;)a.a(b)&&mb(c,b);return c},!0);var Ub=S(\"self\",function(a,b){var c =new G;a.a(b)&&c.add(b);return c},!1);function Vb(a){K.call(this,1);this.c=a;this.g=a.g;this.b=a.b}t(Vb,K);Vb.prototype.a=function(a){return-O(this.c,a)};Vb.prototype.toString=function(){return\"Unary Expression: -\"+L(this.c)};function Wb(a){K.call(this,4);this.c=a;qb(this,la(this.c,function(b){return b.g}));rb(this,la(this.c,function(b){return b.b}))}t(Wb,K);Wb.prototype.a=function(a){var b=new G;u(this.c,function(c){c=c.a(a);if(!(c instanceof G))throw Error(\"Path expression must evaluate to NodeSet.\");b=lb(b,c)});return b};Wb.prototype.toString=function(){return ka(this.c,function(a,b){return a+L (b)},\"Union Expression:\")};function Xb(a,b){this.a=a;this.b=b}function Yb(a){for(var b,c=[];;){T(a,\"Missing right hand side of binary expression.\");b=Zb(a);var d=B(a.a);if(!d)break;var e=(d=xb[d]||null)&&d.C;if(!e){a.a.a--;break}for(;c.length&&e\u003C=c[c.length-1].C;)b=new tb(c.pop(),c.pop(),b);c.p ush(b,d)}for(;c.length;)b=new tb(c.pop(),c.pop(),b);return b}function T(a,b){if(Ta(a.a))throw Error(b);}function $b(a,b){a=B(a.a);if(a!=b)throw Error(\"Bad token, expected: \"+b+\" got: \"+a);}\nfunction cc(a){a=B(a.a);if(\")\"!=a)throw Error(\"Bad token: \"+a);}function dc(a){a=B(a.a);if(2>a.length)thr ow Error(\"Unclosed literal string\");return new Eb(a)}\nfunction ec(a){var b=[];if(Kb(A(a.a))){var c=B(a.a);var d=A(a.a);if(\"/\"==c&&(Ta(a.a)||\".\"!=d&&\"..\"!=d&&\"#\"!=d&&\"*\"!=d&&!/(?![0-9])[\\w]/.test(d)))return new Ib;d=new Ib;T(a,\"Missing next location step.\");c=fc(a,c);b.push(c)}else{a:{c=A (a.a);d=c.charAt(0);switch(d){case \"$\":throw Error(\"Variable reference not allowed in HTML XPath\");case \"(\":B(a.a);c=Yb(a);T(a,'unclosed \"(\"');$b(a,\")\");break;case '\"':case \"'\":c=dc(a);break;default:if(isNaN(+c))if(!Db(c)&&/(?![0-9])[\\w]/.test(d)&&\"(\"==A(a.a,1)){c=B(a.a);\nc=Cb[c]||null; B(a.a);for(d=[];\")\"!=A(a.a);){T(a,\"Missing function argument list.\");d.push(Yb(a));if(\",\"!=A(a.a))break;B(a.a)}T(a,\"Unclosed function argument list.\");cc(a);c=new Ab(c,d)}else{c=null;break a}else c=new Fb(+B(a.a))}\"[\"==A(a.a)&&(d=new Nb(gc(a)),c=new yb(c,d))}if(c)if(Kb(A(a.a)))d=c;else return c;else c=fc(a,\"/\"),d=new Jb,b.push(c)}for(;Kb(A(a.a));)c=B(a.a),T(a,\"Missing next location step.\"),c=fc(a,c),b.push(c);return new Gb(d,b)}\nfunction fc(a,b){if(\"/\"!=b&&\"//\"!=b)throw Error('Step op should be \"/\" or \"//\"');if(\".\"==A(a.a)){var c=new Ob(Ub,new H(\"node\"));B(a.a);return c}if(\ "..\"==A(a.a))return c=new Ob(Tb,new H(\"node\")),B(a.a),c;if(\"#\"==A(a.a)){var d=Hb;B(a.a);T(a,\"Missing attribute name\")}else if(\"::\"==A(a.a,1)){if(!/(?![0-9])[\\w]/.test(A(a.a).charAt(0)))throw Error(\"Bad token: \"+B(a.a));var e=B(a.a);d=Sb[e]||null;if(!d)throw Request DefaultHttpRequest(decodeResult: success, version: HTTP/1.1) POST /session/9182a3b9b367201e4bf5ce781ece3893/execute/sync HTTP/1.1 User-Agent: selenium/4.0.0-alpha-6 (java windows) Content-Length: 49163 Content-Type: application/json; charset=utf-8 host: localhost:21110 accept: */* The top set of output I believe comes from executing javascript to click elements on a page and the output at the bottom comes from a library called netty that logs API requests. Is there anyway to remove this output or the libraries that cause it using maven?
Unexpected string in JSON while parsing XML
I am trying to read the clob which is basically XML from Oracle DB and populate in AngularJS UI Grid. I am doing the same with JSON and is working perfectly fine. JSON response from backend {"events":{"ORDER_NO":"BBY01-100000709660","ORDER_HEADER_KEY":"2020040811522311790606 ","CREATETS":"2020-04-08 11:52:47","TMPLT_NM":"EOMS_0194 ","EMAIL_XML":"<email CommunicationType=\"Email\" SourceSystem=\"OMS\" TemplatePageZone=\"\" brand=\"BESTBUY\" channel=\"BESTBUY\" emailAddr=\"test.tester#bestbuy.com\" template=\"EOMS_0178_TEST\">"" <name firstName=\"Test\" lastName=\"\" middleInitial=\"\"/>"" <order ATGID=\"ATG28268080246\" IsSuppressRequired=\"Y\" LoggedInFlag=\"Y\" LoyaltyID=\"0160140134\" OrderName=\"MSFTAllAccess\" PartyID=\"123456\" PriorityNumber=\"160140134\" customerPhoneNo=\"6515554321\" hasActivatedDevice=\"N\" orderDate=\"01/28/2020\" orderHeaderKey=\"2020012813423582265743\" orderIdATG=\"BBY01-1MT2010012802\" orderStatusLinkDisplayFlag=\"Y\" orderTotal=\"0.00\" orderTotalMinusCoupons=\"0.00\" partnerID=\"\" partnerOrderNo=\"MAV513281qweq1\" salesSource=\"BBYC\" shippingTotal=\"0.00\" taxTotal=\"0.00\">"" <creditCard cardType=\"\" number=\"\"/>"" <digitalCoupons digitalCouponTotal=\"0.00\"/>"" <lineItems>"" <lineItem CustPromiseDate=\"02/26/2020\" CustPromiseType=\"InHandDate\" availabilityMsg=\"\" beginEstArrivalDate=\"02/24/2020\" conditionVariableOne=\"\" conditionVariableTwo=\"\" description=\"Microsoft Surface Pro 3 12 Intel Core i7 256GB Silver\" endEstArrivalDate=\"02/26/2020\" expectedShipDays=\"\" format=\"\" giftPackaging=\"N\" inHandDate=\"02/26/2020\" itemID=\"\" itemShortDesc=\"Microsoft Surface Pro 3 12 Intel Core i7 256GB Silver\" lineItemProductTotal=\"0.00\" lineItemShippingCost=\"0.00\" merchClass=\"\" modelNo=\"1000186097\" orderLineKey=\"2020021911334791500160\" oversizeFlag=\"\" pickupDate=\"\" preOrder=\"\" primeLine=\"1\" productLine=\"6.403.635\" quantity=\"1\" releaseDate=\"\" reshipReasonCode=\"RESHIP_DAMAGED_ITEM\" shipDate=\"\" shippingMethod=\"\" signatureRequiredFlag=\"N\" sku=\"9248206\" status=\"\" subLine=\"1\" tax=\"0.00\" total=\"0.00\" unitPrice=\"0.00\" unitShippingCost=\"0.00\">"" <shippingAddr city=\"RICHFIELD\" line1=\"1000 W 78TH ST\" line2=\"\" state=\"MN\" zip=\"55423\">"" <name firstName=\"Test\" lastName=\"Tester\" middleInitial=\"\"/>"" </shippingAddr>"" <allowance allowanceAmt=\"0.00\" reason=\"\"/>"" <return date=\"\" lineQty=\"\" lineTotal=\"0.00\" productCredit=\"0.00\" reason=\"\" restockingFee=\"0.00\" shippingCredit=\"0.00\" taxCredit=\"0.00\"/>"" <cancel backOrderExtendedXNumDays=\"\" reason=\"\"/>"" <ros actualDeliveryDate=\"\" pickupDate=\"\"/>"" <store storeName=\"\" storeNum=\"\"/>"" <psp plan=\"\"/>"" <carriers>"" <carrier los=\"\" name=\"\" quantity=\"\" trackingNum=\"\"/>"" </carriers>"" </lineItem>"" </lineItems>"" <makeGood makeGoodFlag=\"N\"/>"" </order>"" <account atgProfileId=\"\" cirisID=\"\" info=\"\" password=\"\"/>"" <comments/>""</email>"}} Whenever i am trying to read the values it is throwing exception Unexpected string in JSON at position 372 at JSON.parse (<anonymous>) Below is the AJAX response code: $http.get(url).then(function(response) { if(response.data.events == null || response.data.events == undefined || response.data.events == "undefined"){ $("#loader1").hide(); $scope.close = true; $scope.responseMessage = ""; $scope.gridOptions1.data.length=0; $scope.errorMessage = "Order not found!!!!"; }else{ console.log("1"); $("#loader1").hide(); var responseNew = JSON.stringify(response.data.events); $scope.gridOptions1.data = responseNew; $scope.mySelectedRows = $scope.gridApi.selection.getSelectedRows(); $scope.close = true; $scope.errorMessage = ""; $scope.responseMessage = "Order details fetched successfully"; } }, function(response) { $("#loader1").hide(); $scope.close = true; $scope.responseMessage = ""; $scope.gridOptions.data.length=0; $scope.gridOptions1.data.length=0; });
There's one double quote extra here: Parse error on line 1: ...\"EOMS_0178_TEST\">"" <name firstName... -----------------------^ Expecting 'EOF', '}', ':', ',', ']', got 'STRING'
use JSON.parse instead of JSON.stringify. The response you're getting from back-end (the one you mentioned above) is already a stringified JSON, you have to parse it out to read the values.
The above issue waswhile storing the xml in DB. since the new elements had spaces in between. it was considering that as a string and was getting appended with double quotes in JSON.
Netconf: Not able to perform getConfig()
We have a netconf enabled router and I am able to perform get/get-config operations using Mg-Soft client browser. This is the output of getConfig() - REQ: <nc:get-config xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"> <nc:source> <nc:running/> </nc:source> </nc:get-config> RESP: <?xml version="1.0" encoding="utf-8"?> <data xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <configure xmlns="urn:nokia.com:sros:ns:yang:sr:conf"> <qos> <sap-ingress> ..... </data> But I am unable to perform the same operation using tailf Netconf client. Here is my code - public class Client { public static void main(String args[]) throws JNCException, ParserConfigurationException, SAXException, IOException { DeviceUser deviceUser; String deviceUserName = "user"; deviceUser = new DeviceUser(deviceUserName, "admin", "admin"); Device device = new Device("simulator", deviceUser, "10.135.16.13", 830); device.connect(deviceUserName); device.newSession(new Subscriber("simulator"), "mySession"); NetconfSession session = device.getSession("mySession"); NodeSet config = session.getConfig(NetconfSession.RUNNING); String xmlString = config.toXMLString(); session.closeSession(); System.out.println(xmlString); } } class Subscriber extends IOSubscriber { String devName; public static boolean rawMode = false; Subscriber(String devName) { super(rawMode); this.devName = devName; } public void input(String data) { System.out.println("RECV: " + data); } public void output(String data) { System.out.println("SEND: " + data); } } I am getting the following in the eclipse console - SEND: <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> </capabilities> </hello> RECV: <hello xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <capabilities> <capability>urn:ietf:params:netconf:base:1.0</capability> <capability>urn:ietf:params:netconf:base:1.1</capability> <capability>urn:ietf:params:netconf:capability:writable-running:1.0</capability> <capability>urn:ietf:params:netconf:capability:candidate:1.0</capability> <capability>urn:ietf:params:netconf:capability:validate:1.0</capability> <capability>urn:ietf:params:netconf:capability:validate:1.1</capability> <capability>urn:ietf:params:netconf:capability:startup:1.0</capability> <capability>urn:ietf:params:netconf:capability:url:1.0?scheme=ftp,tftp,file</capability> <capability>urn:ietf:params:netconf:capability:with-defaults:1.0?basic-mode=trim&also-supported=report-all</capability> <capability>urn:ietf:params:xml:ns:netconf:base:1.0?module=ietf-netconf&revision=2011-06-01&features=writable-running,validate,startup,url&deviations=alu-netconf-deviations-r13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:netconf-deviations-r13?module=alu-netconf-deviations-r13&revision=2015-01-23</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:cli-content-layer-r13?module=alu-cli-content-layer-r13&revision=2015-01-23</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-r13?module=alu-conf-r13&revision=2016-06-24</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-aaa-r13?module=alu-conf-aaa-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-aa-r13?module=alu-conf-aa-r13&revision=2016-06-23</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-calltrace-r13?module=alu-conf-calltrace-r13&revision=2016-04-27</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-card-r13?module=alu-conf-card-r13&revision=2015-10-30</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-cflowd-r13?module=alu-conf-cflowd-r13&revision=2015-01-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-conn-prof-r13?module=alu-conf-conn-prof-r13&revision=2015-11-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-con-profvlan-r13?module=alu-conf-con-profvlan-r13&revision=2015-08-28</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-eth-cfm-r13?module=alu-conf-eth-cfm-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-eth-ring-r13?module=alu-conf-eth-ring-r13&revision=2014-10-17</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-eth-tunnel-r13?module=alu-conf-eth-tunnel-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-filter-r13?module=alu-conf-filter-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-gmpls-tunnel-r13?module=alu-conf-gmpls-tunnel-r13&revision=2014-12-09</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-ifgrphandler-r13?module=alu-conf-ifgrphandler-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-isa-r13?module=alu-conf-isa-r13&revision=2016-02-29</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-lag-r13?module=alu-conf-lag-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-li-r13?module=alu-conf-li-r13&revision=2016-04-21</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-log-r13?module=alu-conf-log-r13&revision=2016-06-01</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-mcastmgmt-r13?module=alu-conf-mcastmgmt-r13&revision=2015-03-12</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-mirror-r13?module=alu-conf-mirror-r13&revision=2016-01-08</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-oam-pm-r13?module=alu-conf-oam-pm-r13&revision=2015-11-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-open-flow-r13?module=alu-conf-open-flow-r13&revision=2015-11-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-r13?module=alu-conf-port-r13&revision=2015-08-27</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-access-r13?module=alu-conf-port-access-r13&revision=2014-10-31</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-aps-r13?module=alu-conf-port-aps-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-ethernet-r13?module=alu-conf-port-ethernet-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-mbundle-r13?module=alu-conf-port-mbundle-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-network-r13?module=alu-conf-port-network-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-sonetsdh-r13?module=alu-conf-port-sonetsdh-r13&revision=2015-06-11</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-r13?module=alu-conf-port-tdm-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-ds1-r13?module=alu-conf-port-tdm-ds1-r13&revision=2014-12-15</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-ds3-r13?module=alu-conf-port-tdm-ds3-r13&revision=2014-12-15</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-e1-r13?module=alu-conf-port-tdm-e1-r13&revision=2014-12-15</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-tdm-e3-r13?module=alu-conf-port-tdm-e3-r13&revision=2014-12-15</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-port-policy-r13?module=alu-conf-port-policy-r13&revision=2015-12-09</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-pxc-r13?module=alu-conf-pxc-r13&revision=2015-04-24</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-python-r13?module=alu-conf-python-r13&revision=2016-06-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-qos-r13?module=alu-conf-qos-r13&revision=2016-04-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-redundancy-r13?module=alu-conf-redundancy-r13&revision=2016-03-25</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-r13?module=alu-conf-router-r13&revision=2016-05-09</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-bgp-r13?module=alu-conf-router-bgp-r13&revision=2016-06-06</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-dhcps-r13?module=alu-conf-router-dhcps-r13&revision=2015-09-21</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-dhcp6-r13?module=alu-conf-router-dhcp6-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-fspec-r13?module=alu-conf-router-fspec-r13&revision=2015-12-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-gmpls-r13?module=alu-conf-router-gmpls-r13&revision=2015-11-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-igmp-r13?module=alu-conf-router-igmp-r13&revision=2015-11-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-if-r13?module=alu-conf-router-if-r13&revision=2016-04-29</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-isis-r13?module=alu-conf-router-isis-r13&revision=2016-02-18</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-l2tp-r13?module=alu-conf-router-l2tp-r13&revision=2016-05-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-ldp-r13?module=alu-conf-router-ldp-r13&revision=2016-05-02</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-lmp-r13?module=alu-conf-router-lmp-r13&revision=2015-09-08</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-mccacpl-r13?module=alu-conf-router-mccacpl-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-mld-r13?module=alu-conf-router-mld-r13&revision=2015-09-22</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-mpls-r13?module=alu-conf-router-mpls-r13&revision=2016-04-28</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-mpls-tp-r13?module=alu-conf-router-mpls-tp-r13&revision=2015-11-09</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-nat-r13?module=alu-conf-router-nat-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-ogvalid-r13?module=alu-conf-router-ogvalid-r13&revision=2015-11-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-ospf-r13?module=alu-conf-router-ospf-r13&revision=2016-06-22</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-ospf3-r13?module=alu-conf-router-ospf3-r13&revision=2016-06-22</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-pcep-r13?module=alu-conf-router-pcep-r13&revision=2016-03-07</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-pim-r13?module=alu-conf-router-pim-r13&revision=2016-06-07</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-policy-r13?module=alu-conf-router-policy-r13&revision=2016-05-19</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-radprox-r13?module=alu-conf-router-radprox-r13&revision=2015-11-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-rip-r13?module=alu-conf-router-rip-r13&revision=2015-06-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-nhroute-r13?module=alu-conf-router-nhroute-r13&revision=2014-09-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-radvert-r13?module=alu-conf-router-radvert-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-rsvp-r13?module=alu-conf-router-rsvp-r13&revision=2015-06-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-wlan-r13?module=alu-conf-router-wlan-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-router-wpp-r13?module=alu-conf-router-wpp-r13&revision=2015-03-04</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-saa-r13?module=alu-conf-saa-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-service-r13?module=alu-conf-service-r13&revision=2016-03-23</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-apipe-r13?module=alu-conf-svc-apipe-r13&revision=2016-02-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-cpipe-r13?module=alu-conf-svc-cpipe-r13&revision=2016-02-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-cust-r13?module=alu-conf-svc-cust-r13&revision=2015-09-23</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-dynsrv-r13?module=alu-conf-svc-dynsrv-r13&revision=2015-09-11</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-egrmcgroup-r13?module=alu-conf-svc-egrmcgroup-r13&revision=2015-09-11</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-epipe-r13?module=alu-conf-svc-epipe-r13&revision=2016-06-27</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-fpipe-r13?module=alu-conf-svc-fpipe-r13&revision=2016-02-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ies-r13?module=alu-conf-svc-ies-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ies-if-r13?module=alu-conf-svc-ies-if-r13&revision=2016-06-27</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ies-subif-r13?module=alu-conf-svc-ies-subif-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ipfix-r13?module=alu-conf-svc-ipfix-r13&revision=2014-09-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-ipipe-r13?module=alu-conf-svc-ipipe-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-nat-r13?module=alu-conf-svc-nat-r13&revision=2016-04-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-sdp-r13?module=alu-conf-svc-sdp-r13&revision=2016-05-09</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-template-r13?module=alu-conf-svc-template-r13&revision=2016-04-06</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-upnp-r13?module=alu-conf-svc-upnp-r13&revision=2015-09-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-r13?module=alu-conf-svc-vpls-r13&revision=2016-06-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-igmp-r13?module=alu-conf-svc-vpls-igmp-r13&revision=2014-09-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-macmo-r13?module=alu-conf-svc-vpls-macmo-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-macpr-r13?module=alu-conf-svc-vpls-macpr-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-meshs-r13?module=alu-conf-svc-vpls-meshs-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-mld-r13?module=alu-conf-svc-vpls-mld-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-pim-r13?module=alu-conf-svc-vpls-pim-r13&revision=2015-07-07</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-sap-r13?module=alu-conf-svc-vpls-sap-r13&revision=2016-06-27</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-split-r13?module=alu-conf-svc-vpls-split-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-spoke-r13?module=alu-conf-svc-vpls-spoke-r13&revision=2016-06-13</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-spb-r13?module=alu-conf-svc-vpls-spb-r13&revision=2016-02-04</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vpls-stp-r13?module=alu-conf-svc-vpls-stp-r13&revision=2014-09-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-r13?module=alu-conf-svc-vprn-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-bgp-r13?module=alu-conf-svc-vprn-bgp-r13&revision=2016-05-04</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-dhcps-r13?module=alu-conf-svc-vprn-dhcps-r13&revision=2015-09-21</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-dhcp6-r13?module=alu-conf-svc-vprn-dhcp6-r13&revision=2016-06-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-fspec-r13?module=alu-conf-svc-vprn-fspec-r13&revision=2016-02-11</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-igmp-r13?module=alu-conf-svc-vprn-igmp-r13&revision=2015-11-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-if-r13?module=alu-conf-svc-vprn-if-r13&revision=2016-06-27</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-isis-r13?module=alu-conf-svc-vprn-isis-r13&revision=2016-02-18</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-l2tp-r13?module=alu-conf-svc-vprn-l2tp-r13&revision=2016-05-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-mld-r13?module=alu-conf-svc-vprn-mld-r13&revision=2015-10-14</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-nat-r13?module=alu-conf-svc-vprn-nat-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-nwif-r13?module=alu-conf-svc-vprn-nwif-r13&revision=2016-04-29</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svs-vprn-ntp-r13?module=alu-conf-svs-vprn-ntp-r13&revision=2015-05-05</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-ospf-r13?module=alu-conf-svc-vprn-ospf-r13&revision=2016-06-22</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-ospf3-r13?module=alu-conf-svc-vprn-ospf3-r13&revision=2016-06-22</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-pim-r13?module=alu-conf-svc-vprn-pim-r13&revision=2015-08-17</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-ptp-r13?module=alu-conf-svc-vprn-ptp-r13&revision=2015-05-22</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-vprn-radprox-r13?module=alu-conf-vprn-radprox-r13&revision=2015-06-23</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-rip-r13?module=alu-conf-svc-vprn-rip-r13&revision=2015-06-03</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-ripng-r13?module=alu-conf-svc-vprn-ripng-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-radv-r13?module=alu-conf-svc-vprn-radv-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-srcad-r13?module=alu-conf-svc-vprn-srcad-r13&revision=2015-01-27</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-spoke-r13?module=alu-conf-svc-vprn-spoke-r13&revision=2015-12-17</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-subif-r13?module=alu-conf-svc-vprn-subif-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-wlan-r13?module=alu-conf-svc-vprn-wlan-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-svc-vprn-wpp-r13?module=alu-conf-svc-vprn-wpp-r13&revision=2015-03-04</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sflow-r13?module=alu-conf-sflow-r13&revision=2014-09-26</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sfm-r13?module=alu-conf-sfm-r13&revision=2014-10-20</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-subscrmgmt-r13?module=alu-conf-subscrmgmt-r13&revision=2016-06-27</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-submgmt-ludb-r13?module=alu-conf-submgmt-ludb-r13&revision=2016-06-14</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-submgmt-wlangw-r13?module=alu-conf-submgmt-wlangw-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-system-r13?module=alu-conf-system-r13&revision=2016-06-08</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sys-pwrmgmt-r13?module=alu-conf-sys-pwrmgmt-r13&revision=2015-05-25</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sys-ptp-r13?module=alu-conf-sys-ptp-r13&revision=2015-06-25</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-sys-sec-r13?module=alu-conf-sys-sec-r13&revision=2016-06-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-vrrp-r13?module=alu-conf-vrrp-r13&revision=2015-10-14</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:conf-vsm-r13?module=alu-conf-vsm-r13&revision=2015-09-16</capability> <capability>urn:alcatel-lucent.com:sros:ns:yang:types?module=alu-types&revision=2015-01-19</capability> <capability>urn:nokia.com:sros:ns:yang:sr:conf?module=nokia-conf&revision=2016-01-01</capability> <capability>urn:nokia.com:sros:ns:yang:sr:sros-yang-extensions?module=nokia-sros-yang-extensions&revision=2016-01-01</capability> <capability>urn:nokia.com:sros:ns:yang:sr:types-filter?module=nokia-types-filter&revision=2016-01-01</capability> <capability>urn:nokia.com:sros:ns:yang:sr:types-qos?module=nokia-types-qos&revision=2016-01-01</capability> <capability>urn:nokia.com:sros:ns:yang:sr:types-services?module=nokia-types-services&revision=2016-01-01</capability> <capability>urn:nokia.com:sros:ns:yang:sr:types-sros?module=nokia-types-sros&revision=2016-01-01</capability> <capability>urn:nokia.com:sros:ns:yang:sr:major-release-14</capability> </capabilities> <session-id>52</session-id> </hello> SEND: <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:message-id="1"> <nc:get-config> <nc:source> <nc:running/> </nc:source> </nc:get-config> </nc:rpc> RECV: <?xml version="1.0" encoding="UTF-8"?> <rpc-reply urn:ietf:params:xml:ns:netconf:base:1.0:message-id="1" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>rpc</error-type> <error-tag>missing-attribute</error-tag> <error-severity>error</error-severity> <error-info> <bad-element>message-id</bad-element> <bad-element>rpc</bad-element> </error-info> <error-message> Check that message-id attribute is present and less than 4096 characters </error-message> </rpc-error> </rpc-reply> [Fatal Error] :2:20: Attribute name "urn:ietf" associated with an element type "rpc-reply" must be followed by the ' = ' character. [Fatal Error] :2:20: Attribute name "urn:ietf" associated with an element type "rpc-reply" must be followed by the ' = ' character. org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 20; Attribute name "urn:ietf" associated with an element type "rpc-reply" must be followed by the ' = ' character. at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1239) at com.tailf.jnc.YangXMLParser.parse(YangXMLParser.java:50) at com.tailf.jnc.XMLParser.parse(XMLParser.java:154) at com.tailf.jnc.NetconfSession.recv_rpc_reply(NetconfSession.java:1495) at com.tailf.jnc.NetconfSession.recv_rpc_reply_data(NetconfSession.java:1472) at com.tailf.jnc.NetconfSession.getConfig(NetconfSession.java:443) at client.Client.main(Client.java:51) Exception in thread "main" Parse error: parse error: org.xml.sax.SAXParseException; lineNumber: 2; columnNumber: 20; Attribute name "urn:ietf" associated with an element type "rpc-reply" must be followed by the ' = ' character. at com.tailf.jnc.YangXMLParser.parse(YangXMLParser.java:54) at com.tailf.jnc.XMLParser.parse(XMLParser.java:154) at com.tailf.jnc.NetconfSession.recv_rpc_reply(NetconfSession.java:1495) at com.tailf.jnc.NetconfSession.recv_rpc_reply_data(NetconfSession.java:1472) at com.tailf.jnc.NetconfSession.getConfig(NetconfSession.java:443) at client.Client.main(Client.java:51)
You actually seem to have two problems, neither of which appear to be your fault. The get-config request from JNC seems to be malformed: message-id attribute should be in the default namespace, not in NETCONF message namespace. SEND: <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" nc:message-id="1"> <nc:get-config> <nc:source> <nc:running/> </nc:source> </nc:get-config> </nc:rpc> Should actually be: SEND: <nc:rpc xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="1"> <nc:get-config> <nc:source> <nc:running/> </nc:source> </nc:get-config> </nc:rpc> The second problem is your server, which appears to be unable to handle this malformed request - and is responding with a malformed message (it is not even an XML message): RECV: <?xml version="1.0" encoding="UTF-8"?> <rpc-reply urn:ietf:params:xml:ns:netconf:base:1.0:message-id="1" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>rpc</error-type> <error-tag>missing-attribute</error-tag> <error-severity>error</error-severity> <error-info> <bad-element>message-id</bad-element> <bad-element>rpc</bad-element> </error-info> <error-message> Check that message-id attribute is present and less than 4096 characters </error-message> </rpc-error> </rpc-reply> It should be responding with: RECV: <?xml version="1.0" encoding="UTF-8"?> <rpc-reply nc:message-id="1" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>rpc</error-type> <error-tag>missing-attribute</error-tag> <error-severity>error</error-severity> <error-info> <bad-element>message-id</bad-element> <bad-element>rpc</bad-element> </error-info> <error-message> Check that message-id attribute is present and less than 4096 characters </error-message> </rpc-error> </rpc-reply> since it is supposed to return all attributes verbatim. Otherwise, this would be standard behavior when a message without a message-id attribute is sent to a server. Relevant RFC4741 text below (the same applies to RFC6241, NETCONF 1.1). Section 4.1: The <rpc> element has a mandatory attribute "message-id", which is an arbitrary string chosen by the sender of the RPC that will commonly encode a monotonically increasing integer. The receiver of the RPC does not decode or interpret this string but simply saves it to be used as a "message-id" attribute in any resulting <rpc-reply> message. For example: <rpc message-id="101" xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <some-method> <!-- method parameters here... --> </some-method> </rpc> If additional attributes are present in an <rpc> element, a NETCONF peer MUST return them unmodified in the <rpc-reply> element. Section 4.3 An error is returned if an <rpc> element is received without a message-id attribute. Note that only in this case is it acceptable for the NETCONF peer to omit the message-id attribute in the <rpc-reply> element. <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <get-config> <source> <running/> </source> </get-config> </rpc> <rpc-reply xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> <rpc-error> <error-type>rpc</error-type> <error-tag>missing-attribute</error-tag> <error-severity>error</error-severity> <error-info> <bad-attribute>message-id</bad-attribute> <bad-element>rpc</bad-element> </error-info> </rpc-error> </rpc-reply> So I believe you should be reporting two issues to both the maker of the device and to creators of JNC. The reason it is working with the MG-SOFT client is that it sends a proper message-id attribute, so your case never happens.
SoapUI: response with CDATA is giving null. searched various article but no luck
Hello I have below SOAP reponse. ` <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> <GetWeatherResponse xmlns="http://www.webserviceX.NET"> <GetWeatherResult><![CDATA[<?xml version="1.0" encoding="utf-16"?> <CurrentWeather> <Location>Cape Town, Cape Town International Airport, South Africa (FACT) 33-59S 018-36E 0M</Location> <Time>Jun 04, 2016 - 05:00 AM EDT / 2016.06.04 0900 UTC</Time> <Wind> from the SE (130 degrees) at 21 MPH (18 KT):0</Wind> <Visibility> greater than 7 mile(s):0</Visibility> <SkyConditions> mostly clear</SkyConditions> <Temperature> 60 F (16 C)</Temperature> <DewPoint> 44 F (7 C)</DewPoint> <RelativeHumidity> 55%</RelativeHumidity> <Pressure> 30.39 in. Hg (1029 hPa)</Pressure> <Status>Success</Status> </CurrentWeather>]]></GetWeatherResult> </GetWeatherResponse> </soap:Body> </soap:Envelope>"` for the following request: http://www.webservicex.net/globalweather.asmx. I want to read XML Data in above response using script. but it is giving null. I have tried script as below def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def holder = groovyUtils.getXmlHolder(messageExchange.responseContent) holder.namespaces["ns"] = "http://www.webserviceX.NET/" def weatherinfo= holder.getNodeValue("//ns:GetWeatherResult/text()") log.info weatherinfo bit Instead of getting above reponse I am getting NULL. I have read the SOAPUI documentation on CDATA but its not working.
I got answer. It was just one extra slash in namespace that was giving me null. Both the below scripts are working now. > def respXmlHolder = new > com.eviware.soapui.support.XmlHolder(messageExchange.getResponseContentAsXml()) > respXmlHolder.namespaces["ns1"] ="http://www.webserviceX.NET" def > CDATAXml= respXmlHolder.getNodeValue("//ns1:GetWeatherResult/text()") > log.info CDATAXml def groovyUtils = new com.eviware.soapui.support.GroovyUtils(context) def holder = groovyUtils.getXmlHolder(messageExchange.responseContent) holder.namespaces["ns"] = "http://www.webserviceX.NET" def weatherinfo= holder.getNodeValue("//ns:GetWeatherResult/text()") log.info weatherinfo
How do I create a product with additional attributes in Magento via Soap/Java
Good day! I would like to use the Magento’s SOAP API to manage the product catalog, attributes etc. I'm running following configuration:- Magento 1.6 Soap API WS-I compliance Mac OSX Lion Mamp 2.0.5 In case someone wants to create a new product, it is necessary to set a few properties of the product object. Following code will demonstrate my approach to do this : public int createProduct(DatabaseProduct product) { ArrayOfString categories = new ArrayOfString(); categories.getComplexObjectArray().add(categoryID); createEntity.setCategoryIds(categories); CatalogProductCreateEntity createEntity = populateCreateOrUpdateEntity(product); CatalogProductCreateRequestParam param = new CatalogProductCreateRequestParam(); param.setSessionId(sessionId); param.setSet(setId); param.setSku(product.getSku()); param.setType("simple"); param.setStore(storeId); param.setProductData(createEntity); CatalogProductCreateResponseParam response = service.catalogProductCreate(param); return response.getResult(); } private CatalogProductCreateEntity populateCreateOrUpdateEntity(DatabaseProduct product) { CatalogProductCreateEntity createEntity = new CatalogProductCreateEntity(); createEntity.setShortDescription(product.getDescription().substring(0, 20) + "..."); createEntity.setDescription(product.getDescription()); createEntity.setName(product.getName()); createEntity.setPrice(String.valueOf(product.getPrice())); createEntity.setStatus("1"); //active createEntity.setVisibility("4"); //visible in search/catalog createEntity.setWeight("70"); //some value createEntity.setTaxClassId("2"); //standard AssociativeArray attributes = new AssociativeArray(); AssociativeEntity attr1 = new AssociativeEntity(); attr1.("attribute1_key"; attr1.("attribute1_value"); attributes.getComplexObjectArray().add(attr1); AssociativeEntity attr2 = new AssociativeEntity(); attr2.("attribute2_key"); attr2.("attribute2_value"); attributes.getComplexObjectArray().add(attr2); createEntity.setAdditionalAttributes(attributes); return createEntity; } I realized that I get an error written to the "system.log" of Magento. 2012-01-21T09:41:01+00:00 DEBUG (7): First parameter must either be an object or the name of an existing class/opt/website/magento/app/code/core/Mage/Catalog/Model/Product/Api/V2.php I could localize the error in the "V2.php" file on line 265. According to the php.net documentation the "property_exists()" method only can check for fields in objects. As a matter of fact the "$productData" variable holds a property called "additional_attributes" which is of the type array. Therefore the execution of this code will lead to an error. Moreover I don’t know to reproduce the object the structure of the "$productData" object through the use of Magento’s SOAP API V2. If I examine this code ("foreach" loop) in line 270, it indicates that there is an object ("$productData") holding an array ("additional_attributes") which again shall encapsulate a set of key/value pairs (if I am right) 253 protected function _prepareDataForSave ($product, $productData) 254 { 255 if (property_exists($productData, 'website_ids') && is_array($productData->website_ids)) { 256 $product->setWebsiteIds($productData->website_ids); 257 } 258 259 Mage::log("debug1"); 260 Mage::log(property_exists($productData, 'additional_attributes')); 261 262 Mage::log($productData); 263 264 if (property_exists($productData, 'additional_attributes')) { 265 if (property_exists($productData->additional_attributes, 'single_data')) { 266 267 Mage::log("---> single"); 268 Mage::log($productData->additional_attributes); 269 270 foreach ($productData->additional_attributes->single_data as $_attribute) { 271 $_attrCode = $_attribute->key; 272 $productData->$_attrCode = $_attribute->value; 273 } 274 } 275 if (property_exists($productData->additional_attributes, 'multi_data')) { 276 277 Mage::log("---> multi"); 278 Mage::log($productData->additional_attributes); 279 280 foreach ($productData->additional_attributes->multi_data as $_attribute) { 281 $_attrCode = $_attribute->key; 282 $productData->$_attrCode = $_attribute->value; 283 } 284 } 285 286 Mage::log("debugXXX"); 287 unset($productData->additional_attributes); 288 } 289 290 Mage::log("debug2"); 291 292 foreach ($product->getTypeInstance(true)->getEditableAttributes($product) as $attribute) { 293 $_attrCode = $attribute->getAttributeCode(); 294 if ($this->_isAllowedAttribute($attribute) && (isset($productData->$_attrCode))) { 295 $product->setData( 296 ... etc ... This seems to be a bug. So here is my question. Am I going right to call this an programming issue which shall be posted in the bug base? Is there a way to get over this issue? Shall I rewrite parts of the php.code from above to satisfy my need to handle product information to create a product properly ? Thanks in advance $productData ( [name] => testname [description] => testdescription [short_description] => shorttestdescription [weight] => 70 [status] => 1 [visibility] => 4 [price] => 359.0 [tax_class_id] => 2 [additional_attributes] => Array ( [attribute1] => 999.0 [attribute2] => testcontent ) ) the CatalogProductCreate-Call from the WSDL generated by SoapUI: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento"> <soapenv:Header/> <soapenv:Body> <urn:catalogProductCreateRequestParam> <sessionId>?</sessionId> <type>?</type> <set>?</set> <sku>?</sku> <productData> <!--Optional:--> <categories> <!--Zero or more repetitions:--> <complexObjectArray>?</complexObjectArray> </categories> <!--Optional:--> <websites> <!--Zero or more repetitions:--> <complexObjectArray>?</complexObjectArray> </websites> <!--Optional:--> <name>?</name> <!--Optional:--> <description>?</description> <!--Optional:--> <short_description>?</short_description> <!--Optional:--> <weight>?</weight> <!--Optional:--> <status>?</status> <!--Optional:--> <url_key>?</url_key> <!--Optional:--> <url_path>?</url_path> <!--Optional:--> <visibility>?</visibility> <!--Optional:--> <category_ids> <!--Zero or more repetitions:--> <complexObjectArray>?</complexObjectArray> </category_ids> <!--Optional:--> <website_ids> <!--Zero or more repetitions:--> <complexObjectArray>?</complexObjectArray> </website_ids> <!--Optional:--> <has_options>?</has_options> <!--Optional:--> <gift_message_available>?</gift_message_available> <!--Optional:--> <price>?</price> <!--Optional:--> <special_price>?</special_price> <!--Optional:--> <special_from_date>?</special_from_date> <!--Optional:--> <special_to_date>?</special_to_date> <!--Optional:--> <tax_class_id>?</tax_class_id> <!--Optional:--> <tier_price> <!--Zero or more repetitions:--> <complexObjectArray> <!--Optional:--> <customer_group_id>?</customer_group_id> <!--Optional:--> <website>?</website> <!--Optional:--> <qty>?</qty> <!--Optional:--> <price>?</price> </complexObjectArray> </tier_price> <!--Optional:--> <meta_title>?</meta_title> <!--Optional:--> <meta_keyword>?</meta_keyword> <!--Optional:--> <meta_description>?</meta_description> <!--Optional:--> <custom_design>?</custom_design> <!--Optional:--> <custom_layout_update>?</custom_layout_update> <!--Optional:--> <options_container>?</options_container> <!--Optional:--> <additional_attributes> <!--Zero or more repetitions:--> <complexObjectArray> <key>?</key> <value>?</value> </complexObjectArray> </additional_attributes> <!--Optional:--> <stock_data> <!--Optional:--> <qty>?</qty> <!--Optional:--> <is_in_stock>?</is_in_stock> <!--Optional:--> <manage_stock>?</manage_stock> <!--Optional:--> <use_config_manage_stock>?</use_config_manage_stock> <!--Optional:--> <min_qty>?</min_qty> <!--Optional:--> <use_config_min_qty>?</use_config_min_qty> <!--Optional:--> <min_sale_qty>?</min_sale_qty> <!--Optional:--> <use_config_min_sale_qty>?</use_config_min_sale_qty> <!--Optional:--> <max_sale_qty>?</max_sale_qty> <!--Optional:--> <use_config_max_sale_qty>?</use_config_max_sale_qty> <!--Optional:--> <is_qty_decimal>?</is_qty_decimal> <!--Optional:--> <backorders>?</backorders> <!--Optional:--> <use_config_backorders>?</use_config_backorders> <!--Optional:--> <notify_stock_qty>?</notify_stock_qty> <!--Optional:--> <use_config_notify_stock_qty>?</use_config_notify_stock_qty> </stock_data> </productData> <!--Optional:--> <store>?</store> </urn:catalogProductCreateRequestParam> </soapenv:Body> </soapenv:Envelope>
For the V2 SOAP API it appears that we need to nest the additional_attributes in a multi_data or single_data layer? Looking at app/code/core/Mage/Catalog/Model/Product/Api/V2.php #256 I think we need to use $manufacturer = new stdClass(); $manufacturer->key = "manufacturer"; $manufacturer->value = "20"; $additionalAttrs['single_data'][] = $manufacturer; or $manufacturer = new stdClass(); $manufacturer->key = "manufacturer"; $manufacturer->value = "20"; $additionalAttrs['multi_data'][] = $manufacturer; to be used like: $productData = new stdClass(); $additionalAttrs = array(); // manufacturer from one of the two above ^ $productData->name = $data['name']; $productData->description = $data['description']; $productData->short_description = $data['short_description']; $productData->weight = 0; $productData->status = 2; // 1 = active $productData->visibility = 4; //visible in search/catalog $productData->category_ids = $data['categories']; $productData->price = $data['price']; $productData->tax_class_id = 2; // 2=standard $productData->additional_attributes = $additionalAttrs; // Create new product try { $proxy->catalogProductCreate($sessionId, 'virtual', 9, $sku, $productData); // 9 is courses } catch (SoapFault $e) { print $e->getMessage(); //Internal Error. Please see log for details. exit(); }
I actually had to patch app/code/core/Mage/Catalog/Model/Product/Api/V2.php to get this call to work in version 1.6.2.0. The existing code checks for either a "single_data" or "multi_data" attribute under the 'additional_attributes' property and tries to iterate over the those as an associative array: if (property_exists($productData, 'additional_attributes')) { if (property_exists($productData->additional_attributes, 'single_data')) { foreach ($productData->additional_attributes->single_data as $_attribute) { $_attrCode = $_attribute->key; $productData->$_attrCode = $_attribute->value; } } if (property_exists($productData->additional_attributes, 'multi_data')) { foreach ($productData->additional_attributes->multi_data as $_attribute) { $_attrCode = $_attribute->key; $productData->$_attrCode = $_attribute->value; } } } I think that the issue is that since we're passing the associative array structure: <item> <key>...</key> <value>...</value> </item> <item> <key>...</key> <value>...</value> </item> directly under the additional_attribtutes block then it's really the additional_attributes property that must be iterated over to pull the attribute key/values, so I added third if block: if (gettype($productData->additional_attributes) == 'array') { foreach ($productData->additional_attributes as $k => $v) { $_attrCode = $k; $productData->$_attrCode = $v; } } With that code in place my custom attributes are being added/updated. Here's a sample request: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento"> <soapenv:Header/> <soapenv:Body> <urn:catalogProductUpdateRequestParam> <sessionId>100fe1f9d0518b0fd0ed49cc460c1fa6</sessionId> <productId>1</productId> <productData> <name>product 3</name> <!-- the custom attributes to updated.... --> <additional_attributes> <complexObjectArray> <key>feed_id</key> <value>56920</value> </complexObjectArray> <complexObjectArray> <key>feed_active</key> <value>1</value> </complexObjectArray> </additional_attributes> </productData> </urn:catalogProductUpdateRequestParam> </soapenv:Body> </soapenv:Envelope>
This is not a bug. I have been using this Magento SOAP API V2 for more than a year, and the concept which Magento team have applied here is absolutely correct. First of all, every time any one using the SOAP API V2 must check the WSDL fully of that respective Magento, so that he can create / call messages correctly. The URL to load the WSDL of SOAP API V2 is "<your_magento_home_page_url>/api/v2_soap/index/wsdl/1". Now coming back to your question, the type of the element "additional_attributes" is "associativeArray", which means its XML should look something like:- <additional_attributes> <!-- This XML tag "item" can be anything; it's what I use, but can definitely be any other valid non-used literal. --> <item> <key>attribute_1_code</key> <value>attribute_1_value_as_defined_in_database</value> </item> <item> <key>attribute_2_code</key> <value>attribute_2_value_as_defined_in_database</value> </item> </additional_attributes> One example of the above XML format will be:- <additional_attributes> <item> <key>color</key> <!-- I haven't provided the name / string "Blue", because Magento's EAV database structure will only hold the option value (which is a unique ID) and not the option literal string. --> <value>56</value> <!-- assuming this value for "Blue" color --> </item> <item> <key>manufacturer</key> <value>87</value> <!-- assuming this value for the manufacturer "Intel" --> </item> </additional_attributes> So, your "$productData" variable must hold the values like this:- $productData ( [name] => testname [description] => testdescription [short_description] => shorttestdescription [weight] => 70 [status] => 1 [visibility] => 4 [price] => 359.0 [tax_class_id] => 2 [additional_attributes] => Array ( [0] => Array ( [key] => attribute1 [value] => 999.0 ) [1] => Array ( [key] => attribute2 [value] => testcontent ) ) ) Hope it helps.
stroisi is almost completely correct. Just one fix to that answer: the third condition you added will evaluate to true for the first two conditions too (thus adding those attributes twice in case you're using SOAPv2 in non-WSI-compliant mode). That condition chain should look like this: // ... if (property_exists($productData->additional_attributes, 'single_data')) { foreach ($productData->additional_attributes->single_data as $_attribute) { $_attrCode = $_attribute->key; $productData->$_attrCode = $_attribute->value; } } if (property_exists($productData->additional_attributes, 'multi_data')) { foreach ($productData->additional_attributes->multi_data as $_attribute) { $_attrCode = $_attribute->key; $productData->$_attrCode = $_attribute->value; } } else if (! property_exists($productData->additional_attributes, 'single_data')) { foreach ($productData->additional_attributes as $key => $value) { $productData->$key = $value; } } // ... The third condition asserts that both 'single_data' and 'multi_data' are not properties of additional_attributes. Though, in my opinion, the correct way to fix this bug is to edit the "wsi.xml" file so it is consistent with wsdl.xml (or vice versa).
I am using SOAP API for entering products in magento shops. here is the full code In the case of multiselect custom attribute. $arrProductTime = explode(',', '136,139'); $result = $client->catalogProductCreate($session, 'simple', $attributeSet->set_id, 'product_sku1234', array( 'categories' => array(36), 'websites' => array(1), 'name' => 'my_pdt1008', 'description' => 'my_pdt1', 'short_description' => 'my_pdt1000', 'weight' => '11', 'status' => '1', 'url_key' => 'product-url-key1', 'url_path' => 'product-url-path1', 'visibility' => '4', 'price' => '100', 'tax_class_id' => 1, 'meta_title' => 'Product meta title1', 'meta_keyword' => 'Product meta keyword1', 'meta_description' => 'Product meta description1', 'stock_data' => array('qty'=>'100','is_in_stock'=>1,'manage_stock'=>1), 'additional_attributes' => array('multi_data' => array(array('key' => 'product_time', 'value' => $arrProductTime))) ));
Everyone, I spent a good amount of time while creating a product with multi_data additional attribute. Well finally I managed it to work with the following packet: <x:Envelope xmlns:x="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Magento"> <x:Header/> <x:Body> <urn:catalogProductCreate> <urn:sessionId>fa6c91d36b1fbef209b3724cf0e3b188</urn:sessionId> <urn:type>simple</urn:type> <urn:set>4</urn:set> <urn:sku>147823691</urn:sku> <urn:productData> <urn:categories></urn:categories> <urn:websites></urn:websites> <urn:name>sample product-ntz-9May</urn:name> <urn:description>sample product-ntz-8May</urn:description> <urn:short_description>sample product-ntz-8May</urn:short_description> <urn:weight>?</urn:weight> <urn:status>1</urn:status> <urn:url_key>?</urn:url_key> <urn:url_path>?</urn:url_path> <urn:visibility>?</urn:visibility> <urn:category_ids></urn:category_ids> <urn:website_ids></urn:website_ids> <urn:has_options>?</urn:has_options> <urn:gift_message_available>?</urn:gift_message_available> <urn:price>?</urn:price> <urn:tax_class_id>?</urn:tax_class_id> <urn:tier_price></urn:tier_price> <urn:meta_title>?</urn:meta_title> <urn:meta_keyword>?</urn:meta_keyword> <urn:meta_description>?</urn:meta_description> <urn:custom_design>?</urn:custom_design> <urn:custom_layout_update>?</urn:custom_layout_update> <urn:options_container>?</urn:options_container> <urn:additional_attributes> ```<urn:multi_data> <item> <key>cert</key> <value> <item>12300</item>//keys of multiselect dropdown <item>201690</item> </value> </item> </urn:multi_data>``` <urn:single_data> <item> <key>finish</key> <value>22534</value> </item> </urn:single_data> </urn:additional_attributes> <urn:stock_data> <urn:qty>?</urn:qty> <urn:is_in_stock>0</urn:is_in_stock> <urn:manage_stock>0</urn:manage_stock> <urn:use_config_manage_stock>0</urn:use_config_manage_stock> <urn:min_qty>0</urn:min_qty> <urn:use_config_min_qty>0</urn:use_config_min_qty> <urn:min_sale_qty>0</urn:min_sale_qty> <urn:use_config_min_sale_qty>0</urn:use_config_min_sale_qty> <urn:max_sale_qty>0</urn:max_sale_qty> <urn:use_config_max_sale_qty>0</urn:use_config_max_sale_qty> <urn:is_qty_decimal>0</urn:is_qty_decimal> <urn:backorders>0</urn:backorders> <urn:use_config_backorders>0</urn:use_config_backorders> <urn:notify_stock_qty>0</urn:notify_stock_qty> <urn:use_config_notify_stock_qty>0</urn:use_config_notify_stock_qty> </urn:stock_data> </urn:productData> <urn:storeView>0</urn:storeView> </urn:catalogProductCreate> </x:Body> </x:Envelope> Hope it will save someone's time.