Re: [Dev] [EI] Correct Xpath expression to read database response.
Hi Senuwan, If you are getting it from the SOAP body element as you tried in [1] you can to get it like this [2]. [1] $body/m0:Entries/m0:Entry/m0:CUSTOMER_EMAIL/text() [2] $body//m0:Entries/m0:Entry/m0:CUSTOMER_EMAIL/text() After the $body you need to define // rather than / . Thanks Bhashinee On Sun, Jan 7, 2018 at 7:31 AM, Senuwan Withanawrote: > Hi Vijitha, > > Thanks for the support. First I have tried out the above scenario. it > works fine and retrieved the Email_ID and Record_ID > However when I applied to suggested Xpath configurations to my API, It not > functioned. An empty value is returned. > > Could you tell me what is the reason for that. > > *Senuwan Withana* > Software Engineer - Support Team | WSO2 > > Email : senu...@wso2.com > Mobile: 94773212853 > Web: http://www.wso2.com > > > > On Sat, Jan 6, 2018 at 6:20 PM, Vijitha Ekanayake > wrote: > >> Hi Senuwan, >> >> I tried this in EI WUM updated pack with below API configurations and was >> able to get CUSTOMER_EMAIL and RECORD_ID by defining data service namespace >> inside property mediator. >> >> *API configurations* >> >> http://ws.apache.org/ns/synapse; >> name="ContextServiceAPI-2.0.0" context="/context-2.0.0"> >> >> >> >> >>http://www.mocky.io/v2/5a >> 50c0d32ffc128d52ee"> >> >> 3 >> discard >> >> >> 0 >> 1.0 >> 0 >> >> >> >> >> >> http://ws.wso2.org/dataservice; >> name="EmailID" expression="//m0:CUSTOMER_EMAIL"/> >> http://ws.wso2.org/dataservice; >> name="Record_ID" expression="//m0:RECORD_ID"/> >> >> >> >> >> >> >> *Request* >> >> curl -v http://localhost:8280/context-2.0.0/abc >> >> *Output in the console* >> >> [2018-01-06 18:15:15,206] [EI-Core] INFO - LogMediator EmailID = >> senu...@wso2.com, Record_ID = 138 >> >> Could you try your scenario with suggested Xpath configurations as above? >> >> Thanks, >> Vijitha. >> >> >> On Sat, Jan 6, 2018 at 3:34 PM, Senuwan Withana wrote: >> >>> Hi Team, >>> >>> In my Scenario, I want to get Email_ID and Record_ID from the database >>> response. >>> Response is correctly come to the wire-log. But I could not able to log >>> the Email_ID and Record_ID. >>> >>> I have tried out following Xpath expressions but non of those give me >>> the correct result. >>> >>> >>> [1]. $body/m0:Entries/m0:Entry/m0:CUSTOMER_EMAIL/text() - Not work >>> [2]. "//*[local-name()='CUSTOMER_EMAIL']"- Not work >>> [3].$body /Entries/Entry/CUSTOMER_EMAIL/text()- Not work >>> [4].//body/Entries/Entry/CUSTOMER_EMAIL/text()- Not work >>> [5].$body - Works, but all the data log. >>> >>> >>> >>> [2018-01-06 15:08:24,160] [EI-Core] DEBUG - content << "?xm" >>> [2018-01-06 15:08:24,160] [EI-Core] DEBUG - content << "l version='1.0' >>> encoding='UTF-8'?>http://schemas. >>> xmlsoap.org/soap/envelope/">http://ws.wso2.org/dataservice;>138 >>> senu...@wso2.com>> >Altoblue< >>> ENGINE_CAPACITY>800>> INTERIOR_MATERIAL>Yes>> SEATS>YesNo>> NAVIGATION>No< >>> STATUS>ApprovedPink>> COLOR>5T>> nv:Body>" >>> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" >>> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" >>> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "0" >>> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" >>> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" >>> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" >>> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" >>> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - header << "[\r][\n]" >>> [2018-01-06 15:08:24,163] [EI-Core] INFO - LogMediator Body >>> = http://schemas.xmlsoap.org/soap/envelope/ >>> ">http://ws.wso2.org/dataservice;>138 >>> senu...@wso2.com>> >Altoblue< >>> ENGINE_CAPACITY>800< >>> SUN_ROOF>YesYes>> HEATED_LEATHER_SEATS>No>> TAILGATE>NoApproved>> STATUS>Pink5T>> TIRE_SIZE> >>> [2018-01-06 15:08:24,164] [EI-Core] INFO - LogMediator >>> Email = >>> [2018-01-06 15:08:24,186] [EI-Core] DEBUG - wire HTTP-Listener I/O >>> dispatcher-3 << "HTTP/1.1 202 Accepted[\r][\n]" >>> [2018-01-06 15:08:24,189] [EI-Core] DEBUG - wire HTTP-Listener I/O >>> dispatcher-3 << "Content-Type: text/xml; charset=UTF-8[\r][\n]" >>> >>> >>> >>> >>> Any suggestion to for the correct Xpath Expression. >>> >>> Thanks. >>> >>> *Senuwan Withana* >>> Software Engineer - Support Team | WSO2 >>> >>> Email : senu...@wso2.com >>> Mobile: 94773212853 >>> Web: http://www.wso2.com >>> >>> >>> >>> ___ >>> Dev mailing list >>> Dev@wso2.org >>> http://wso2.org/cgi-bin/mailman/listinfo/dev >>> >>> >> >> >> -- >> Vijitha Ekanayake >> Senior Software
Re: [Dev] [EI] Correct Xpath expression to read database response.
Hi Vijitha, Thanks for the support. First I have tried out the above scenario. it works fine and retrieved the Email_ID and Record_ID However when I applied to suggested Xpath configurations to my API, It not functioned. An empty value is returned. Could you tell me what is the reason for that. *Senuwan Withana* Software Engineer - Support Team | WSO2 Email : senu...@wso2.com Mobile: 94773212853 Web: http://www.wso2.com On Sat, Jan 6, 2018 at 6:20 PM, Vijitha Ekanayakewrote: > Hi Senuwan, > > I tried this in EI WUM updated pack with below API configurations and was > able to get CUSTOMER_EMAIL and RECORD_ID by defining data service namespace > inside property mediator. > > *API configurations* > > http://ws.apache.org/ns/synapse; > name="ContextServiceAPI-2.0.0" context="/context-2.0.0"> > > > > >http://www.mocky.io/v2/ > 5a50c0d32ffc128d52ee"> > > 3 > discard > > > 0 > 1.0 > 0 > > > > > > http://ws.wso2.org/dataservice; > name="EmailID" expression="//m0:CUSTOMER_EMAIL"/> > http://ws.wso2.org/dataservice; > name="Record_ID" expression="//m0:RECORD_ID"/> > > > > > > > *Request* > > curl -v http://localhost:8280/context-2.0.0/abc > > *Output in the console* > > [2018-01-06 18:15:15,206] [EI-Core] INFO - LogMediator EmailID = > senu...@wso2.com, Record_ID = 138 > > Could you try your scenario with suggested Xpath configurations as above? > > Thanks, > Vijitha. > > > On Sat, Jan 6, 2018 at 3:34 PM, Senuwan Withana wrote: > >> Hi Team, >> >> In my Scenario, I want to get Email_ID and Record_ID from the database >> response. >> Response is correctly come to the wire-log. But I could not able to log >> the Email_ID and Record_ID. >> >> I have tried out following Xpath expressions but non of those give me >> the correct result. >> >> >> [1]. $body/m0:Entries/m0:Entry/m0:CUSTOMER_EMAIL/text() - Not work >> [2]. "//*[local-name()='CUSTOMER_EMAIL']"- Not work >> [3].$body /Entries/Entry/CUSTOMER_EMAIL/text()- Not work >> [4].//body/Entries/Entry/CUSTOMER_EMAIL/text()- Not work >> [5].$body - Works, but all the data log. >> >> >> >> [2018-01-06 15:08:24,160] [EI-Core] DEBUG - content << "?xm" >> [2018-01-06 15:08:24,160] [EI-Core] DEBUG - content << "l version='1.0' >> encoding='UTF-8'?>http://schemas. >> xmlsoap.org/soap/envelope/">http://ws.wso2.org/dataservice;> >> 138senu...@wso2.com> EMAIL>Altoblue> COLOR>800> MATERIAL>Yes< >> HEATED_LEATHER_SEATS>Yes> ON>NoNo> TAILGATE>ApprovedPink> INTERIOR_COLOR>5T> soapenv:Body>" >> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" >> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" >> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "0" >> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" >> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" >> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" >> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" >> [2018-01-06 15:08:24,161] [EI-Core] DEBUG - header << "[\r][\n]" >> [2018-01-06 15:08:24,163] [EI-Core] INFO - LogMediator Body >> = http://schemas.xmlsoap.org/soap/envelope/ >> ">http://ws.wso2.org/dataservice;> >> 138senu...@wso2.com> EMAIL>Altoblue> COLOR>800> MATERIAL/>Yes >> YesNo< >> AUTOMATIC_TAILGATE>No >> ApprovedPink< >> TIRE_SIZE>5T >> [2018-01-06 15:08:24,164] [EI-Core] INFO - LogMediator Email >> = >> [2018-01-06 15:08:24,186] [EI-Core] DEBUG - wire HTTP-Listener I/O >> dispatcher-3 << "HTTP/1.1 202 Accepted[\r][\n]" >> [2018-01-06 15:08:24,189] [EI-Core] DEBUG - wire HTTP-Listener I/O >> dispatcher-3 << "Content-Type: text/xml; charset=UTF-8[\r][\n]" >> >> >> >> >> Any suggestion to for the correct Xpath Expression. >> >> Thanks. >> >> *Senuwan Withana* >> Software Engineer - Support Team | WSO2 >> >> Email : senu...@wso2.com >> Mobile: 94773212853 >> Web: http://www.wso2.com >> >> >> >> ___ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Vijitha Ekanayake > Senior Software Engineer*, *WSO2, Inc.; http://wso2.com/ > Mobile : +94 777 24 73 39 | +94 718 74 44 08 > lean.enterprise.middleware > ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
Re: [Dev] [EI] Correct Xpath expression to read database response.
Hi Senuwan, I tried this in EI WUM updated pack with below API configurations and was able to get CUSTOMER_EMAIL and RECORD_ID by defining data service namespace inside property mediator. *API configurations* http://ws.apache.org/ns/synapse; name="ContextServiceAPI-2.0.0" context="/context-2.0.0"> http://www.mocky.io/v2/5a50c0d32ffc128d52ee "> 3 discard 0 1.0 0 http://ws.wso2.org/dataservice; name="EmailID" expression="//m0:CUSTOMER_EMAIL"/> http://ws.wso2.org/dataservice; name="Record_ID" expression="//m0:RECORD_ID"/> *Request* curl -v http://localhost:8280/context-2.0.0/abc *Output in the console* [2018-01-06 18:15:15,206] [EI-Core] INFO - LogMediator EmailID = senu...@wso2.com, Record_ID = 138 Could you try your scenario with suggested Xpath configurations as above? Thanks, Vijitha. On Sat, Jan 6, 2018 at 3:34 PM, Senuwan Withanawrote: > Hi Team, > > In my Scenario, I want to get Email_ID and Record_ID from the database > response. > Response is correctly come to the wire-log. But I could not able to log > the Email_ID and Record_ID. > > I have tried out following Xpath expressions but non of those give me the > correct result. > > > [1]. $body/m0:Entries/m0:Entry/m0:CUSTOMER_EMAIL/text() - Not work > [2]. "//*[local-name()='CUSTOMER_EMAIL']"- Not work > [3].$body /Entries/Entry/CUSTOMER_EMAIL/text()- Not work > [4].//body/Entries/Entry/CUSTOMER_EMAIL/text()- Not work > [5].$body - Works, but all the data log. > > > > [2018-01-06 15:08:24,160] [EI-Core] DEBUG - content << "?xm" > [2018-01-06 15:08:24,160] [EI-Core] DEBUG - content << "l version='1.0' > encoding='UTF-8'?>http://schemas. > xmlsoap.org/soap/envelope/">http://ws.wso2.org/dataservice;> ID>138senu...@wso2.com CUSTOMER_EMAIL>Alto > blue800 > Yes ROOF>Yes< > NAVIGATION>NoNo AUTOMATIC_TAILGATE>Approved COLOR>Pink5T Entry>" > [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" > [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" > [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "0" > [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" > [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" > [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" > [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" > [2018-01-06 15:08:24,161] [EI-Core] DEBUG - header << "[\r][\n]" > [2018-01-06 15:08:24,163] [EI-Core] INFO - LogMediator Body = > xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/;> xmlns="http://ws.wso2.org/dataservice;> ID>138senu...@wso2.com CUSTOMER_EMAIL>Alto > blue800 > Yes SEATS>YesNo TAILGATE>NoApproved STATUS>Pink5T TIRE_SIZE> > [2018-01-06 15:08:24,164] [EI-Core] INFO - LogMediator Email > = > [2018-01-06 15:08:24,186] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 << "HTTP/1.1 202 Accepted[\r][\n]" > [2018-01-06 15:08:24,189] [EI-Core] DEBUG - wire HTTP-Listener I/O > dispatcher-3 << "Content-Type: text/xml; charset=UTF-8[\r][\n]" > > > > > Any suggestion to for the correct Xpath Expression. > > Thanks. > > *Senuwan Withana* > Software Engineer - Support Team | WSO2 > > Email : senu...@wso2.com > Mobile: 94773212853 > Web: http://www.wso2.com > > > > ___ > Dev mailing list > Dev@wso2.org > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- Vijitha Ekanayake Senior Software Engineer*, *WSO2, Inc.; http://wso2.com/ Mobile : +94 777 24 73 39 | +94 718 74 44 08 lean.enterprise.middleware ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev
[Dev] [EI] Correct Xpath expression to read database response.
Hi Team, In my Scenario, I want to get Email_ID and Record_ID from the database response. Response is correctly come to the wire-log. But I could not able to log the Email_ID and Record_ID. I have tried out following Xpath expressions but non of those give me the correct result. [1]. $body/m0:Entries/m0:Entry/m0:CUSTOMER_EMAIL/text() - Not work [2]. "//*[local-name()='CUSTOMER_EMAIL']"- Not work [3].$body /Entries/Entry/CUSTOMER_EMAIL/text()- Not work [4].//body/Entries/Entry/CUSTOMER_EMAIL/text()- Not work [5].$body - Works, but all the data log. [2018-01-06 15:08:24,160] [EI-Core] DEBUG - content << "?xm" [2018-01-06 15:08:24,160] [EI-Core] DEBUG - content << "l version='1.0' encoding='UTF-8'?>http://schemas.xmlsoap.org/soap/envelope/;>http://ws.wso2.org/dataservice ">138senu...@wso2.com Altoblue800YesYesNoNoApprovedPink5T" [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "0" [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\r]" [2018-01-06 15:08:24,161] [EI-Core] DEBUG - content << "[\n]" [2018-01-06 15:08:24,161] [EI-Core] DEBUG - header << "[\r][\n]" [2018-01-06 15:08:24,163] [EI-Core] INFO - LogMediator Body = http://schemas.xmlsoap.org/soap/envelope/;>http://ws.wso2.org/dataservice ">138senu...@wso2.com Altoblue800YesYesNoNoApprovedPink5T [2018-01-06 15:08:24,164] [EI-Core] INFO - LogMediator Email = [2018-01-06 15:08:24,186] [EI-Core] DEBUG - wire HTTP-Listener I/O dispatcher-3 << "HTTP/1.1 202 Accepted[\r][\n]" [2018-01-06 15:08:24,189] [EI-Core] DEBUG - wire HTTP-Listener I/O dispatcher-3 << "Content-Type: text/xml; charset=UTF-8[\r][\n]" Any suggestion to for the correct Xpath Expression. Thanks. *Senuwan Withana* Software Engineer - Support Team | WSO2 Email : senu...@wso2.com Mobile: 94773212853 Web: http://www.wso2.com ___ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev