Hi All,
I am trying to call a service directly through NAV.
The service will pull all the items using "ReadMultiple" Method .
Now i need to introduce a new Filter like "Inventory <> 0".
Can anyone please suggest the syntax ?
The Codes are :
IF ISCLEAR(Connector) THEN
CREATE(Connector);
//Connector.Property('ProxyServer','isaserver');
//Connector.Property('ProxyPassword','proxypass');
//Connector.Property('ProxyUser','username');
Connector.Property('EndPointURL','
http://localhost:7047/DynamicsNAV/WS/CRONUS India Ltd./Page/Item');
Connector.Connect;
Connector.Property('SoapAction','urn:microsoft-dynamics-schemas/page/Item');
Connector.BeginMessage;
CREATE(Serializer);
Serializer.Init(Connector.InputStream);
Serializer.StartEnvelope('','STANDARD','utf-16');
Serializer.StartBody('STANDARD');
Serializer.StartElement('ReadMultiple','urn:microsoft-dynamics-schemas/page/Item');
:?: :?: :?: :?: :?: :?: :?:
Serializer.EndElement;
Serializer.EndBody;
Serializer.EndEnvelope;
Connector.EndMessage;
IF ISCLEAR(XMLDOM) THEN
CREATE(XMLDOM);
XMLDOM.load(Connector.OutputStream);
XMLNode := XMLDOM.selectSingleNode('//valid');
IF NOT ISCLEAR(XMLNode) THEN
MESSAGE(XMLNode.text);
XMLDOM.save('c:\Item.xml');
CLEAR(XMLDOM);
CLEAR(Connector);
Comments
Catched by Fiddler web debugger and one easy application consuming the webservice done in Visual Studio.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Is it possible to incorporate the "filter" using the NAV code?
I have tried with this code,Its not working
Serializer.SoapAttribute('Item_Filter','urn:microsoft-dynamics-schemas/page/Item');
Serializer.SoapAttribute('Field','Blocked');
Serializer.SoapAttribute('Criteria','No');
Pls Suggest.
Regards
Valan
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Thanks for your reply.
The filteration for a specific "Card"(100) needs to be acheived through this code,instead its taking all the data :?:
Pls correct me if i wrong.
IF ISCLEAR(Connector) THEN
CREATE(Connector);
//Connector.Property('ProxyServer','isaserver');
//Connector.Property('ProxyPassword','proxypass');
//Connector.Property('ProxyUser','username');
Connector.Property('EndPointURL','http://localhost:7047/DynamicsNAV/WS/CRONUS India Ltd./Page/Loyalty');
Connector.Connect;
Connector.Property('SoapAction','urn:microsoft-dynamics-schemas/page/loyalty');
Connector.BeginMessage;
CREATE(Serializer);
Serializer.Init(Connector.InputStream);
Serializer.StartEnvelope('','STANDARD','utf-16');
Serializer.StartBody('STANDARD');
Serializer.StartElement('ReadMultiple','urn:microsoft-dynamics-schemas/page/loyalty');
Serializer.StartElement('filter');
Serializer.StartElement('Field');
Serializer.WriteString('Card');
Serializer.EndElement;
Serializer.StartElement('Criteria');
Serializer.WriteString('100');
Serializer.EndElement;
Serializer.EndElement;
Serializer.StartElement('bookmarkKey');
Serializer.WriteString('NULL');
Serializer.EndElement;
Serializer.StartElement('setSize');
Serializer.WriteString('1000');
Serializer.EndElement;
Serializer.EndElement;
Serializer.EndBody;
Serializer.EndEnvelope;
Connector.EndMessage;
IF ISCLEAR(XMLDOM) THEN
CREATE(XMLDOM);
XMLDOM.load(Connector.OutputStream);
XMLNode := XMLDOM.selectSingleNode('//valid');
IF NOT ISCLEAR(XMLNode) THEN
MESSAGE(XMLNode.text);
XMLDOM.save('c:\Loyal.xml');
CLEAR(XMLDOM);
CLEAR(Connector);
And try to use the namespace for all elements...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Got the solution,
I have included the "'urn:microsoft-dynamics-schemas/page/loyalty'" in all the elements.
Thanks for your valuable input
\:D/
Regards
Valan