help to open a URL

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Feb 19, 2013
Company:

hi,my name is Özgür
my english is not very good. so the "google translate" using
I am a new user
I want to open a URL
This link sends sms
successful or not, and returns the result
I do not know how it will
could you help

sample URL
"http://api.netgsm.com.tr/bulkhttppost.asp?usercode=deneme&password=1234&gsmno=5051234567,5441234568&message=testmesaji&msgheader=MesajBaslik&startdat­e=300120121721&stopdate=300120122321"

return data
30 - successful

thank you, bye bye

Edited: Özgür Aydin - Apr 18, 2013 12:30 AM
 
#2
People who like this:0Yes/0No
Interested
Rating: 32
Joined: Oct 27, 2011
Company: Abaco Soluciones S.A.

HTTPConnection method Get, please see included help

There is an example for POST method

Code
// initialize object for writing XML
QueryFileName = GetTempFileName();
RecordObject = New XMLWriter;
XMLWriterSettings = New XMLWriterSettings("windows-1251", , False);
RecordObject.OpenFile(QueryFileName, XMLWriterSettings);
RecordObject.WriteXMLDeclaration();

// display the Request root element
RecordObject.WriteStartElement("Request");

// display the ClientInfo element
RecordObject.WriteStartElement("ClientInfo");
RecordObject.WriteAttribute("email", SenderAdress);
RecordObject.WriteEndElement();

If CertificateFileName <> Undefined Then

    // encode the certificate to Base64 
    DigData.Read(CertificateFileName);
    BaseCertificateFile64 = DigData.GetBaseString64();

    // display the Certificate element
    RecordObject.WriteStartElement("Certificate");
    RecordObject.WriteText(BaseCertificateFile64);
    RecordObject.WriteEndElement();

EndIf;

If ScrambledContainerFileName <> Undefined Then

    // encode encrypted container to Base64
    DigData.Read(ScrambledContainerFileName);
    BaseScrambledContainerFile64 = DigData.GetBaseString64();

    // display the Data element
    RecordObject.WriteStartElement("Data");
    RecordObject.WriteText(BaseScrambledContainerFile64);
    RecordObject.WriteEndElement();

EndIf;

// writing end for the root element
RecordObject.WriteEndElement();

RecordObject.Close();

OnLineCheckServerAddress = "onlinefc.taxcom.ru";
ResourceAtServer = "/online_fc/online_fc.dll" + ?(GetCertificate, "?IncludeCertificate", "");

// set connection with server
Try
    Joining = New HTTPConnection(OnLineCheckServerAddress, , , , Proxy);
Except
    Message("Couldn't connect to online check server:" 
        + Chars.LF + ErrorInfo().Description, MessageStatus.Important);
    Return;
EndTry;

// send request
ResultFile = GetTempFileName();
Try
    Joining.Post(QueryFileName, ResourceAtServer, ResultFile);
    Joining = Undefined;
Except
    Message(ErrorInfo().Description, MessageStatus.Important);
EndTry;

 
#3
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Feb 19, 2013
Company:

Hello Alexey Gerasimov
Thank you for your response
I'm a new member
Can you give a simple example
please  :(

 
#4
People who like this:0Yes/0No
Timofey Bugaevsky
Guest

Joined:
Company:

If you do not need to handle the result, you can use RunApp for that:

Code
RunApp("http://1c-dn.com");

 
#5
People who like this:0Yes/0No
Just came
Rating: 0
Joined: Feb 19, 2013
Company:

Timofey Bugaevsky and Alexey Gerasimov thank you for your answers
problem solved by using "httpconnection"
:) well you need to read the help menu
bye bye

 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.