Quantcast
Channel: Microsoft Dynamics AX Forum - Recent Threads
Viewing all articles
Browse latest Browse all 73760

Error using external webservice

$
0
0

Hi all,

I have an issue with the following:

I want to use an existing external webservice called: http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl

I added this webservice to visual studio and deployed to AOT, this part is correct as far as i can see.

I want to click on a button, then check if the VAT number is valid.

I first wanted to use xmlDocumnet to read te result, but that didn't work. So now i want to store the result in a string, to see if it worked.

Now i get an error: "Argument 1 is not compatible with required data type" on the following line "response = serviceClient.checkVat("NL", "12345673", false, "", ""); "

Can someone advise me how to get this to work.

Bellow is my complete code:

 

void clicked()
{
    //super();

ClrObject serviceClientType;
vhvVATCheck.Proxies.vhvVATService.checkVatPortTypeClient serviceClient;

System.Exception ex;
str response;
XmlDocument xmlDoc;

new InteropPermission(InteropKind::ClrInterop).assert();

try
{serviceClientType = CLRInterop::getType("vhvVATCheck.Proxies.vhvVATService.checkVatPortTypeClient");
serviceClient = AifUtil::CreateServiceClient(serviceClientType);

response = serviceClient.checkVat("NL", "12345673", false, "", "");   <<<ERROR

xmlDoc = new XmlDocument();
xmlDoc.loadXml(response);

info(strFmt(xmlDoc.xml()));
    }
    catch(Exception::CLRError)
    {
        info(CLRInterop::getLastException().toString());
    }
}

 

Thanks,

 

Eddy


Viewing all articles
Browse latest Browse all 73760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>