I’m trying to call a Web service via SOAP (https://modelviewers.pilotfishtechnology.com/modelviewers/OTA/model/Format.OTA_HotelRoomListRQ.html).
My code, so far, is:
var OTA_HotelRoomListRQ = new MyMapping.OTA_HotelRoomListRQ()
{
TimeStamp = DateTime.Now,
Version = 1,
HotelRoomLists = new HotelRoomListType[] { new HotelRoomListType { HotelCode = "12345" } }
};
MyMapping.OTA_HotelRoomListRS OTA_HotelRoomListRS = null;
var test = MyMapping_PortTypeClient.ReadRoomTypes(securityHeaderType, ref MessageID, ref to, ref from, ref action, OTA_HotelRoomListRQ, out OTA_HotelRoomListRS);
I get the following error:
There was an error in serializing one of the headers in message ReadRoomTypesRequest: 'Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'MySolution.ReadMapping.VendorMessageType[]' to 'MySolution.ReadMapping.VendorMessageType'
error CS0030: Cannot convert type 'MySolution.ReadMapping.VendorMessageType[]' to 'MySolution.ReadMapping.VendorMessageType'
error CS0029: Cannot implicitly convert type 'MySolution.ReadMapping.VendorMessageType' to 'MySolution.ReadMapping.VendorMessageType[]'
error CS0029: Cannot implicitly convert type 'MySolution.ReadMapping.VendorMessageType' to 'MySolution.ReadMapping.VendorMessageType[]'
'. Please see InnerException for more details.
I don’t understand what I’m missing and what the error references.