Do we have support for JSON? Can we generate a virtual service from the JSON-WSP? How about from request/response JSON pairs?
Do we have support for JSON? Can we generate a virtual service from the JSON-WSP? How about from request/response JSON pairs?
As it turns out my customers sent in XML requests and expected JSON responses. So I used the WSDL and generated the virtual service. Next I modified the responses to be JSON and now everybody is happy. See below details for the GetCampusInfo and GetCampuses operations that were virtualized:
GetCampusInfo
Request(XML):
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<soapenv:Body>
<GetCampusInfo xmlns="http://tempuri.org/">
<CampusID>1</CampusID>
</GetCampusInfo>
</soapenv:Body>
</soapenv:Envelope>
Response(JSON):
{"Locations":[{"LocationID":1,"LocationName":"Tower Building","CampusID":1},{"LocationID":2,"LocationName":"North Plaza","CampusID":1},{"LocationID":3,"LocationName":"Home Office","CampusID":1}],"Floors":[{"FloorID":1,"FloorName":"T1","LocationID":1},{"FloorID":2,"FloorName":"T2","LocationID":1},{"FloorID":3,"FloorName":"T3","LocationID":1}],"MeetingSpaces":[{"MeetingSpaceID":1,"MeetingSpaceName":"~CTHO CR T1 CITS Conference Room","MeetingSpaceType":"Bronze Conference Room","MeetingSpaceDescription":"~CTHO CR T1 CITS Conference Room","Map":{"MapID":1,"MapName":"CITS T1 Conference Room Map","LastUpdated":"5/28/2015 1:22:53 PM","MapImage":"http://ad1hfdcas901.ad1.prod:8091/GetMap.aspx?MapID=1"}},{"MeetingSpaceID":2,"MeetingSpaceName":"~CTHO CR T1-1-1 (10, A/V, VTC)","MeetingSpaceType":"Gold Conference Room","MeetingSpaceDescription":"~CTHO CR T1-1-1 (10, A/V, VTC)","Map":{"MapID":1,"MapName":"CITS T1 Conference Room Map","LastUpdated":"5/28/2015 1:22:53 PM","MapImage":"http://ad1hfdcas901.ad1.prod:8091/GetMap.aspx?MapID=1"}}]}
GetCampuses
Request(XML):
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<soapenv:Body>
<GetCampuses xmlns="http://tempuri.org/">
</GetCampuses>
</soapenv:Body>
</soapenv:Envelope>
Response(JSON):
[{"CampusID":1,"CampusName":"Hartford Campus","LastUpdated":"5/28/2015 1:21:36 PM","Address":"One Hartford Plaza Hartford, CT 06120"},{"CampusID":2,"CampusName":"Windsor Campus","LastUpdated":"5/28/2015 1:21:36 PM","Address":"One Griffith Road Windsor, CT 06095"},{"CampusID":3,"CampusName":"Simsbury Campus","LastUpdated":"5/28/2015 1:21:36 PM","Address":"200 Hopemeadow street Simsbory, CT 06089"}]
Thanks everyone! I am off to a good start with several possibilities.