Codeunit XMLPort Webservice - strange behaviour

jaylefermjayleferm Member Posts: 13
edited 2014-09-25 in NAV Three Tier
Hello folks,

I've created a XMLPort, avaiable as a webservice via a codeunit (standard functions). The call of the webservice should create one record and respond with the number of the number series and the validated information from the created record.

When I call the webservice via SoapUI or BizTalk, the respond works properly and it creates one record with the data I've sent, but unfortunately it creates a second record with empty information, too.

This is the codeunit:
CreateRecord(VAR createRecord : XMLport "Create Record") : Text[1000]
CLEARLASTERROR;
IF NOT createRec.IMPORT THEN BEGIN
  ERROR(GETLASTERRORTEXT);
END ELSE BEGIN
  createRec.GetNo(locRecNo);
  locRecord.SETRANGE("No.",locRecNo);
  locRecord.FINDLAST;
  createRec.SETTABLEVIEW(locRecord);
  EXIT('created Record:'+ locRecNo);
END;

XMLPort:
Record - Import::OnAfterInsertRecord()
gNumber := Record."No.";
[...]
GetNo(VAR pNumber : Code[20])
pNumber := gNumber;

I've tried to set the MaxOccurs setting to Once in the XMLPort, but then I receive another error message that the record occurred more than once. I've also tried to remove the IMPORT function, but then nothing will be created. I guess that the call of the XMLPort by the codeunit adds two node elements, but I don't know how to solve this.

I'm using NAV 2009 R2 with Build 34087

Answers

  • jaylefermjayleferm Member Posts: 13
    It seems that this is a bug regarding to this build number.
    I've updated the webservice on the NST to the latest version and it works now. \:D/
  • tinoruijstinoruijs Member Posts: 1,226
    Great! Thanks for sharing the feedback for the solution!

    Tino Ruijs
    Microsoft Dynamics NAV specialist
Sign In or Register to comment.