Hello Matijn Woudt,

Am 2012-08-30 16:44:53, hacktest Du folgendes herunter:
> You could start by looking at the PHP SoapClient [1], which takes a
> URI to a WSDL descriptor as argument. You can enter the URL to the
> WSDL file there, like this:
> $client = new 
> SoapClient("http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl";);
> 
> Now you need to know which function you want to call, let's say it's
> called SomeFunction, then you can do:
> $client->SomeFunction($paramA, $paramB);
> 
> Hope this gets you started.

Ah thanks...  Interesting how it works.

However, I have found "wsdl2php" and converted the wsdl file  to  a  PHP
class, but I hate classes...  Never used it in 12 years.  :-D

--8<--------------------------------------------------------------------
<?php

class checkVat{
  var $countryCode;             //string
  var $vatNumber;               //string
}

class checkVatResponse{
  var $countryCode;             //string
  var $vatNumber;               //string
  var $requestDate;             //date
  var $valid;                   //boolean
  var $name;                    //string
  var $address;                 //string
}

class checkVatApprox{
  var $countryCode;             //string
  var $vatNumber;               //string
  var $traderName;              //string
  var $traderCompanyType;       //companyTypeCode
  var $traderStreet;            //string
  var $traderPostcode;          //string
  var $traderCity;              //string
  var $requesterCountryCode;    //string
  var $requesterVatNumber;      //string
}

class checkVatApproxResponse{
  var $countryCode;             //string
  var $vatNumber;               //string
  var $requestDate;             //date
  var $valid;                   //boolean
  var $traderName;              //string
  var $traderCompanyType;       //companyTypeCode
  var $traderAddress;           //string
  var $traderStreet;            //string
  var $traderPostcode;          //string
  var $traderCity;              //string
  var $traderNameMatch;         //matchCode
  var $traderCompanyTypeMatch;  //matchCode
  var $traderStreetMatch;       //matchCode
  var $traderPostcodeMatch;     //matchCode
  var $traderCityMatch;         //matchCode
  var $requestIdentifier;       //string
}

class checkVatService{
  var $soapClient;

  private static $classmap = array('checkVat' => 'checkVat'
                                  ,'checkVatResponse' => 'checkVatResponse'
                                  ,'checkVatApprox' => 'checkVatApprox'
                                  ,'checkVatApproxResponse' => 
'checkVatApproxResponse');

  function 
__construct($url='http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl')
  {
    $this->soapClient = new SoapClient($url,array("classmap" => self::$classmap,
                                                  "trace" => true,
                                                  "exceptions" => true));
  }
 
  function checkVat(checkVat $checkVat)
  {
    $checkVatResponse = $this->soapClient->checkVat($checkVat);
    return $checkVatResponse;
  }

  function checkVatApprox(checkVatApprox $checkVatApprox)
  {
    $checkVatApproxResponse = 
$this->soapClient->checkVatApprox($checkVatApprox);
    return $checkVatApproxResponse;
  }
}

?>
--8<--------------------------------------------------------------------

OK, tried

    $VALS = new checkVat;

    $VALS->countryCode = 'DE';
    $VALS->vatNumber   = '278049239';

    $OBJECT = new checkVatService;
    $OBJECT->checkVat;

and up the here I have no error.  But How do I get the answer now?

    $ANS = $OBJECT->checkVat;
or
    $ANS = $OBJECT->checkVat();

do not seem to work

    print_r($ANS);

Also

    $RET = new checkVatResponse;
    print_r($RET);

seems not to work

What I am missing?

Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux
               Internet Service Provider, Cloud Computing
                <http://www.itsystems.tamay-dogan.net/>

itsystems@tdnet                     Jabber  linux4miche...@jabber.ccc.de
Owner Michelle Konzack

Gewerbe Strasse 3                   Tel office: +49-176-86004575
77694 Kehl                          Tel mobil:  +49-177-9351947
Germany                             Tel mobil:  +33-6-61925193  (France)

USt-ID:  DE 278 049 239

Linux-User #280138 with the Linux Counter, http://counter.li.org/
--8<--------------------------------------------------------------------


Thanks, Greetings and nice Day/Evening
    Michelle Konzack

-- 
##################### Debian GNU/Linux Consultant ######################
   Development of Intranet and Embedded Systems with Debian GNU/Linux
               Internet Service Provider, Cloud Computing
                <http://www.itsystems.tamay-dogan.net/>

itsystems@tdnet                     Jabber  linux4miche...@jabber.ccc.de
Owner Michelle Konzack

Gewerbe Strasse 3                   Tel office: +49-176-86004575
77694 Kehl                          Tel mobil:  +49-177-9351947
Germany                             Tel mobil:  +33-6-61925193  (France)

USt-ID:  DE 278 049 239

Linux-User #280138 with the Linux Counter, http://counter.li.org/

Attachment: signature.pgp
Description: Digital signature

Reply via email to