Ask a Question

Transferring property values using a WSDL

SOLVED
Aksingia
Occasional Contributor

Transferring property values using a WSDL

Hello,

I using SOAPUI to test a suite of CICS webservices. I have the corresponding WSDLs.
But I can't find the way to transfer values from a response to a request.

 

Here is a samble of the wsdl. In the response, there is a table (here 2 occurs/lignes)

<SOAP-ENV:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gdox="http://www.GDOXBAZ.GDOXBAZI.Request.com" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
   <SOAP-ENV:Body>
      <GDOXBAZOperationResponse xmlns="http://www.GDOXBAZ.GDOXBAZO.Response.com">
         <data_appli>
            <exports>
               <export_appli_document>
                  <export_tab_doc>
                     <export_tab_doc_lig>
                        <export_id_doc_stk>80</export_id_doc_stk>
                     </export_tab_doc_lig>
                  </export_tab_doc>
                  <export_tab_doc>
                     <export_tab_doc_lig>
                        <export_id_doc_stk>81</export_id_doc_stk>
                     </export_tab_doc_lig>
                  </export_tab_doc>
               </export_appli_document>
            </exports>
         </data_appli>
      </GDOXBAZOperationResponse>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gdox="http://www.GDOXBA0.GDOXBA0I.Request.com">
   <soapenv:Header/>
   <soapenv:Body>
      <gdox:GDOXBA0Operation>
         <gdox:data_appli>
            <gdox:imports>
               <gdox:import_id_doc_stk>80</gdox:import_id_doc_stk>
            </gdox:imports>
         </gdox:data_appli>
      </gdox:GDOXBA0Operation>
   </soapenv:Body>
</soapenv:Envelope>

 

 

Based on what I have seen before I've tried :

 

declare namespace SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/";
//SOAP-ENV:Body/GDOXBAZOperationResponse/data_appli/exports/export_appli_document/export_tab_doc[1]/export_tab_doc_lig/export_id_doc_stk

 

moving the [1] to different lvels and without it also. But also "missing match". For now I'm trying to move it to a tempory variable (property?) until I can access the source. But in fine I want to move it directly in the import variable.

 

Anyone can help me? Thank you very much.

1 ACCEPTED SOLUTION

Accepted Solutions
HKosova
Moderator

Re: Transferring property values using a WSDL

Hi Aksingia,

 

You can use inline property expansion:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gdox="http://www.GDOXBA0.GDOXBA0I.Request.com">
   <soapenv:Header/>
   <soapenv:Body>
      <gdox:GDOXBA0Operation>
         <gdox:data_appli>
            <gdox:imports>
               <gdox:import_id_doc_stk>${Previous Step Name#Response#(//*:export_id_doc_stk)[1]}</gdox:import_id_doc_stk>
            </gdox:imports>
         </gdox:data_appli>
      </gdox:GDOXBA0Operation>
   </soapenv:Body>
</soapenv:Envelope>

 

or the Property Transfer step with this config:
Source: the source step
Property: Response or ResponseAsXml
Path language: XPath
Expression:

(//*:export_id_doc_stk)[1]

(meaning: find all "export_id_doc_stk" nodes and take the first match)

 

Target: the target step
Property: Request
Path language: XPath
Expression:

//*:import_id_doc_stk

 

In XPath, "//" means "find the element on any level" and "*" matches any namespace prefix, allowing for shorter and simpler notation.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

2 REPLIES 2
HKosova
Moderator

Re: Transferring property values using a WSDL

Hi Aksingia,

 

You can use inline property expansion:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gdox="http://www.GDOXBA0.GDOXBA0I.Request.com">
   <soapenv:Header/>
   <soapenv:Body>
      <gdox:GDOXBA0Operation>
         <gdox:data_appli>
            <gdox:imports>
               <gdox:import_id_doc_stk>${Previous Step Name#Response#(//*:export_id_doc_stk)[1]}</gdox:import_id_doc_stk>
            </gdox:imports>
         </gdox:data_appli>
      </gdox:GDOXBA0Operation>
   </soapenv:Body>
</soapenv:Envelope>

 

or the Property Transfer step with this config:
Source: the source step
Property: Response or ResponseAsXml
Path language: XPath
Expression:

(//*:export_id_doc_stk)[1]

(meaning: find all "export_id_doc_stk" nodes and take the first match)

 

Target: the target step
Property: Request
Path language: XPath
Expression:

//*:import_id_doc_stk

 

In XPath, "//" means "find the element on any level" and "*" matches any namespace prefix, allowing for shorter and simpler notation.


Helen Kosova
SmartBear Documentation Team Lead
________________________
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️

View solution in original post

Aksingia
Occasional Contributor

Re: Transferring property values using a WSDL

Thank you.

cancel
Showing results for 
Search instead for 
Did you mean: