• 08-02-2018, 10:35:07
    #1
    Aşağıdaki kod XML yapısında NETGSM firmasının SMS gönderme apisi. Tek kişiye mesaj atacağı zaman sorun yok fakat veri tabanından gelen telefon listesine sms atacağımız zaman telefon satırlarını döngüye sokamadım. Yardım edebilir misiniz.
    Kodun orjinalinde telefonları elle yazarsak sorun yok sms gidiyor fakat döngüye sokarsak ilk satırda hata veriyor.
    Orjinal kod:
        Mesaj = "Test Mesaji"
        xml ="<?xml version='1.0' encoding='UTF-8'?>" & _
        "<mainbody>" & _
        "<header>" & _
        "<company>Netgsm</company>" & _
        "<usercode>xxxxxxxx</usercode>" & _
        "<password>yyyyyy</password>" & _
        "<type>1:n</type>" & _
        "<msgheader>ABCDE</msgheader>" & _
        "</header>" & _
        "<body>" & _
        "<msg><![CDATA["& Mesaj &"]]></msg>" & _
        "<no>05051112233</no>" & _
        "<no>05054445566</no>" & _
        "<no>05057778899</no>" & _
        "</body>" & _
        "</mainbody>"
         cevap = GETHTTPXML("http://api.netgsm.com.tr/xmlbulkhttppost.asp",xml)
    Buda telefonları döngüye aldığım kod
        Mesaj = "Test Mesaji"
        xml ="<?xml version='1.0' encoding='UTF-8'?>" & _
        "<mainbody>" & _
        "<header>" & _
        "<company>Netgsm</company>" & _
        "<usercode>xxxxxxxx</usercode>" & _
        "<password>yyyyyy</password>" & _
        "<type>1:n</type>" & _
        "<msgheader>ABCDE</msgheader>" & _
        "</header>" & _
        "<body>" & _
        "<msg><![CDATA["& Mesaj &"]]></msg>" & _
    set toplusms = bag.execute("select id,ceptel from uyeler Order by id desc")
    do until toplusms.eof    
        "<no>"& toplusms("ceptel") &"</no>" & _
    toplusms.movenext:loop:toplusms.Close:Set toplusms = Nothing    
        "<no>05072022424</no>" & _
        "<no>05072022424</no>" & _
        "<no>05072022424</no>" & _
        "</body>" & _
        "</mainbody>"
    cevap = GETHTTPXML("http://api.netgsm.com.tr/xmlbulkhttppost.asp",xml)
    Şu da hata kodu : http://prntscr.com/ibqmd1
  • 19-02-2018, 17:25:55
    #2
    Böyle dener misin?

    Mesaj = "Test Mesaji"
        xml ="<?xml version='1.0' encoding='UTF-8'?>" & _
        "<mainbody>" & _
        "<header>" & _
        "<company>Netgsm</company>" & _
        "<usercode>xxxxxxxx</usercode>" & _
        "<password>yyyyyy</password>" & _
        "<type>1:n</type>" & _
        "<msgheader>ABCDE</msgheader>" & _
        "</header>" & _
        "<body>" & _
        "<msg><![CDATA["& Mesaj &"]]></msg>"
    telefonlar=""
    set toplusms = bag.execute("select id,ceptel from uyeler Order by id desc")
    do until toplusms.eof   
     telefonlar = telefonlar &   "<no>"& toplusms("ceptel") &"</no>"
    toplusms.movenext:loop:toplusms.Close:Set toplusms = Nothing   
      xml =  xml & telefonlar & _
        "</body>" & _
        "</mainbody>"
    cevap = GETHTTPXML("http://api.netgsm.com.tr/xmlbulkhttppost.asp",xml)