• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

check tax number at our coldfusion sytem of crm-erp

Explorer ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

Hello,

I want to  check tax number at our coldfusion sytem of crm-erp.For example we are adding a company of our crm but we dont know that its tax number true or false.So ı tried  make it like this code but ıts not work.Can u help me please?

<cfscript>
wsURL = ' http://185.198.197.162/vknsorgulama/getall/dogrulama?vkn=18644905568&durum=2';
Ad= 'GÜNGÖR',
Soyad= 'YILMAZ',
BabaAdi= 'MEMET',
VergiDairesiAdi= 'KALEKAPI',
VergiDairesiKodu= '007252',
VKN= '9690365396',
Unvan= null,
</cfscript>

<cfxml variable="requestXML"><cfoutput>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header/>
<soap:Body>
<ws:VKN>
<ws:VKN>#VKN#</ws:VKN>
<!--Optional:-->
<ws:Ad>#Ad#</ws:Ad>
<!--Optional:-->
<ws:Soyad>#Soyad#</ws:Soyad>
<ws:VergiDairesiAdi>#VergiDairesiAdi#</ws:VergiDairesiAdi>
</ws:VKN>
</soap:Body>
</soap:Envelope></cfoutput>
</cfxml>

<cfhttp url = "#wsURL#" method = "post" result = "res">
<cfhttpparam type="header" name="content-type" value="text/xml">
<cfhttpparam type="header" name="SOAPAction" value="http://tempuri.org/DisKullaniciKimlikDogrula2">
<cfhttpparam type="header" name="content-length" value="#len(trim(requestXML))#">
<cfhttpparam type="header" name="charset" value="utf-8">
<cfhttpparam type="xml" name="message" value="#trim(requestXML)#">
</cfhttp>

<cfset VKNResult = xmlParse(res.FileContent).Envelope.Body.VKNResponse.VKNResult.XmlText>

<cfdump var="#VKNnResult#">

Views

326

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 2 Correct answers

Community Expert , Oct 19, 2020 Oct 19, 2020

Hi nurcanb61753314,

 

The best example is your own code. So I have included some suggestions in it.

 

Please note something John123 said: the result is JSON, not XML

 

 

<cfscript>
wsURL = 'http://185.198.197.162/vknsorgulama/getall/dogrulama?vkn=18644905568&durum=2';
Ad= 'GÜNGÖR';
Soyad= 'YILMAZ';
BabaAdi= 'MEMET';
VergiDairesiAdi= 'KALEKAPI';
VergiDairesiKodu= '007252';
VKN= '9690365396';
Unvan= 'null';
</cfscript>

<cfoutput>
<cfsavecontent variable="requestXML"><?xml version="1.0" encoding="
...

Votes

Translate

Translate
Explorer , Oct 20, 2020 Oct 20, 2020

First really ı understand and ı can forget again.Thank  u so much really u helping 🙂

Votes

Translate

Translate
Participant ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

In the first part of the script where you are setting variables you need to have a semi colon at the end of each line rather than commas.

 

The call to the remote service is completing successfully but it is not returning XML. If you dump the result of the call, the "res" variable, you will see the response in FileContent looks like JSON however it does not seem to be valid JSON when I try to decode it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

The return in FileContent is valid JSON, I mistyped something in my test, so you need to deserialize it to a CF structure. Use dataStruct = deserializeJSON(res.FileContent); to convert the returned JSON then you can reference the result values in dataStruct.

 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

Thank u so much for u helping first.Maybe ı can see an example about that ı can understand do u have any link for this topic?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 19, 2020 Oct 19, 2020

Copy link to clipboard

Copied

Hi nurcanb61753314,

 

The best example is your own code. So I have included some suggestions in it.

 

Please note something John123 said: the result is JSON, not XML

 

 

<cfscript>
wsURL = 'http://185.198.197.162/vknsorgulama/getall/dogrulama?vkn=18644905568&durum=2';
Ad= 'GÜNGÖR';
Soyad= 'YILMAZ';
BabaAdi= 'MEMET';
VergiDairesiAdi= 'KALEKAPI';
VergiDairesiKodu= '007252';
VKN= '9690365396';
Unvan= 'null';
</cfscript>

<cfoutput>
<cfsavecontent variable="requestXML"><?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
    <soapenv:Header/>
    
<!-- 
     The function (ws operation) name here is nameOfWSOperation. 
     Its argument, named 'VKN', is a complex type. 
     The element VKN has sub-elements VKN, Ad, Soyad and VergiDairesiAdi
 -->
    <soapenv:Body>
          <ws:nameOfWSOperation soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
            <ws:VKN>
			<ws:VKN>#VKN#</ws:VKN>
			<!--Optional:-->
			<ws:Ad>#Ad#</ws:Ad>
			<!--Optional:-->
			<ws:Soyad>#Soyad#</ws:Soyad>
			<ws:VergiDairesiAdi>#VergiDairesiAdi#</ws:VergiDairesiAdi>
			</ws:VKN>
          </ws:nameOfWSOperation>
    </soapenv:Body>
</soapenv:Envelope>
</cfsavecontent>

</cfoutput>



<cfhttp url = "#wsURL#" method = "post" result = "res">
<cfhttpparam type="header" name="content-type" value="text/xml">
<cfhttpparam type="header" name="SOAPAction" value="http://tempuri.org/DisKullaniciKimlikDogrula2">
<cfhttpparam type="header" name="content-length" value="#len(trim(requestXML))#">
<cfhttpparam type="header" name="charset" value="utf-8">
<cfhttpparam type="header" name="TE" value="deflate;q=0">
<cfhttpparam type="xml" name="message" value="#trim(requestXML)#">
</cfhttp>

<cfset VKNResult = trim(res.FileContent)>

<!--- Verify whether the WS result is of JSON type. If so, convert to struct. --->
<cfif isJSON(VKNResult)>
	<cfset wsResultStruct = deserializeJSON(VKNResult)>
	
	<cfdump var="#wsResultStruct#">
</cfif>
<!---<cfdump var="#res#">--->


 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Oct 20, 2020 Oct 20, 2020

Copy link to clipboard

Copied

First really ı understand and ı can forget again.Thank  u so much really u helping 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 21, 2020 Oct 21, 2020

Copy link to clipboard

Copied

No problem.

Please mark the answer as correct. It will help someone else in future.

Good luck with the rest of the project.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 24, 2020 Oct 24, 2020

Copy link to clipboard

Copied

LATEST

Forgetting isn't always a bad thing. 🙂 It can be an opportunity to reboot.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation