cancel
Showing results for 
Search instead for 
Did you mean: 

SOAPUI Property Transfer XPATH

SOLVED
Highlighted
New Contributor

SOAPUI Property Transfer XPATH

I am new to SOAPUI and have a simple question about Property Transfer.  The Response I want to transfer is:

 

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<AddResponse xmlns="http://tempuri.org/">
<AddResult>11</AddResult>
</AddResponse>
</soap:Body>
</soap:Envelope>

 

The Request I want to transfer to is:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tem="http://tempuri.org/">
<soapenv:Header/>
<soapenv:Body>
<temSmiley Frustratedubtract>
<tem:intA>5</tem:intA>
<tem:intB>2</tem:intB>
</temSmiley Frustratedubtract>
</soapenv:Body>
</soapenv:Envelope>

 

The Property Transfer Source is (using XPath language):

 

declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://tempuri.org/';
//ns1:AddResponse[1]/ns1:AddResult[1]

 

The Property Transfer Target is (using XPath language):

 

declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://tempuri.org/';
//ns1:temSmiley Frustratedubtract[1]/ns1:tem:intA[1]

 

The error I get is:

 

[net.sf.saxon.trans.XPathException: XPath syntax error at char 19 on line 2 in {\n//ns1:temSmiley Frustratedubtract/tem:intA}: Invalid QName local part {temSmiley Frustratedubtract}]

 

 I have tried many different combinations of the Target XPath but get the same error.  Note that the Source XPath is valid when I use it in an assertion on the Source alone.

 

Can someone tell me what I am doing wrong.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: SOAPUI Property Transfer XPATH

In your request, you are calling the 'http://tempuri.org/' namespace with the tem prefix. When you declare the name spaces for your Property Transfer, it has automatically prefixed that same namespace as ns1. So you need to change the declaration, or change your path.

 

declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://tempuri.org/';
//ns1:Subtract[1]/ns1:intA[1]

or

declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace tem='http://tempuri.org/';
//tem:Subtract[1]/tem:intA[1]
2 REPLIES 2
Community Hero

Re: SOAPUI Property Transfer XPATH

In your request, you are calling the 'http://tempuri.org/' namespace with the tem prefix. When you declare the name spaces for your Property Transfer, it has automatically prefixed that same namespace as ns1. So you need to change the declaration, or change your path.

 

declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace ns1='http://tempuri.org/';
//ns1:Subtract[1]/ns1:intA[1]

or

declare namespace soap='http://schemas.xmlsoap.org/soap/envelope/';
declare namespace tem='http://tempuri.org/';
//tem:Subtract[1]/tem:intA[1]
New Contributor

Re: SOAPUI Property Transfer XPATH

Thanks.  It worked.

New Here?
Join us and watch the welcome video:
SeptemberNews
Join the exciting event
SeptemberHubBub
Top Kudoed Authors
Join the September Hub-bub to show off, learn and win