/**
 * Copyright (C) Posten Norge AS
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *         http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package no.digipost.api.client.util;

import no.digipost.api.client.representations.Autocomplete;
import no.digipost.api.client.representations.DocumentEvents;
import no.digipost.api.client.representations.DocumentStatus;
import no.digipost.api.client.representations.EncryptionKey;
import no.digipost.api.client.representations.EntryPoint;
import no.digipost.api.client.representations.ErrorMessage;
import no.digipost.api.client.representations.Identification;
import no.digipost.api.client.representations.IdentificationResultWithEncryptionKey;
import no.digipost.api.client.representations.Message;
import no.digipost.api.client.representations.MessageDelivery;
import no.digipost.api.client.representations.Recipients;
import no.digipost.api.client.representations.sender.SenderInformation;

import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;

import java.io.InputStream;
import java.io.OutputStream;

public class JAXBContextUtils {
    public static final JAXBContext entryPointContext = initContext(EntryPoint.class);
    public static final JAXBContext errorMessageContext = initContext(ErrorMessage.class);
    public static final JAXBContext identificationContext = initContext(Identification.class);
    public static final JAXBContext messageContext = initContext(Message.class);
    public static final JAXBContext recipientsContext = initContext(Recipients.class);
    public static final JAXBContext autocompleteContext = initContext(Autocomplete.class);
    public static final JAXBContext documentEventsContext = initContext(DocumentEvents.class);
    public static final JAXBContext documentStatusContext = initContext(DocumentStatus.class);
    public static final JAXBContext messageDeliveryContext = initContext(MessageDelivery.class);
    public static final JAXBContext encryptionKeyContext = initContext(EncryptionKey.class);
    public static final JAXBContext identificationResultWithEncryptionKeyContext = initContext(IdentificationResultWithEncryptionKey.class);
    public static final JAXBContext senderInformationContext = initContext(SenderInformation.class);

    private static JAXBContext initContext(Class<?> clazz) {
        try {
            return JAXBContext.newInstance(clazz);
        } catch (JAXBException e) {
            throw new RuntimeException(e.getMessage(), e);
        }
    }

    public static void marshal(JAXBContext context, Object objectToMarshall, OutputStream outputStream){
        try {
            context.createMarshaller().marshal(objectToMarshall, outputStream);
        } catch (JAXBException e) {
            throw new RuntimeException("Failed when trying to marshal object to outputstream", e);
        }
    }

    public static <T> T unmarshal(JAXBContext context, InputStream inputStream, Class<T> type){
        try {
            return type.cast(context.createUnmarshaller().unmarshal(inputStream));
        } catch (JAXBException e) {
            throw new RuntimeException("Failed when trying to unmarshal inputstream to object", e);
        }
    }
}

@@ -684,646 +684,9 @@
 ons.
-Autocomplete;%0Aimport no.digipost.api.client.representations.DocumentEvents;%0Aimport no.digipost.api.client.representations.DocumentStatus;%0Aimport no.digipost.api.client.representations.EncryptionKey;%0Aimport no.digipost.api.client.representations.EntryPoint;%0Aimport no.digipost.api.client.representations.ErrorMessage;%0Aimport no.digipost.api.client.representations.Identification;%0Aimport no.digipost.api.client.representations.IdentificationResultWithEncryptionKey;%0Aimport no.digipost.api.client.representations.Message;%0Aimport no.digipost.api.client.representations.MessageDelivery;%0Aimport no.digipost.api.client.representations.Recipients
+*
 ;%0Aim
@@ -1185,24 +1185,52 @@
 cation.class
+, IdentificationResult.class
 );%0A    publi
@@ -2102,16 +2102,16 @@
 lass);%0A%0A
-
     priv
@@ -2153,16 +2153,19 @@
 Class%3C?%3E
+...
  clazz) 

Add missing IdentificationResult.class to JAXBContext