I get the same error shown when using the GetBooking & GetBookings web api calls. Any ideas why ?
Error:
GetBooking:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v1="http://www.skyline.be/api/v1">
<soap:Header/>
<soap:Body>
<v1:GetBooking>
<!--Optional:-->
<v1:connection>d3ee5cee-92f3-4df6-874a-583ab3bab40b</v1:connection>
<!--Optional:-->
<v1:bookingID>6e19ae89-74d2-42ed-9683-a6b02d493a73</v1:bookingID>
</v1:GetBooking>
</soap:Body>
</soap:Envelope>
GetBookings:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:v1="http://www.skyline.be/api/v1">
<soap:Header/>
<soap:Body>
<v1:GetBookings>
<!--Optional:-->
<v1:connection>d3ee5cee-92f3-4df6-874a-583ab3bab40b</v1:connection>
<!--Optional:-->
<v1:filter>
</v1:filter>
</v1:GetBookings>
</soap:Body>
</soap:Envelope>
Hi Wale,
Please could you check first that you are running a DMA version higher than 10.0.3.0 (check DataMiner Web API documentation).
I performed a small test using DMA 10.1.1.0-9843 and I was able to retrieve bookings through the API. Please find below examples for each request (JSON):
GetBooking:
POST http://127.0.0.1/API/v1/json.asmx/GetBooking
Content-Type: "application/json"
{
"connection": "abcd1234-1234-4321-5678-12345678abcd",
"bookingID": "8048d568-680f-4330-bd8b-b71a7d3e6a4e"
}
GetBookings:
POST http://127.0.0.1/API/v1/json.asmx/GetBookings
Content-Type: "application/json"
{
"connection": "abcd1234-1234-4321-5678-12345678abcd",
"filter": {
"Children": [],
"Condition": {
"method": "contains",
"value": "MyBookingName",
"ID": "ReservationInstanceExposers.Name"
}
},
"amount": 1
}
Hi Wale,
I tested ‘GetBooking’ in my local setup and I got the same issue:
+++++++++++++++++++++++++++++
System.InvalidOperationException: The type System.TimeSpan was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically
+++++++++++++++++++++++++++++
Checking the WSDL specification, GetBooking requires only two inputs (connectioId and BookingId), but the error refers to a timespan not expected.
Unless another colleague confirms that we are missing another attribute,
could you create a task reporting this issue?
Thanks for confirming further Miguel. I have created a task for this.
This is indeed a software issue which should be investigated further by the software development team.
Issue has been resolved from the following versions onwards:
10.1.0 [CU20] ; 10.2.0 [CU8] & 10.2.11
Thanks Miguel, I am using the same DMA version (10.1.1.0). I have narrowed down the issue further and the error occurs when the payload is in xml format. When I send the request in JSON like yours I get a succesful response.