aveo
15 years agoNew Contributor
Configure several response for Mock service
Hi every one!
First, i would like to apologize for my english ... You will see in this message, it's not my mother tong
Anyway, why i'm writing this post ?
I'm using soapUi for the first time. I'm trying to create a mock reponse to replace the response to a webservice. For the moment no prob.
Things are being messy to me when i'm trying to get diferent reponse accorded to an information in my request message.
I tried to use the discard xpath option but it's not working. And the same thing with Query Match.
Here my request:
My Response:
I would accorded to the _IdContact, give a different response.
To do so, i have done the tuto on the soap ui page:
I tried xpath using this expression:
It's always gave me "xpath expression return a null"
I tried query match with the same and it's doing nothing.
If anyone have an idea of what happen it would realy help me !
Thanks a lot !
First, i would like to apologize for my english ... You will see in this message, it's not my mother tong

Anyway, why i'm writing this post ?
I'm using soapUi for the first time. I'm trying to create a mock reponse to replace the response to a webservice. For the moment no prob.
Things are being messy to me when i'm trying to get diferent reponse accorded to an information in my request message.
I tried to use the discard xpath option but it's not working. And the same thing with Query Match.
Here my request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cff="http://schemas.datacontract.org/2010/08/Cff.Modeles.WebServices.CffHeader" xmlns:tem="http://tempuri.org/">
<soapenv:Header>
<h:CffHeader xmlns:h="http://schemas.datacontract.org/2010/08/Cff.Modeles.WebServices.CffHeader" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<h:ApplicationCliente>Domus</h:ApplicationCliente>
<h:Code>43199</h:Code>
<h:Utilisateur/>
<h:UtilisateurPrimaire i:nil="true"/>
<h:UtilisateurSecondaire/>
</h:CffHeader>
</soapenv:Header>
<soapenv:Body>
<LireClient xmlns="http://tempuri.org/">
<_IdContact>1</_IdContact>
<_IdPrescipteur>000069370</_IdPrescipteur>
</LireClient>
</soapenv:Body>
</soapenv:Envelope>
My Response:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<LireClientResponse xmlns="http://tempuri.org/">
<LireClientResult xmlns:a="http://schemas.datacontract.org/2004/07/Cff.Modeles.WebServices" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:CodeRetour>true</a:CodeRetour>
<a:ListeMessageMetier/>
<a:Valeur xmlns:b="http://schemas.datacontract.org/2004/07/Cff.Modeles.Crm">
<b:Contact>
<b:Civilite>1</b:Civilite>
<b:DateNaissance>1984-07-24T00:00:00</b:DateNaissance>
<b:NomNaissance>Soap</b:NomNaissance>
<b:Prenom>Ui</b:Prenom>
</a:Valeur>
</LireClientResult>
</LireClientResponse>
</s:Body>
</s:Envelope>
I would accorded to the _IdContact, give a different response.
To do so, i have done the tuto on the soap ui page:
I tried xpath using this expression:
declare namespace s='http://tempuri.org/'
//s:LireClient[1]/s:_IdContact[1]
It's always gave me "xpath expression return a null"
I tried query match with the same and it's doing nothing.
If anyone have an idea of what happen it would realy help me !
Thanks a lot !