Extend responsetemplate to to get a customised response #349

Closed
opened 2025-12-29 08:26:45 +01:00 by adam · 2 comments
Owner

Originally created by @msutar021 on GitHub (Jul 14, 2021).

@StefH , This in continuation to the issue #619
Now i can get the request Tokenlist Node in response. I have to generate soap response based on the number of tokenids. for each tokenid , i need to create node with few attributes. If i can read each token id , i can generate response xml for that.

So my requirement is to generate customized response. I have attached my response.
Response.txt

<SOAP-ENV:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.test.nl/XMLHeader/10" xmlns:req="http://www.test.nl/RdplDbTknLystByOvkLyst/8/Req" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
	<SOAP-ENV:Header>
		<ns:testHeader>
			<ns:HeaderVersion>10</ns:HeaderVersion>
			<ns:MessageId>MsgId10</ns:MessageId>
			<ns:MessageTimestamp>2020-12-23T14:13:35.001+01:00</ns:MessageTimestamp>
		</ns:testHeader>
	</SOAP-ENV:Header>
	<SOAP-ENV:Body>
		<RdplDbTknLystByOvkLyst_RPY xmlns="http://www.test.nl/Betalen/COJ/Services/RdplDbTknLystByOvkLyst/8/Rpy">
			<TokensIndicatie>J</TokensIndicatie>
			<MaxIndicatie>N</MaxIndicatie>
			<TokenDetails>
				<TokenId>0000083256</TokenId>
				<TokenType>1</TokenType>
				<PAN>6733360123453949004</PAN>
				<PSN>1</PSN>
				<RekeningNummer>34546</RekeningNummer>
				<IBAN>NL21test0874567235</IBAN>
			</TokenDetails>
			<TokenDetails>
				<TokenId>0000083052</TokenId>
				<TokenType>1</TokenType>
				<Test1>2343454657976234</Test1>
				<Test2>1</Test2>
				<Test3>2345557</Test3>
				<Test4>AC95test0667705023</Test4>
			</TokenDetails>
			<GenIndi>N</GenIndi>
		</RdplDbTknLystByOvkLyst_RPY>
	</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Please suggest how can i achieve this.

Originally created by @msutar021 on GitHub (Jul 14, 2021). @StefH , This in continuation to the issue #619 Now i can get the request Tokenlist Node in response. I have to generate soap response based on the number of tokenids. for each tokenid , i need to create node with few attributes. If i can read each token id , i can generate response xml for that. So my requirement is to generate customized response. I have attached my response. [Response.txt](https://github.com/WireMock-Net/WireMock.Net/files/6816075/Response.txt) ``` xml <SOAP-ENV:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.test.nl/XMLHeader/10" xmlns:req="http://www.test.nl/RdplDbTknLystByOvkLyst/8/Req" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Header> <ns:testHeader> <ns:HeaderVersion>10</ns:HeaderVersion> <ns:MessageId>MsgId10</ns:MessageId> <ns:MessageTimestamp>2020-12-23T14:13:35.001+01:00</ns:MessageTimestamp> </ns:testHeader> </SOAP-ENV:Header> <SOAP-ENV:Body> <RdplDbTknLystByOvkLyst_RPY xmlns="http://www.test.nl/Betalen/COJ/Services/RdplDbTknLystByOvkLyst/8/Rpy"> <TokensIndicatie>J</TokensIndicatie> <MaxIndicatie>N</MaxIndicatie> <TokenDetails> <TokenId>0000083256</TokenId> <TokenType>1</TokenType> <PAN>6733360123453949004</PAN> <PSN>1</PSN> <RekeningNummer>34546</RekeningNummer> <IBAN>NL21test0874567235</IBAN> </TokenDetails> <TokenDetails> <TokenId>0000083052</TokenId> <TokenType>1</TokenType> <Test1>2343454657976234</Test1> <Test2>1</Test2> <Test3>2345557</Test3> <Test4>AC95test0667705023</Test4> </TokenDetails> <GenIndi>N</GenIndi> </RdplDbTknLystByOvkLyst_RPY> </SOAP-ENV:Body> </SOAP-ENV:Envelope> ``` Please suggest how can i achieve this.
adam added the question label 2025-12-29 08:26:45 +01:00
adam closed this issue 2025-12-29 08:26:45 +01:00
Author
Owner

@msutar021 commented on GitHub (Jul 19, 2021):

Any suggestion on this. Waiting for your response.

@msutar021 commented on GitHub (Jul 19, 2021): Any suggestion on this. Waiting for your response.
Author
Owner

@StefH commented on GitHub (Jul 23, 2021):

With Handlebars.Net , a lot is possible. However I don't have a example for that.

@StefH commented on GitHub (Jul 23, 2021): With Handlebars.Net , a lot is possible. However I don't have a example for that.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/WireMock.Net#349