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 Withana <[email protected]> wrote: > 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 : [email protected] > Mobile: 94773212853 > Web: http://www.wso2.com > > > > On Sat, Jan 6, 2018 at 6:20 PM, Vijitha Ekanayake <[email protected]> > 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* >> >> <api xmlns="http://ws.apache.org/ns/synapse" >> name="ContextServiceAPI-2.0.0" context="/context-2.0.0"> >> <resource methods="DELETE OPTIONS POST PUT GET" url-mapping="/*"> >> <inSequence> >> <call> >> <endpoint> >> <address uri="http://www.mocky.io/v2/5a >> 50c0d32f0000fc128d52ee"> >> <timeout> >> <duration>30000</duration> >> <responseAction>discard</responseAction> >> </timeout> >> <suspendOnFailure> >> <initialDuration>0</initialDuration> >> <progressionFactor>1.0</progressionFactor> >> <maximumDuration>0</maximumDuration> >> </suspendOnFailure> >> </address> >> </endpoint> >> </call> >> <log level="custom"> >> <property xmlns:m0="http://ws.wso2.org/dataservice" >> name="EmailID" expression="//m0:CUSTOMER_EMAIL"/> >> <property xmlns:m0="http://ws.wso2.org/dataservice" >> name="Record_ID" expression="//m0:RECORD_ID"/> >> </log> >> <respond/> >> </inSequence> >> </resource> >> </api> >> >> *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 = >> [email protected], 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 <[email protected]> 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'?><soapenv:Envelope xmlns:soapenv="http://schemas. >>> xmlsoap.org/soap/envelope/"><soapenv:Body><Entries xmlns=" >>> http://ws.wso2.org/dataservice"><Entry><RECORD_ID>138 >>> </RECORD_ID><CUSTOMER_EMAIL>[email protected]</CUSTOMER_EMAIL >>> ><CAR_MODEL>Alto</CAR_MODEL><BODY_COLOR>blue</BODY_COLOR>< >>> ENGINE_CAPACITY>800</ENGINE_CAPACITY><INTERIOR_MATERIAL></ >>> INTERIOR_MATERIAL><SUN_ROOF>Yes</SUN_ROOF><HEATED_LEATHER_ >>> SEATS>Yes</HEATED_LEATHER_SEATS><NAVIGATION>No</ >>> NAVIGATION><AUTOMATIC_TAILGATE>No</AUTOMATIC_TAILGATE>< >>> STATUS>Approved</STATUS><INTERIOR_COLOR>Pink</INTERIOR_ >>> COLOR><TIRE_SIZE>5T</TIRE_SIZE></Entry></Entries></soape >>> nv:Body></soapenv:Envelope>" >>> [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************ >>> = <soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/ >>> "><Entries xmlns="http://ws.wso2.org/dataservice"><Entry><RECORD_ID>138 >>> </RECORD_ID><CUSTOMER_EMAIL>[email protected]</CUSTOMER_EMAIL >>> ><CAR_MODEL>Alto</CAR_MODEL><BODY_COLOR>blue</BODY_COLOR>< >>> ENGINE_CAPACITY>800</ENGINE_CAPACITY><INTERIOR_MATERIAL/>< >>> SUN_ROOF>Yes</SUN_ROOF><HEATED_LEATHER_SEATS>Yes</ >>> HEATED_LEATHER_SEATS><NAVIGATION>No</NAVIGATION><AUTOMATIC_ >>> TAILGATE>No</AUTOMATIC_TAILGATE><STATUS>Approved</ >>> STATUS><INTERIOR_COLOR>Pink</INTERIOR_COLOR><TIRE_SIZE>5T</ >>> TIRE_SIZE></Entry></Entries></soapenv:Body> >>> [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 : [email protected] >>> Mobile: 94773212853 >>> Web: http://www.wso2.com >>> >>> >>> >>> _______________________________________________ >>> Dev mailing list >>> [email protected] >>> 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 > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- *Bhashinee Nirmali* *Software Engineer* *WSO2 Lanka (Private) Limited: **http://wso2.com <http://www.google.com/url?q=http%3A%2F%2Fwso2.com&sa=D&sntz=1&usg=AFQjCNEZvyc0uMD1HhBaEGCBxs6e9fBObg>* *lean.enterprise.middle-ware* *phone: (+94) 71 21 50003* <http://wso2.com/signature>
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
