To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml
HTTP + XML
The following are sample HTTP requests and responses.
The placeholders shown need to be replaced with actual values.
POST /calculator/optimalportfolio HTTP/1.1
Host: api.portfoliolink.co.za
Accept: application/xml
Content-Type: application/xml
Content-Length: length
<CalculateOptimalPortfolio xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PortfolioLinkApi.ServiceModel">
<ClientId>0</ClientId>
<CurrentSavings>0</CurrentSavings>
<ExpectedInflationRate>0</ExpectedInflationRate>
<LifeExpectancyAge>0</LifeExpectancyAge>
<WithdrawalAmount>0</WithdrawalAmount>
<WithdrawalGrowthRate>0</WithdrawalGrowthRate>
</CalculateOptimalPortfolio>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length
<CalculateOptimalPortfolioResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PortfolioLinkApi.ServiceModel">
<AgeRunOutOfMoneyPessimistic>0</AgeRunOutOfMoneyPessimistic>
<ClosingBalancePessimistic>0</ClosingBalancePessimistic>
<PortfolioId>0</PortfolioId>
<PortfolioName>String</PortfolioName>
<PortfolioReturn>0</PortfolioReturn>
<PortfolioShortName>String</PortfolioShortName>
<PortfolioStandardDeviation>0</PortfolioStandardDeviation>
</CalculateOptimalPortfolioResponse>