Send to XML request and get XML response from API in ASP.Net Core MVC

namojainashish
 
on Feb 12, 2022 11:46 AM
1711 Views

Hello Team ,

I am stuck for API Creation kinldy help me .

I want to send request from XML format data and response need to xml.

Request: in XMl

<policy>
  <identity>
     <sign>c7003bf7-4f38-48f0-9dd0-218ab1fab001</sign>
     <branchsign>00000000-0000-0000-0000-000000000000</branchsign>
     <username>Vss_Test</username>
     <reference>VSS-01</reference>
  </identity>
  <plan>
     <categorycode>6b123144-2e3a-490e-baeb-b59f09327b7c</categorycode>
     <plancode>b0995c45-26a0-4fb9-b0df-07427662cc21</plancode>
     <basecharges>1276.00</basecharges>
     <totalbasecharges>1046.32</totalbasecharges>
     <servicetax>229.68</servicetax>
     <totalcharges>1276.00</totalcharges>
  </plan>
  <traveldetails>
     <departuredate>21-Feb-2022</departuredate>
     <days>8</days>
     <arrivaldate>28-Feb-2022</arrivaldate>
  </traveldetails>

  <insured>
     <passport>abcd1234</passport>
     <contactdetails>
         <address1>prem gali</address1>
         <address2/>
         <city>roop nagar</city>
         <district>test estate</district>
         <state>Chandigarh</state>
         <country>IN</country>
         <pincode>101010</pincode>
         <phoneno></phoneno>
         <mobile>9650593434</mobile>
         <emailaddress>vipul.singh@asego.in</emailaddress>
     </contactdetails>
         <name>test test</name>
         <dateofbirth>12-Nov-1990</dateofbirth>
         <age>31</age>
         <trawelltagnumber/>
         <nominee>BVSNV KKJKJ</nominee>
         <relation>WIFE</relation>
         <pastillness/>
  </insured>
     <otherdetails>
         <policycomment/>
         <universityname>fdc</universityname>
         <universityaddress>K</universityaddress>
         <sponsorname>ERTSA</sponsorname>
         <sponsorrelation>Father</sponsorrelation>
         <selfdeclarationmedical>no</selfdeclarationmedical>
         <selfdeclarationsports>no</selfdeclarationsports>
     </otherdetails>
</policy>

Response :

<data>
<status>String</status>
<policy>String</policy>
<document>String</document>
<reference>String</reference>
<claimcode>String</claimcode>
<errorcode>String</errorcode>
<message>String</message>
</data>

 

Download FREE API for Word, Excel and PDF in ASP.Net: Download
dharmendr
 
on Feb 14, 2022 12:44 AM