I've created some code that calls the econnect webservice to insert a new sop document. However when I try to run it, it fails on the GetNextSopNumber function .