Getting Error when calling NAV web service.

SuDSuD Member Posts: 102
Helloo Experts!!

Good Day!!

Here is a scenario which I m on working. I have a function in a NAV codeunit , in that function I m calling a external API with the help of Automation Variables.
Variables are
Name DataType Subtype Length
locautXmlDoc Automation 'Microsoft XML, v6.0'.DOMDocument60
XmlHttp Automation 'Microsoft XML, v6.0'.XMLHTTP60

I have published this codeunit , and then I m consuming it in a .NET web site, but when the function inside the web service going to execute I getting below error.
{"Microsoft Dynamics NAV Business Web Services attempted to issue a client callback to create an Automation object: 88d96a05-f192-11d4-a65f-0040963251e5 (CodeUnit 50001 Payment Gateway). Client callbacks are not supported on Microsoft Dynamics NAV Business Web Services."}

Some where (https://community.dynamics.com/nav/f/34/t/153096) I found related issue, but couldn't resolved the issue by suggested solutions.
I cant use DotNet variable with this solution as I m having issue with DotNet var also kind of SSL\TLS and ACCESS DENIED error.

CODE is below

RunTime := TRUE;
CLEAR(ResponseCode);
CLEAR(ResponseText);
IF NOT GUIALLOWED THEN
BEGIN
IF NOT ISCLEAR(locautXmlDoc) THEN
CLEAR(locautXmlDoc);
IF ISCLEAR(locautXmlDoc) THEN
CREATE(locautXmlDoc,FALSE,RunTime);
END;
locautXmlDoc.async:=TRUE;

locautXmlDoc.save('D:\NAV\createTransactionRequestChargeCard.xml');
IF NOT GUIALLOWED THEN
BEGIN
IF NOT ISCLEAR(XmlHttp) THEN
CLEAR(XmlHttp);
IF ISCLEAR(XmlHttp) THEN
CREATE(XmlHttp,FALSE,RunTime);
END;

XmlHttp.open('POST','https://apitest.authorize.net/xml/v1/request.api',FALSE);

XmlHttp.setRequestHeader('Content-type', 'text/xml');
XmlHttp.setRequestHeader('SOAPAction','https://apitest.authorize.net/xml/v1/request.api');
XmlHttp.send(locautXmlDoc);
ResponseText := COPYSTR(STRSUBSTNO(XmlHttp.responseText),1,1024);

locautXmlDoc.load(XmlHttp.responseBody);
locautXmlDoc.save('D:\createTransactionResponseChargeCard.xml');
IF XmlHttp.status <> 200 THEN
BEGIN
LastError := XmlHttp.statusText;
EXIT(FALSE);
END
ELSE
EXIT(TRUE);


Please have a look on this error, and help me out if any one have idea to resolve this.

Kind Regards

Sudarshan

Comments

Sign In or Register to comment.