0
votes

Trying to deal with IMB MQ message in WSO2 in xml format.

I was able to read message from queue. My message is like :

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
  <soapenv:Body>
    <vi:Show xmlns:vi="urn:vehdpms.tms.t.com/vehinv">
      <vi:VehicleInventoryBOD>
        <emf:ApplicationArea xmlns:emf="http://ice.tms.t.com/EMF">
          <emf:CreationDateTime>2017-01-09T11:18:04.622-08:00</emf:CreationDateTime>
          <emf:BODID>daedfeed-a56c-4d4a-bf8d-77d0bcd00899</emf:BODID>
          <emf:Sender>
            <emf:ServiceName>Vehicle Inventory</emf:ServiceName>
            <emf:ServiceVersion>GETSH</emf:ServiceVersion>
          </emf:Sender>
          <rtm:RTMHeader xmlns:rtm="urn:vehdpms.tms.t.com/rtmheader">
            <rtm:Source>
              <rtm:Company>TMS</rtm:Company>
              <rtm:System>VROR</rtm:System>
            </rtm:Source>
            <rtm:Response>
              <rtm:Name>Vehicle Inventory</rtm:Name>
            </rtm:Response>
          </rtm:RTMHeader>
        </emf:ApplicationArea>
        <vi:DataArea>
          <vi:Verb>Show</vi:Verb>
          <vi:VehicleInventory>
            <vi:UnitId>122755280</vi:UnitId>
            <vi:URN>NJ19555772</vi:URN>
            <vi:WMI>5YF</vi:WMI>
            <vi:VDSPrefix>BURHE</vi:VDSPrefix>
            <vi:VIN>5YFAAAAE5HP765434</vi:VIN>

Trying to put 5YFAAAAE5HP765434 in property. I'm using property mediator to extract VIN number from XML...I point to xml so I get something like this

<inSequence>
            <property expression="/soapenv:Envelope/soapenv:Body/vi:Show/vi:VehicleInventoryBOD/vi:DataArea/vi:VehicleInventory/vi:VIN" name="test" scope="default" type="STRING" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"/>
            <log level="custom">
                <property expression="get-property('test')" name="Requested VIN"/>
            </log>
        </inSequence>

but still I'm not getting it ... my info is coming like

TID[-1234] [ESB] [2017-03-05 00:29:39,641] INFO {org.apache.synapse.mediators.builtin.LogMediator} - Requested VIN =

so something wrong with expression in property ... can someone pount me to right direction ..

1

1 Answers

0
votes

You should have an exception in your mediation because prefixe vi: is not decalred

Try with that :

<property expression="$body/vi:Show/vi:VehicleInventoryBOD/vi:DataArea/vi:VehicleInventory/vi:VIN" name="test" scope="default" type="STRING" xmlns:vi="urn:vehdpms.tms.t.com/vehinv"/>