![]() SetResponseContent ( Content ) ĮXIT ( ResponseMessage. Send ( RequestMessage, ResponseMessage ) Add( 'Authorization', StrSubstNo ( 'Basic %1', convertOutputText )) CreateInStream ( blobInstream, TextEncoding ::Windows ) ĬonvertOutputText := Base64Convert. CreateOutStream ( blobOutStream, TextEncoding ::Windows ) Accept ) ĪuthText := StrSubstNo ( '%1:%2' , Parameters. Procedure CallRESTWebService ( var Parameters: Record RESTWebServiceArguments ) : Booleanīase64Convert: Codeunit "Base64 Convert" The next codeunit to create is for calling REST web services: Procedure GetJsonValue ( var JSonObject : JsonObject Property: Text var JsonValue : JsonValue) : Boolean If not GetJsonValue (JSonObject ,Property, JsonValue) then Procedure GetJsonValueAsText ( var JSonObject : JsonObject Property: Text) Value : text Next create Codeunits used to call the Web Service, firstly a method to handle the JSON: Procedure GetResponseHeaders ( var value : HttpHeaders) Procedure SetResponseHeaders ( var value : HttpHeaders) ![]() Procedure GetResponseContentAsText () ReturnValue: text Procedure GetResponseContent ( var value : HttpContent) Procedure HasResponseContent () : Boolean Procedure SetResponseContent ( var value : HttpContent) Procedure GetRequestContent ( var value : HttpContent) Procedure SetRequestContent ( var value : HttpContent) GenerateBarcode ( Rec ) Ĭreate a second table to store the Web Service parameters:įield( 1 PrimaryKey Integer) GenerateBarcodeCode: Codeunit GenerateBarcode OptionMembers = " ",Code11,QRCode,Code128,Code25IL,Code39,Code39FullASCII,Code93,EANUCC128,MSI,TelepenAlpha,EAN8,EAN13,UPCA,UPCE If you want to use the Barcodes4me API then comment out the code below. If you want to use the Barcodes4me API then uncomment the code below.
0 Comments
Leave a Reply. |