1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
| #include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <cstring>
#include <soapH.h>
#include <UtilsSoap.nsmap>
using namespace std;
int main(int argc, char **argv)
{
struct soap v_soap;
struct ns1__AuthHeader auth;
struct SOAP_ENV__Header SoapHeader;
struct _ns1__CheckEmailAddress addr_email;
struct _ns1__CheckEmailAddressResponse resp_email;
auth.UserName="xxxxxxxxx";
auth.Password="xxxxxxxxxxxxxx";
auth.IdMlist =xxxxx;
addr_email.email = argv[1];
cout<<"Initialisation de SOAP"<<endl;
soap_init(&v_soap);//Initlisation du soap
//Initialisaton de l'header pour l'authentification
SoapHeader.ns1__AuthHeader = &auth;
v_soap.header = &SoapHeader;
//Appel de la fonction CheckEmailAddressAndDomain de Emailing solutions
soap_call___ns2__CheckEmailAddress(&v_soap,"http://ws1.ems6.net/utils.asmx","http://EMSConnectWS.org/CheckEmailAddress", &addr_email,&resp_email); //vérifie une adresse email
//Affichage de la réponse
cout<<resp_email.CheckEmailAddressResult<<endl;
//Affichage des erreurs s'il y a.
if (v_soap.error)
{
soap_print_fault(&v_soap, stderr);
return 0;
}
return 1;
} |