Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #3634 > unrolled thread

Request VAT information from europe.eu using VO

Started byFrans Wauters <info@wautersit.com>
First post2012-06-19 07:05 -0700
Last post2012-07-02 05:33 -0700
Articles 13 — 5 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Request VAT information from europe.eu using VO Frans Wauters <info@wautersit.com> - 2012-06-19 07:05 -0700
    Re: Request VAT information from europe.eu using VO "Ginny Caughey" <gcaughey.online@hotmail.com> - 2012-06-20 07:00 -0400
      Re: Request VAT information from europe.eu using VO Frans Wauters <info@wautersit.com> - 2012-06-20 10:24 -0700
        Re: Request VAT information from europe.eu using VO "Ginny Caughey" <gcaughey.online@hotmail.com> - 2012-06-20 15:40 -0400
        Re: Request VAT information from europe.eu using VO Carlos Rocha <carlos.rocha@doossier.com.removethis> - 2012-06-20 22:24 +0100
          Re: Request VAT information from europe.eu using VO Frans Wauters <info@wautersit.com> - 2012-06-23 04:18 -0700
        Re: Request VAT information from europe.eu using VO Jean-Pierre <jp.maertens@gmail.com> - 2012-06-22 03:48 -0700
          Re: Request VAT information from europe.eu using VO Frans Wauters <info@wautersit.com> - 2012-06-23 04:19 -0700
    Re: Request VAT information from europe.eu using VO jp.maertens@gmail.com - 2012-06-27 02:12 -0700
      Re: Request VAT information from europe.eu using VO Frans Wauters <info@wautersit.com> - 2012-06-27 02:44 -0700
        Re: Request VAT information from europe.eu using VO jp.maertens@gmail.com - 2012-06-27 04:08 -0700
          Re: Request VAT information from europe.eu using VO Frans Wauters <info@wautersit.com> - 2012-06-27 06:35 -0700
            Re: Request VAT information from europe.eu using VO jp.maertens@gmail.com - 2012-07-02 05:33 -0700

#3634 — Request VAT information from europe.eu using VO

FromFrans Wauters <info@wautersit.com>
Date2012-06-19 07:05 -0700
SubjectRequest VAT information from europe.eu using VO
Message-ID<6bb0a27f-9abc-42d3-9aa3-d61afddf73d3@googlegroups.com>
Greetings.

Our client asked us to create a routine to automatically verify VAT numbers. There is a web service where VAT numbers can be checked: http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl

Maybe I'm a bit old for this (started with dBase in the 80ties)... Only, I don't know how to start with WSDL's. What do I need to generate code to call the Web service and where to catch the result.

In the past I created an XML interface to IceCat. Is this similar to the "easy" code below?

    aTalen := { "INT", "NL" }
    oXHttp:OLEAutoObject{ "MSXML2.XMLHTTP" }
    FOR i: = 1 TO Len ( aTalen )
       IF oXHttp:fInit
          oXHttp:Open( "GET", "http://data.icecat.biz/xml_s3/xml_server3.cgi?ean_upc=0886111086658;lang="+aTalen[i]+";output=productxml", FALSE, cAccount, cPassword)
          oXHttp:Send()
          ? oXHttp:responseText
       END
    NEXT


Kind regards,
Frans

[toc] | [next] | [standalone]


#3640

From"Ginny Caughey" <gcaughey.online@hotmail.com>
Date2012-06-20 07:00 -0400
Message-ID<4fe1ad3f$0$1638$c3e8da3$33881b6a@news.astraweb.com>
In reply to#3634
The easiest way to call a web service is from .NET. I have an example in my 
paper Visual Objects and .NET:
http://www.elbe-data.se/sv/VOgrafx/visualobjectsandcsharp.pdf

Ginny

"Frans Wauters"  wrote in message 
news:6bb0a27f-9abc-42d3-9aa3-d61afddf73d3@googlegroups.com...

Greetings.

Our client asked us to create a routine to automatically verify VAT numbers. 
There is a web service where VAT numbers can be checked: 
http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl

Maybe I'm a bit old for this (started with dBase in the 80ties)... Only, I 
don't know how to start with WSDL's. What do I need to generate code to call 
the Web service and where to catch the result.

In the past I created an XML interface to IceCat. Is this similar to the 
"easy" code below?

    aTalen := { "INT", "NL" }
    oXHttp:OLEAutoObject{ "MSXML2.XMLHTTP" }
    FOR i: = 1 TO Len ( aTalen )
       IF oXHttp:fInit
          oXHttp:Open( "GET", 
"http://data.icecat.biz/xml_s3/xml_server3.cgi?ean_upc=0886111086658;lang="+aTalen[i]+";output=productxml", 
FALSE, cAccount, cPassword)
          oXHttp:Send()
          ? oXHttp:responseText
       END
    NEXT


Kind regards,
Frans 

[toc] | [prev] | [next] | [standalone]


#3643

FromFrans Wauters <info@wautersit.com>
Date2012-06-20 10:24 -0700
Message-ID<183798ff-8205-402d-9895-470ab090dd17@googlegroups.com>
In reply to#3640
Op woensdag 20 juni 2012 13:00:01 UTC+2 schreef Ginny Caughey het volgende:
> The easiest way to call a web service is from .NET. I have an example in my 
> paper Visual Objects and .NET:
> http://www.elbe-data.se/sv/VOgrafx/visualobjectsandcsharp.pdf
> 
> Ginny
> 
> "Frans Wauters"  wrote in message 
> news:6bb0a27f-9abc-42d3-9aa3-d61afddf73d3@googlegroups.com...
> 
> Greetings.
> 
> Our client asked us to create a routine to automatically verify VAT numbers. 
> There is a web service where VAT numbers can be checked: 
> http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
> 
> Maybe I'm a bit old for this (started with dBase in the 80ties)... Only, I 
> don't know how to start with WSDL's. What do I need to generate code to call 
> the Web service and where to catch the result.
> 
> In the past I created an XML interface to IceCat. Is this similar to the 
> "easy" code below?
> 
>     aTalen := { "INT", "NL" }
>     oXHttp:OLEAutoObject{ "MSXML2.XMLHTTP" }
>     FOR i: = 1 TO Len ( aTalen )
>        IF oXHttp:fInit
>           oXHttp:Open( "GET", 
> "http://data.icecat.biz/xml_s3/xml_server3.cgi?ean_upc=0886111086658;lang="+aTalen[i]+";output=productxml", 
> FALSE, cAccount, cPassword)
>           oXHttp:Send()
>           ? oXHttp:responseText
>        END
>     NEXT
> 
> 
> Kind regards,
> Frans

Thx Ginny,

I found an other solution. I downloaded soapUI to examine the WSDL file to get after the soapenv:Envelope code. See the sample below:

   // Wauters Frans - Request VAT information from europe.eu using VO

   LOCAL oXmlHttp       AS OleAutoObject
   LOCAL cSoapEnv       AS STRING
   LOCAL cURL           AS STRING

   LOCAL cCountryCode   AS STRING
   LOCAL cVatNumber     AS STRING

   cCountryCode := "**"
   cVatNumber   := "**********"

   cURL := "http://ec.europa.eu/taxation_customs/vies/services/checkVatService"

   cSoapEnv := ""
   cSoapEnv := cSoapEnv + "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/' xmlns:urn='urn:ec.europa.eu:taxud:vies:services:checkVat:types'>" + CRLF
   cSoapEnv := cSoapEnv + "<soapenv:Header/>" + CRLF
   cSoapEnv := cSoapEnv + "<soapenv:Body>" + CRLF
   cSoapEnv := cSoapEnv + "   <urn:checkVat>" + CRLF
   cSoapEnv := cSoapEnv + "      <urn:countryCode>" + cCountryCode + "</urn:countryCode>" + CRLF
   cSoapEnv := cSoapEnv + "      <urn:vatNumber>" + cVatNumber + "</urn:vatNumber>" + CRLF
   cSoapEnv := cSoapEnv + "   </urn:checkVat>" + CRLF
   cSoapEnv := cSoapEnv + "</soapenv:Body>" + CRLF
   cSoapEnv := cSoapEnv + "</soapenv:Envelope>" + CRLF

   MemoWrit( "soapRequest.txt", cSoapEnv )         // just write the request to a file
   oXmlHttp:=OLEAutoObject{ "MSXML2.XMLHTTP" }
   IF oXmlHttp:fInit
      oXmlHttp:Open( "POST", cURL, FALSE )
      oXmlHttp:SetRequestHeader( "SOAPAction", cURL )
      oXmlHttp:Send( cSoapEnv )
      cSoapEnv := oXmlHttp:responsexml:xml
      MemoWrit( "soapReceive.txt", cSoapEnv )      // just write the received info to a file
   END

Fill in the cCountryCode and cVatNumber with the info from Q11 on page http://ec.europa.eu/taxation_customs/vies/faq.html?locale=en

Only one thing. I have to switch the compiler warning OFF for the OleAutoObject and related methods. Any idee to compile this without these warnings swhitch turned off?

Kind regards,
Frans

[toc] | [prev] | [next] | [standalone]


#3644

From"Ginny Caughey" <gcaughey.online@hotmail.com>
Date2012-06-20 15:40 -0400
Message-ID<4fe2272f$0$1679$c3e8da3$b1356c67@news.astraweb.com>
In reply to#3643
You can just disable the warnings that you don't need.

Ginny

[toc] | [prev] | [next] | [standalone]


#3645

FromCarlos Rocha <carlos.rocha@doossier.com.removethis>
Date2012-06-20 22:24 +0100
Message-ID<jrtf4j$98p$1@speranza.aioe.org>
In reply to#3643
Generate the Automation Server Class for MSXML2 and use it in place of 
OleAutoObject:

LOCAL oXmlHttp AS XmlHttp

oXmlHttp:= XmlHttp{}


-- 
Carlos Rocha

[toc] | [prev] | [next] | [standalone]


#3668

FromFrans Wauters <info@wautersit.com>
Date2012-06-23 04:18 -0700
Message-ID<588c54f1-2574-43cf-8462-bf3c75d336e3@googlegroups.com>
In reply to#3645
Op woensdag 20 juni 2012 23:24:41 UTC+2 schreef Carlos Rocha het volgende:
> Generate the Automation Server Class for MSXML2 and use it in place of 
> OleAutoObject:
> 
> LOCAL oXmlHttp AS XmlHttp
> 
> oXmlHttp:= XmlHttp{}
> 
> 
> -- 
> Carlos Rocha

Hi Carlos,

I generated the Automation Server Class - compiles fine :)
Just had to strip the oXmlHttp:fInit test.

thx

[toc] | [prev] | [next] | [standalone]


#3658

FromJean-Pierre <jp.maertens@gmail.com>
Date2012-06-22 03:48 -0700
Message-ID<5271b751-a281-47ef-bdcd-10f12ac72d2c@x21g2000vbc.googlegroups.com>
In reply to#3643
What do you do with the "SoapRequest.txt" file ?  You create it, but
in the code I see no further use.

greetings

JP





On 20 jun, 19:24, Frans Wauters <i...@wautersit.com> wrote:
> Op woensdag 20 juni 2012 13:00:01 UTC+2 schreef Ginny Caughey het volgende:
>
>
>
>
>
>
>
>
>
> > The easiest way to call a web service is from .NET. I have an example in my
> > paper Visual Objects and .NET:
> >http://www.elbe-data.se/sv/VOgrafx/visualobjectsandcsharp.pdf
>
> > Ginny
>
> > "Frans Wauters"  wrote in message
> >news:6bb0a27f-9abc-42d3-9aa3-d61afddf73d3@googlegroups.com...
>
> > Greetings.
>
> > Our client asked us to create a routine to automatically verify VAT numbers.
> > There is a web service where VAT numbers can be checked:
> >http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
>
> > Maybe I'm a bit old for this (started with dBase in the 80ties)... Only, I
> > don't know how to start with WSDL's. What do I need to generate code to call
> > the Web service and where to catch the result.
>
> > In the past I created an XML interface to IceCat. Is this similar to the
> > "easy" code below?
>
> >     aTalen := { "INT", "NL" }
> >     oXHttp:OLEAutoObject{ "MSXML2.XMLHTTP" }
> >     FOR i: = 1 TO Len ( aTalen )
> >        IF oXHttp:fInit
> >           oXHttp:Open( "GET",
> > "http://data.icecat.biz/xml_s3/xml_server3.cgi?ean_upc=0886111086658;l..."+aTalen[i]+";output=productxml",
> > FALSE, cAccount, cPassword)
> >           oXHttp:Send()
> >           ? oXHttp:responseText
> >        END
> >     NEXT
>
> > Kind regards,
> > Frans
>
> Thx Ginny,
>
> I found an other solution. I downloaded soapUI to examine the WSDL file to get after the soapenv:Envelope code. See the sample below:
>
>    // Wauters Frans - Request VAT information from europe.eu using VO
>
>    LOCAL oXmlHttp       AS OleAutoObject
>    LOCAL cSoapEnv       AS STRING
>    LOCAL cURL           AS STRING
>
>    LOCAL cCountryCode   AS STRING
>    LOCAL cVatNumber     AS STRING
>
>    cCountryCode := "**"
>    cVatNumber   := "**********"
>
>    cURL := "http://ec.europa.eu/taxation_customs/vies/services/checkVatService"
>
>    cSoapEnv := ""
>    cSoapEnv := cSoapEnv + "<soapenv:Envelope xmlns:soapenv='http://schemas.xmlsoap.org/soap/envelope/'xmlns:urn='urn:ec.europa.eu:taxud:vies:services:checkVat:types'>" + CRLF
>    cSoapEnv := cSoapEnv + "<soapenv:Header/>" + CRLF
>    cSoapEnv := cSoapEnv + "<soapenv:Body>" + CRLF
>    cSoapEnv := cSoapEnv + "   <urn:checkVat>" + CRLF
>    cSoapEnv := cSoapEnv + "      <urn:countryCode>" + cCountryCode + "</urn:countryCode>" + CRLF
>    cSoapEnv := cSoapEnv + "      <urn:vatNumber>" + cVatNumber + "</urn:vatNumber>" + CRLF
>    cSoapEnv := cSoapEnv + "   </urn:checkVat>" + CRLF
>    cSoapEnv := cSoapEnv + "</soapenv:Body>" + CRLF
>    cSoapEnv := cSoapEnv + "</soapenv:Envelope>" + CRLF
>
>    MemoWrit( "soapRequest.txt", cSoapEnv )         // just write the request to a file
>    oXmlHttp:=OLEAutoObject{ "MSXML2.XMLHTTP" }
>    IF oXmlHttp:fInit
>       oXmlHttp:Open( "POST", cURL, FALSE )
>       oXmlHttp:SetRequestHeader( "SOAPAction", cURL )
>       oXmlHttp:Send( cSoapEnv )
>       cSoapEnv := oXmlHttp:responsexml:xml
>       MemoWrit( "soapReceive.txt", cSoapEnv )      // just write the received info to a file
>    END
>
> Fill in the cCountryCode and cVatNumber with the info from Q11 on pagehttp://ec.europa.eu/taxation_customs/vies/faq.html?locale=en
>
> Only one thing. I have to switch the compiler warning OFF for the OleAutoObject and related methods. Any idee to compile this without these warnings swhitch turned off?
>
> Kind regards,
> Frans

[toc] | [prev] | [next] | [standalone]


#3669

FromFrans Wauters <info@wautersit.com>
Date2012-06-23 04:19 -0700
Message-ID<3b612534-1ea4-46bb-be9c-5b76f8bc4957@googlegroups.com>
In reply to#3658
Op vrijdag 22 juni 2012 12:48:09 UTC+2 schreef Jean-Pierre het volgende:
> What do you do with the "SoapRequest.txt" file ?  You create it, but
> in the code I see no further use.
> 
> greetings
> 
> JP

only for debug purposes :)

[toc] | [prev] | [next] | [standalone]


#3683

Fromjp.maertens@gmail.com
Date2012-06-27 02:12 -0700
Message-ID<2d313c21-24f6-4af7-bab8-28ea0535de67@googlegroups.com>
In reply to#3634
Frans,
Where did you find soapUI ?
tia
Jean-Pierre

[toc] | [prev] | [next] | [standalone]


#3684

FromFrans Wauters <info@wautersit.com>
Date2012-06-27 02:44 -0700
Message-ID<c284a738-2065-46be-93a4-4d7c2a7755ce@googlegroups.com>
In reply to#3683
Op woensdag 27 juni 2012 11:12:31 UTC+2 schreef jp.ma...@gmail.com het volgende:
> Frans,
> Where did you find soapUI ?
> tia
> Jean-Pierre

Hi Jean-Pierre,

Donwload from: http://sourceforge.net/projects/soapui/files/
Using it: http://www.soapui.org/SOAP-and-WSDL/working-with-wsdls.html

Regards,
Frans

[toc] | [prev] | [next] | [standalone]


#3686

Fromjp.maertens@gmail.com
Date2012-06-27 04:08 -0700
Message-ID<5125074f-e558-4901-907b-469d0aab8d3f@googlegroups.com>
In reply to#3684
Thank you very much !  
Where did you find the type library for XmlHttp ? I find MSXML6 but when I generate code there is no finit method, and no responsexml object.

Jean-Pierre

[toc] | [prev] | [next] | [standalone]


#3687

FromFrans Wauters <info@wautersit.com>
Date2012-06-27 06:35 -0700
Message-ID<76773f68-606d-4ba3-a583-f3543511c1e9@googlegroups.com>
In reply to#3686
Op woensdag 27 juni 2012 13:08:27 UTC+2 schreef jp.ma...@gmail.com het volgende:
> Thank you very much !  
> Where did you find the type library for XmlHttp ? I find MSXML6 but when I generate code there is no finit method, and no responsexml object.
> 
> Jean-Pierre

Hi Jean-Pierre,

XmlHttp class:

   CAVO Menu > Tools > Automation Server > select: 
      Microsoft XML v6 (I think almost any version will do) 
      and generate the IXMLHttpRequest module.

Then I subclass it using: 

   CLASS XmlHttp INHERIT IXMLHttpRequest

And yes, XmlHttp does not have fInit as this came with the CAVO OleAutoObject class...
So you can write the code as:

   LOCAL oXmlHttp AS OBJECT   // OleAutoObject
   ...
   oXmlHttp := XmlHttp{}
   IF oXmlHttp:fInit
      oXmlHttp:Open( "POST", cURL, FALSE )
      oXmlHttp:SetRequestHeader( "SOAPAction", cURL )
      oXmlHttp:Send( cSoapEnv )
      cSoapEnv := oXmlHttp:responsexml:xml
   ELSE
      ...
   ENDIF

of without the fInit test

   LOCAL oXmlHttp AS XmlHttp  // IXMLHttpRequest
   ...
   oXmlHttp := XmlHttp{}
   oXmlHttp:Open( "POST", cURL, FALSE )
   oXmlHttp:SetRequestHeader( "SOAPAction", cURL )
   oXmlHttp:Send( cSoapEnv )
   cSoapEnv := oXmlHttp:responsexml:xml

Regards,
Frans

[toc] | [prev] | [next] | [standalone]


#3713

Fromjp.maertens@gmail.com
Date2012-07-02 05:33 -0700
Message-ID<0f0a7354-04e0-4d53-8352-5d3ad7dec489@googlegroups.com>
In reply to#3687
Thank you Frans !!

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web