Using SOAPFormatter getting unexpected token error RRS feed

  • Question

  • We have a situation where we an application running on one machine and another application on another machine. One application is serializing to an xml file (using the SOAPFormatter) and the other is de-serializing from the file (using the SOAPFormatter).

    Occasionally we get an error on de-serialization as follows:

    '  er et uventet token. Forventet token er =. Linje 256, plassering 14’ i.e. ' is an unexpected token. Expected token is =. Line 256, position 14’

    It is always the same error and it only occurs once every day or so. I have tried to save off the stream that is being de-serialized to see if the xml is invalid but it appears to be completely valid when I try and load it into the system.

    Not sure if this is relevant but one machine has the locale set to the United Kingdom and the other has the locale set to Norwegian. The machine that is de-serializing has had the locale set to Norwegian.

    Please note that I cannot repeat this issue on any of my systems – this only appears to happen on the customer system.



    Wednesday, October 17, 2012 3:04 PM


  • Hi Ian,

    Based on the error description, it seems that it is related to the locale settings. 

    You can find that the text has been translated to Swedish. So you need to change the setting of your application. You need to use the English for all your file, without using the locale language.

    Best regards,

    Mike Feng
    MSDN Community Support | Feedback to us
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Thursday, October 18, 2012 8:45 AM