Forum Discussion

apontier's avatar
apontier
Occasional Contributor
14 years ago

CDATA Property Transfers not working in 4.0.1

Following the example here: http://www.soapui.org/Functional-Testin ... cdata.html I am getting error on transfer from temp1 to temp2

Temp1 --> Temp2 -- Missing match for target XPATH

If I create just an empty property to transfer the data into I end up with null.

Transfer 1 Source:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<NS1:executeServiceResponse xmlns:NS1="http://facade.erieinsurance.com" xmlns:facade="http://facade.erieinsurance.com" xmlns:iaaxml="http://www.ibm.com/ima/iaa/IAAXML">
<serviceResponse>
<responseHeader>
<NS2:id xmlns:NS2="http://www.ibm.com/ima/iaa/IAAXML">_NimbusRequestRs</NS2:id>
<NS3:refidRequest xmlns:NS3="http://www.ibm.com/ima/iaa/IAAXML">_NimbusRequest</NS3:refidRequest>
<NS4:cmdType xmlns:NS4="http://www.ibm.com/ima/iaa/IAAXML">response</NS4:cmdType>
<NS5:cmdStatus xmlns:NS5="http://www.ibm.com/ima/iaa/IAAXML">Success</NS5:cmdStatus>
<NS6:message xmlns:NS6="http://www.ibm.com/ima/iaa/IAAXML">success</NS6:message>
</responseHeader>
<responseData><![CDATA[<ECMResponse xmlns="http://www.oneshield.com/DragonSchema"><ECMDocumentList><ECMDocument><DocumentType>DECLARATIONS--INSURED&apos;S COPY</DocumentType><EffectiveDate>20120131010000</EffectiveDate><ExternalDocumentUUID>B7D4CB00C581F49BE040010ABC9C14B8</ExternalDocumentUUID><ProcessDate>20120131010000</ProcessDate><RecipientName>KALYAN MORGAN</RecipientName><RecipientType>INSURED</RecipientType><TransactionType>NEW BUSINESS</TransactionType></ECMDocument><ECMDocument><DocumentType>APPLICATION</DocumentType><EffectiveDate>20120131010000</EffectiveDate><ExternalDocumentUUID>B7D4CB00C561F49BE040010ABC9C14B8</ExternalDocumentUUID><ProcessDate>20120131010000</ProcessDate><RecipientName>KALYAN MORGAN</RecipientName><RecipientType>INSURED</RecipientType><TransactionType>NEW BUSINESS</TransactionType></ECMDocument><ECMDocument><DocumentType>PREMIUM INVOICE</DocumentType><ExternalDocumentUUID>B86D6A8D32FB2519E040010ABC9C28CC</ExternalDocumentUUID><ProcessDate>20120208010000</ProcessDate><RecipientName>KALYAN MORGAN</RecipientName><RecipientType>INSURED</RecipientType></ECMDocument></ECMDocumentList></ECMResponse>]]></responseData>
</serviceResponse>
</NS1:executeServiceResponse>
</soapenv:Body>
</soapenv:Envelope>

Transfer 1:
declare namespace fac="http://facade.erieinsurance.com";
//fac:executeServiceResponse/serviceResponse/responseData

Transfer 1 Results:
<ECMResponse xmlns="http://www.oneshield.com/DragonSchema"><ECMDocumentList><ECMDocument><DocumentType>DECLARATIONS--INSURED&apos;S COPY</DocumentType><EffectiveDate>20120131010000</EffectiveDate><ExternalDocumentUUID>B7D4CB00C581F49BE040010ABC9C14B8</ExternalDocumentUUID><ProcessDate>20120131010000</ProcessDate><RecipientName>KALYAN MORGAN</RecipientName><RecipientType>INSURED</RecipientType><TransactionType>NEW BUSINESS</TransactionType></ECMDocument><ECMDocument><DocumentType>APPLICATION</DocumentType><EffectiveDate>20120131010000</EffectiveDate><ExternalDocumentUUID>B7D4CB00C561F49BE040010ABC9C14B8</ExternalDocumentUUID><ProcessDate>20120131010000</ProcessDate><RecipientName>KALYAN MORGAN</RecipientName><RecipientType>INSURED</RecipientType><TransactionType>NEW BUSINESS</TransactionType></ECMDocument><ECMDocument><DocumentType>PREMIUM INVOICE</DocumentType><ExternalDocumentUUID>B86D6A8D32FB2519E040010ABC9C28CC</ExternalDocumentUUID><ProcessDate>20120208010000</ProcessDate><RecipientName>KALYAN MORGAN</RecipientName><RecipientType>INSURED</RecipientType></ECMDocument></ECMDocumentList></ECMResponse>

Transfer 2 Source:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fac="http://facade.erieinsurance.com" xmlns:iaax="http://www.ibm.com/ima/iaa/IAAXML">
<soapenv:Header/>
<soapenv:Body>
<fac:executeService>
<serviceRequest>
<requestHeader>
<iaax:id>_NimbusRequest</iaax:id>
<iaax:cmdType>request</iaax:cmdType>
<iaax:cmdMode>alwaysRespond</iaax:cmdMode>
<iaax:echoBack>false</iaax:echoBack>
<iaax:serviceContext>
<keepAlive>false</keepAlive>
<channelName/>
</iaax:serviceContext>
</requestHeader>
<targetAction>getDocument</targetAction>
<marketableProduct>UltraPack</marketableProduct>
<riskState>PA</riskState>
<productEffectiveDate>2009-01-01</productEffectiveDate>
<requestData><![CDATA[<ECM_Request xmlns="http://www.oneshield.com/DragonSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ExternalDocumentUUID>82A63A48F4F9CF2DE040010ABB9C7CA2</ExternalDocumentUUID></ECM_Request>]]></requestData>
</serviceRequest>
</fac:executeService>
</soapenv:Body>
</soapenv:Envelope>

Transfer 2:
declare namespace fac="http://facade.erieinsurance.com";
//fac:executeService/serviceRequest/requestData

Transfer 2 Results:
<ECM_Request xmlns="http://www.oneshield.com/DragonSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ExternalDocumentUUID>82A63A48F4F9CF2DE040010ABB9C7CA2</ExternalDocumentUUID></ECM_Request>

Transfer 3 to temp3:
//ECMResponse/ECMDocumentList/ECMDocument[1]/ExternalDocumentUUID
or
//ECMResponse[1]/ECMDocumentList[1]/ECMDocument[1]/ExternalDocumentUUID[1]

Transfer 3 to temp3 Results:
[null]

Transfer 3 to temp1 to temp2:
Source:
//ECMResponse/ECMDocumentList/ECMDocument[1]/ExternalDocumentUUID
or
//ECMResponse[1]/ECMDocumentList[1]/ECMDocument[1]/ExternalDocumentUUID[1]

Target:
//ECM_Request/ExternalDocumentUUID
or
//ECM_Request[1]/ExternalDocumentUUID[1]

Transfer 3 to temp1 to temp2 Results:
[Missing match for target XPATH[//ECM_Request/ExternalDocumentUUID]]

1 Reply

  • apontier's avatar
    apontier
    Occasional Contributor
    Further testing with these strings uncovered that the bug exists when there is an embedded namespace declaration within the CDATA XML elements.

    This string fails to parse:

    <ECM_Request xmlns="http://www.oneshield.com/DragonSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><ExternalDocumentUUID>82A63A48F4F9CF2DE040010ABB9C7CA2</ExternalDocumentUUID></ECM_Request>

    whereas this string parses just fine

    <ECM_Request><ExternalDocumentUUID>82A63A48F4F9CF2DE040010ABB9C7CA2</ExternalDocumentUUID></ECM_Request>

    S the question is - is this a bug with the property transfer or is the only way to do this via a script?