JAVA - DELPHI Toplu SMS API Kodları

JAVA ve DELPHI Toplu SMS API Kod ve Hazır Script Örnekleri

  • JAVA - XML POST - BİR MESAJI ÇOK KİŞİYE GÖNDERME SCRIPT
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    
    package api1n;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    
    /**
     *
     * @author user
     */
    public class Api1N {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            try 
                    {
                            URL u = new URL("http://panel.vatansms.com/panel/smsgonder1Npost.php");
                            URLConnection uc = u.openConnection();
                            HttpURLConnection connection = (HttpURLConnection) uc;
                            connection.setDoOutput(true);
                            connection.setDoInput(true);
                            connection.setRequestMethod("POST");
                            OutputStream out = connection.getOutputStream();
                            OutputStreamWriter wout = new OutputStreamWriter(out, "UTF-8");
                            wout.write("data=<sms>"+
                            "<kno>KullanıcıNumaranız</kno>"+
                            "<kulad>KullanıcıAdınız</kulad>"+
                            "<sifre>Şifreniz</sifre>"+
                            "<gonderen>GönderenAdınız</gonderen>"+
                            "<mesaj>Deneme Mesajıdır</mesaj>"+
                            "<numaralar>5554443322,5553334422</numaralar>"+
                            "<tur>Normal</tur>"+ // Normal yada Turkce olabilir
                            "</sms>");        
                             //Xml'in içinde aşağıdaki alanları ekleyebilirsiniz.
                              // '<zaman>2013-11-05 15:00:00</zaman>'+  İleri tarihli mesaj için kullanabilirsiniz.
                            wout.flush();
                            out.close();
                            InputStream in = connection.getInputStream();
                            int c;
                            while ((c = in.read()) != -1) System.out.write(c);
                            System.out.println();
                            in.close();
                            out.close();
                            connection.disconnect();
                    }
                    catch (IOException e)
                    {
                    System.err.println(e);
                    }
        }
        
    }
    
  • JAVA - XML POST - N MESAJI N KİŞİYE GÖNDERME
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    
    package apinn;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    /**
     *
     * @author user
     */
    public class ApiNN {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
             try 
                    {
                            URL u = new URL("http://panel.vatansms.com/panel/smsgonderNNpost.php");
                            URLConnection uc = u.openConnection();
                            HttpURLConnection connection = (HttpURLConnection) uc;
                            connection.setDoOutput(true);
                            connection.setDoInput(true);
                            connection.setRequestMethod("POST");
                            OutputStream out = connection.getOutputStream();
                            OutputStreamWriter wout = new OutputStreamWriter(out, "UTF-8");
                            wout.write("data=<sms>"+
                            "<kno>KullanıcıNumaranız</kno>"+
                            "<kulad>KullanıcıAdınız</kulad>"+
                            "<sifre>Şifreniz</sifre>"+
                            "<gonderen>GönderenAdınız</gonderen>"+
                            "<telmesajlar>"+
                            "<telmesaj><tel>5554443322</tel><mesaj>ilk kisiye giden mesaj</mesaj></telmesaj>"+
                            "<telmesaj><tel>5553334422</tel><mesaj>ikinci kisiye giden mesaj</mesaj></telmesaj>"+
                            "</telmesajlar>"+
                            "<tur>Normal</tur>"+ // Normal yada Turkce olabilir
                            "</sms>");                        
                             //Xml'in içinde aşağıdaki alanları ekleyebilirsiniz.
                              // '<zaman>2013-11-05 15:00:00</zaman>'+  İleri tarihli mesaj için kullanabilirsiniz.
                            wout.flush();
                            out.close();
                            InputStream in = connection.getInputStream();
                            int c;
                            while ((c = in.read()) != -1) System.out.write(c);
                            System.out.println();
                            in.close();
                            out.close();
                            connection.disconnect();
                    }
                    catch (IOException e)
                    {
                      System.err.println(e);
                    }
        }
        
    }
    
  • JAVA - XML POST - RAPORLAMA
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    
    package apirapor;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.io.OutputStreamWriter;
    import java.net.HttpURLConnection;
    import java.net.URL;
    import java.net.URLConnection;
    /**
     *
     * @author user
     */
    public class ApiRapor {
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) {
            try 
                    {
                            URL u = new URL("http://panel.vatansms.com/panel/smstakippost.php");
                            URLConnection uc = u.openConnection();
                            HttpURLConnection connection = (HttpURLConnection) uc;
                            connection.setDoOutput(true);
                            connection.setDoInput(true);
                            connection.setRequestMethod("POST");
                            OutputStream out = connection.getOutputStream();
                            OutputStreamWriter wout = new OutputStreamWriter(out, "UTF-8");
                            wout.write("data=<smsrapor>"+
                            "<kulad>KullanıcıAdınız</kulad>"+
                            "<sifre>Şifreniz</sifre>"+
                            "<ozelkod>ÖzelKOD</ozelkod>"+
                            "</smsrapor>");                                
                            wout.flush();
                            out.close();
                            InputStream in = connection.getInputStream();
                            int c;
                            while ((c = in.read()) != -1) System.out.write(c);
                            System.out.println();
                            in.close();
                            out.close();
                            connection.disconnect();
                    }
                    catch (IOException e)
                    {
                    System.err.println(e);
                    }
        }
        
    }
    


  • JAVA - WEBSERVIS - BİR MESAJI ÇOK NUMARAYA GÖNDERME
    package wsapi1n;
    
    import java.io.IOException;
    
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpResponse;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.entity.StringEntity;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.apache.http.util.EntityUtils;
    
    /**
     *
     * @author user
     */
    public class WSApi1N {
    
        /**
         * @param args the command line arguments
         * @throws java.lang.Exception
         */
        public static void main(String[] args) throws Exception {
            String KULNO="";
                    String KULAD="";
                    String KULSIFRE="";
                    String ORJINATOR="";
                    String ZAMAN="";                   //İleri tarih için kullanabilirsiniz. 2014-04-21 10:00:00
                    String ZAMANASIMI="";        //Sms ömrünü belirtir. 2014-04-21 15:00:00
                    String TIP="Normal";          //Normal yada Turkce
                    
                    String Numaralar="5554443322,5553332211";
                    String Mesaj="Deneme|61|mesajidir";
                    
                    String Adres= "http://panel.vatansms.com/webservis/service.php";        
                    
            String TekSmsiBirdenCokNumarayaGonder="<?xml version='1.0' encoding='utf-8'?>"+
                                            "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
                                            "<soap:Body>"+
                                            "<TekSmsiBirdenCokNumarayaGonder xmlns='"+Adres+"'>"+
                                            "<kullanicino>"+KULNO+"</kullanicino>"+
                                            "<kullaniciadi>"+KULAD+"</kullaniciadi>"+
                                            "<sifre>"+KULSIFRE+"</sifre>"+
                                            "<orjinator>"+ORJINATOR+"</orjinator>"+
                                            "<numaralar>"+Numaralar+"</numaralar>"+
                                            "<mesaj>"+Mesaj+"</mesaj>"+
                                            "<zaman>"+ZAMAN+"</zaman>"+
                                            "<zamanasimi>"+ZAMANASIMI+"</zamanasimi>"+
                                            "<tip>"+TIP+"</tip>"+
                                            "</TekSmsiBirdenCokNumarayaGonder>"+
                                            "</soap:Body>"+
                                            "</soap:Envelope>";    
           System.out.println(WSApi1N.POST(Adres, TekSmsiBirdenCokNumarayaGonder));
        }
         public static String POST( String _Adres, String _Xml) throws Exception
             {
                     HttpClient client = new DefaultHttpClient();                 
                     try 
                     {
                             HttpPost post = new HttpPost(_Adres);
                             post.setHeader( "Content-type", "text/xml; charset=utf-8" );
                             post.setEntity( new StringEntity(_Xml));          
                             HttpResponse response = client.execute( post );
                             HttpEntity entity = response.getEntity();
                             if ( entity != null ) {
                                    String cevap=  EntityUtils.toString( entity );
                                       cevap= cevap.split("<return xsi:type=\"xsd:string\">")[1];
                                       return cevap.split("</return>")[0];
                             }
                             return null;
                     } 
                     catch ( IOException ex ) 
                     {
                             System.out.println(ex);
                             throw new RuntimeException( ex );
                     }
                     finally 
                     {
                             client.getConnectionManager().shutdown();
                     }         
            }
    }
    
  • JAVA - WEBSERVIS - N MESAJI N KİŞİYE GÖNDERME
    package wsapinn;
    import java.io.IOException;
    
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpResponse;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.entity.StringEntity;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.apache.http.util.EntityUtils;
    /**
     *
     * @author user
     */
    public class WSApiNN {
    
        /**
         * @param args the command line arguments
         * @throws java.lang.Exception
         */
        public static void main(String[] args) throws Exception {
         String KULNO="";
                    String KULAD="";
                    String KULSIFRE="";
                    String ORJINATOR="";
                    String ZAMAN="";                   //İleri tarih için kullanabilirsiniz. 2014-04-21 10:00:00
                    String ZAMANASIMI="";        //Sms ömrünü belirtir. 2014-04-21 15:00:00
                    String TIP="Normal";          //Normal yada Turkce
                    String NumaraMesaj="{[][Deneme|61|mesajidir1]}"; //{[numara][mesaj]} Mesajlarınızı PDF'deki gibi kodlu göndermenizi öneririz.
                    
                    String Adres= "http://panel.vatansms.com/webservis/service.php";
                    
            String HerBirNumarayaFarkliSmsGonder="<?xml version='1.0' encoding='utf-8'?>"+
                                            "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
                                            "<soap:Body>"+
                                            "<HerBirNumarayaFarkliSmsGonder xmlns='"+Adres+"'>"+
                                            "<kullanicino>"+KULNO+"</kullanicino>"+
                                            "<kullaniciadi>"+KULAD+"</kullaniciadi>"+
                                            "<sifre>"+KULSIFRE+"</sifre>"+
                                            "<orjinator>"+ORJINATOR+"</orjinator>"+
                                            "<numaramesaj>"+NumaraMesaj+"</numaramesaj>"+
                                            "<zaman>"+ZAMAN+"</zaman>"+
                                            "<zamanasimi>"+ZAMANASIMI+"</zamanasimi>"+
                                            "<tip>"+TIP+"</tip>"+
                                            "</HerBirNumarayaFarkliSmsGonder>"+
                                            "</soap:Body>"+
                                            "</soap:Envelope>";   
           System.out.println(WSApiNN.POST(Adres, HerBirNumarayaFarkliSmsGonder));
        }
         public static String POST( String _Adres, String _Xml) throws Exception
             {
                     HttpClient client = new DefaultHttpClient();                 
                     try 
                     {
                             HttpPost post = new HttpPost(_Adres);
                             post.setHeader( "Content-type", "text/xml; charset=utf-8" );
                             post.setEntity( new StringEntity(_Xml));          
                             HttpResponse response = client.execute( post );
                             HttpEntity entity = response.getEntity();
                             if ( entity != null ) {
                                      String cevap=  EntityUtils.toString( entity );
                                       cevap= cevap.split("<return xsi:type=\"xsd:string\">")[1];
                                       return cevap.split("</return>")[0];
                             }
                             return null;
                     } 
                     catch ( IOException ex ) 
                     {
                             System.out.println(ex);
                             throw new RuntimeException( ex );
                     }
                     finally 
                     {
                             client.getConnectionManager().shutdown();
                     }         
            }
    }
    
  • JAVA - WEBSERVIS - ÜYE BİLGİ VE RAPORLAMA İŞLEMLERİ
    package wsapiraporvedigerıslemler;
    import java.io.IOException;
    
    import org.apache.http.HttpEntity;
    import org.apache.http.HttpResponse;
    import org.apache.http.client.HttpClient;
    import org.apache.http.client.methods.HttpPost;
    import org.apache.http.entity.StringEntity;
    import org.apache.http.impl.client.DefaultHttpClient;
    import org.apache.http.util.EntityUtils;
    /**
     *
     * @author user
     */
    public class WSApiRaporveDigerIslemler {
    
        /**
         * @param args the command line arguments
         * @throws java.lang.Exception
         */
        public static void main(String[] args) throws Exception {
                    String KULNO="";
                    String KULAD="";
                    String KULSIFRE="";
    
                    String Adres= "http://panel.vatansms.com/webservis/service.php";        
                    
                    System.out.println("SMS ID'ye GORE RAPOR ALMA:");        
                    String ozelkod="",numararapor=""; // numara boş bırakılırsa özelkod'a ait tüm raporlar çekilir                
            String RaporSorgula="<?xml version='1.0' encoding='utf-8'?>"+
                                            "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
                                            "<soap:Body>"+
                                            "<RaporSorgula xmlns='"+Adres+"'>"+
                                            "<kullanicino>"+KULNO+"</kullanicino>"+
                                            "<kullaniciadi>"+KULAD+"</kullaniciadi>"+
                                            "<sifre>"+KULSIFRE+"</sifre>"+
                                            "<ozelid>"+ozelkod+"</ozelid>"+
                                            "<numara>"+numararapor+"</numara>"+
                                            "</RaporSorgula>"+
                                            "</soap:Body>"+
                                            "</soap:Envelope>";    
            System.out.println(WSApiRaporveDigerIslemler.POST(Adres, RaporSorgula));
           
                       System.out.println("TARIHE GORE RAPOR ALMA:");        
                       String tarih="2014-04-22";
                       String GunlukRaporSorgula="<?xml version='1.0' encoding='utf-8'?>"+
                                    "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
                                    "<soap:Body>"+
                                    "<GunlukRaporSorgula xmlns='"+Adres+"'>"+
                                    "<kullanicino>"+KULNO+"</kullanicino>"+
                                    "<kullaniciadi>"+KULAD+"</kullaniciadi>"+
                                    "<sifre>"+KULSIFRE+"</sifre>"+
                                    "<tarih>"+tarih+"</tarih>"+
                                    "</GunlukRaporSorgula>"+
                                    "</soap:Body>"+
                                    "</soap:Envelope>";    
                       System.out.println(WSApiRaporveDigerIslemler.POST(Adres, GunlukRaporSorgula));
           
                       System.out.println("ÜYE ve BAKİYE SORGULAMA:");        
                       String UyeBilgisiSorgula="<?xml version='1.0' encoding='utf-8'?>"+
                                    "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
                                    "<soap:Body>"+
                                    "<UyeBilgisiSorgula xmlns='"+Adres+"'>"+
                                    "<kullanicino>"+KULNO+"</kullanicino>"+
                                    "<kullaniciadi>"+KULAD+"</kullaniciadi>"+
                                    "<sifre>"+KULSIFRE+"</sifre>"+
                                    "</UyeBilgisiSorgula>"+
                                    "</soap:Body>"+
                                    "</soap:Envelope>";    
                       System.out.println(WSApiRaporveDigerIslemler.POST(Adres, UyeBilgisiSorgula));
                       
                       System.out.println("ORJINATOR OLUSTURMA:");        
                       String Orji="",Aciklama="";
                       String OrjinatorGonder="<?xml version='1.0' encoding='utf-8'?>"+
                                    "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
                                    "<soap:Body>"+
                                    "<OrjinatorGonder xmlns='"+Adres+"'>"+
                                    "<kullanicino>"+KULNO+"</kullanicino>"+
                                    "<kullaniciadi>"+KULAD+"</kullaniciadi>"+
                                    "<sifre>"+KULSIFRE+"</sifre>"+
                                    "<orjinator>"+Orji+"</orjinator>"+
                                    "<aciklama>"+Aciklama+"</aciklama>"+
                                    "</OrjinatorGonder>"+
                                    "</soap:Body>"+
                                    "</soap:Envelope>";    
                       System.out.println(WSApiRaporveDigerIslemler.POST(Adres, OrjinatorGonder));
    
                       System.out.println("ORJINATORlERI CEKME ve SORGULAMA:");        
                       String Orji1=""; //Boş bırakırsanız orjinatörlerin tümünü çeker
                       String OrjinatorSorgula="<?xml version='1.0' encoding='utf-8'?>"+
                                    "<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>"+
                                    "<soap:Body>"+
                                    "<OrjinatorSorgula xmlns='"+Adres+"'>"+
                                    "<kullanicino>"+KULNO+"</kullanicino>"+
                                    "<kullaniciadi>"+KULAD+"</kullaniciadi>"+
                                    "<sifre>"+KULSIFRE+"</sifre>"+
                                    "<orjinator>"+Orji1+"</orjinator>"+
                                    "</OrjinatorSorgula>"+
                                    "</soap:Body>"+
                                    "</soap:Envelope>";    
                       System.out.println(WSApiRaporveDigerIslemler.POST(Adres, OrjinatorSorgula));
        }
        public static String POST( String _Adres, String _Xml) throws Exception
             {
                     HttpClient client = new DefaultHttpClient();                 
                     try 
                     {
                             HttpPost post = new HttpPost(_Adres);
                             post.setHeader( "Content-type", "text/xml; charset=utf-8" );
                             post.setEntity( new StringEntity(_Xml));          
                             HttpResponse response = client.execute( post );
                             HttpEntity entity = response.getEntity();
                             if ( entity != null ) {
                                     String cevap=  EntityUtils.toString( entity );
                                       cevap= cevap.split("<return xsi:type=\"xsd:string\">")[1];
                                       return cevap.split("</return>")[0];
                             }
                             return null;
                     } 
                     catch ( IOException ex ) 
                     {
                             System.out.println(ex);
                             throw new RuntimeException( ex );
                     }
                     finally 
                     {
                             client.getConnectionManager().shutdown();
                     }         
            }
    }
    


  • DELPHI - XML POST - BİR MESAJI ÇOK KİŞİYE GÖNDERME
    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,
      Menus, StdCtrls;
    
    type
      TForm1 = class(TForm)
        TIdHTTP: TIdHTTP;
        kad: TEdit;
        sifre: TEdit;
        kno: TEdit;
        orji: TEdit;
        nu1: TEdit;
        mesaj: TMemo;
        Button1: TButton;
        durum: TMemo;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label4: TLabel;
        Label5: TLabel;
        Label6: TLabel;
        Label7: TLabel;
        nu2: TEdit;
        Label8: TLabel;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    {$R *.dfm}
    function POST (url,xmlstring:WideString):string;
    var
    datalistesi: TStringList;
    HTTP: TIdHTTP;
    cevap: string;
    utff: string;
    begin
    HTTP := TIdHTTP.Create(nil);
    HTTP.Request.Accept:='*/*';
    HTTP.Request.ContentType:='application/x-www-form-urlencoded';
    datalistesi := TStringList.Create;
    utff:=UTF8Encode(xmlstring);
    datalistesi.Add(utff);
    cevap := HTTP.Post(url,datalistesi);
    datalistesi.Free;
    HTTP.Free;
    Result:=cevap;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
    xml,url:string;
    begin
    url:='http://panel.vatansms.com/panel/smsgonder1Npost.php';
    xml:= 'data=<sms><kno>'+kno.Text+'</kno>'+
     '<kulad>'+kad.Text+'</kulad>' +
     '<sifre>'+sifre.Text+'</sifre>' +
     '<gonderen>'+orji.Text+'</gonderen>'  +
     '<mesaj>'+mesaj.Text+'</mesaj>' +
     '<numaralar>'+nu1.Text+','+nu2.Text+'</numaralar>'+
     '<tur>Normal</tur>' +  //Normal yada Turkce olabilir
     '</sms>';
      //Xml'in içinde aşağıdaki alanları ekleyebilirsiniz.
      // '<zaman>2013-11-05 15:00:00</zaman>'+  İleri tarihli mesaj için kullanabilirsiniz.
    Form1.durum.Lines.Add(POST(url,xml));
    end;
    end.
    
  • DELPHI - XML POST - N MESAJI N KİŞİYE GÖNDERME
    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,
      Menus, StdCtrls, Grids, DBGrids;
    
    type
      TForm1 = class(TForm)
        TIdHTTP: TIdHTTP;
        kad: TEdit;
        sifre: TEdit;
        kno: TEdit;
        orji: TEdit;
        nu1: TEdit;
        mesaj1: TMemo;
        Button1: TButton;
        durum: TMemo;
        Label1: TLabel;
        Label2: TLabel;
        Label3: TLabel;
        Label4: TLabel;
        Label5: TLabel;
        Label6: TLabel;
        Label7: TLabel;
        nu2: TEdit;
        Label8: TLabel;
        mesaj2: TMemo;
        Label9: TLabel;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    {$R *.dfm}
    function POST (url,xmlstring:WideString):string;
    var
    datalistesi: TStringList;
    HTTP: TIdHTTP;
    cevap: string;
    utff: string;
    begin
    HTTP := TIdHTTP.Create(nil);
    HTTP.Request.Accept:='*/*';
    HTTP.Request.ContentType:='application/x-www-form-urlencoded';
    datalistesi := TStringList.Create;
    utff:=UTF8Encode(xmlstring);
    datalistesi.Add(utff);
    cevap := HTTP.Post(url,datalistesi);
    datalistesi.Free;
    HTTP.Free;
    Result:=cevap;
    end;
    
    
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
    xml,url:string;
    begin
    url:='http://panel.vatansms.com/panel/smsgonderNNpost.php';
    xml:= 'data=<sms><kno>'+kno.Text+'</kno>'+
     '<kulad>'+kad.Text+'</kulad>' +
     '<sifre>'+sifre.Text+'</sifre>' +
     '<gonderen>'+orji.Text+'</gonderen>'  +
     '<telmesajlar>'+
     '<telmesaj><tel>'+nu1.Text+'</tel><mesaj>'+mesaj1.Text+'</mesaj></telmesaj>' +
     '<telmesaj><tel>'+nu2.Text+'</tel><mesaj>'+mesaj2.Text+'</mesaj></telmesaj>' +
     '</telmesajlar>'+
     '<tur>Normal</tur>' +  //Normal yada Turkce olabilir
     '</sms>';
    
     //Xml'in içinde aşağıdaki alanları ekleyebilirsiniz.
      // '<zaman>2013-11-05 15:00:00</zaman>'+  İleri tarihli mesaj için kullanabilirsiniz.
    
    Form1.durum.Lines.Add(POST(url,xml));
    end;
    end.
    
  • DELPHI - XML POST - RAPORLAMA
    unit Unit1;
    
    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP,
      Menus, StdCtrls, Grids, DBGrids;
    
    type
      TForm1 = class(TForm)
        TIdHTTP: TIdHTTP;
        kad: TEdit;
        sifre: TEdit;
        Button1: TButton;
        sonuc: TMemo;
        Label1: TLabel;
        Label2: TLabel;
        Label7: TLabel;
        ozelkod: TEdit;
        Label3: TLabel;
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    {$R *.dfm}
    function POST (url,xmlstring:WideString):string;
    var
    datalistesi: TStringList;
    HTTP: TIdHTTP;
    cevap: string;
    utff: string;
    begin
    HTTP := TIdHTTP.Create(nil);
    HTTP.Request.Accept:='*/*';
    HTTP.Request.ContentType:='application/x-www-form-urlencoded';
    datalistesi := TStringList.Create;
    utff:=UTF8Encode(xmlstring);
    datalistesi.Add(utff);
    cevap := HTTP.Post(url,datalistesi);
    datalistesi.Free;
    HTTP.Free;
    Result:=cevap;
    end;
    
    
    
    procedure TForm1.Button1Click(Sender: TObject);
    var
    xml,url:string;
    begin
    url:='http://panel.vatansms.com/panel/smstakippost.php';
    xml:=  'data=<smsrapor>'+
     '<kulad>'+kad.Text+'</kulad>' +
     '<sifre>'+sifre.Text+'</sifre>' +
     '<ozelkod>'+ozelkod.Text+'</ozelkod>'  +
     '</smsrapor>';
    Form1.sonuc.Lines.Add(POST(url,xml));
    end;
    end.
    


  • DELPHI - WEBSERVIS - ENTEGRASYON
    
    ************************************************************************
    The types declared in this file were generated from data read from the
    WSDL File described below:
    WSDL     : http://panel.vatansms.com/webservis/service.php?wsdl
    Encoding : ISO-8859-1
    Codegen  : [wfDebug,wfUseSerializerClassForAttrs]
    Version  : 1.0
    ************************************************************************