every once in a while a player sends a request message to us (support, consulting) for a reproduction of a case. More and more often we encounter a "we can't reproduce the request in the raw request runner without applying some manual changes...". Here is an example:
{
"message": "Cannot construct instance of `com.ptvgroup.xserver.xtour.Location` (no Creators, like default constructor, exist): abstract types either need to be mapped to concrete types, have custom deserializer, or contain additional type information\n at [Source: (org.apache.cxf.transport.http.AbstractHTTPDestination$1); line: 38180, column: 1] (through reference chain: com.ptvgroup.xserver.xtour.PlanToursRequest[\"locations\"]->java.util.ArrayList[0])",
"errorLine": 38180,
"errorColumn": 1,
"faultType": "com.ptvgroup.xserver.exceptions.InvalidRequestFault"
}
The engine needs t know whether this location is a DepotSite or a CustomerSite.
Please ensure to provide requests / responses in a proper, complete way. JSON is state of the art. XML/SOAP is also possible but not the first choice...
Maybe you have to check the settings of the serializer / deserializer you use.
Bernd
Bernd Welter Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...
Here's some feedback from a partner who uses the C# clients we shipped with the xServer 2 (xserver-client-bundle-VERSION.zip):
Within the "Xserver.cs" class there's the Initialize() method where the JsonSerializerSettings based on NewtonSoft / Microsoft.Rest are initialised. He then applies those settings in combination with SafeJsonConvert.DeserializeObject<T>() or SafeJsonConvert.SerializeObject() which returns the proper message bodies.
If you want to use Microsoft's Serializer you have to
implement new Converters and
update the attributes of the entity classes which you want to use for the Serialisation
Unfortunately the Microsoft.Rest library is deprecated.
Bernd Welter Technical Partner Manager Developer Components
PTV Logistics - Germany
Bernd at... The Forum,LinkedIn, Youtube, StackOverflow
I like the smell of PTV Developer in the morning...