<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Prefered way to make a http request and parse xml in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225584#M3927</link>
    <description>&lt;BLOCKQUOTE&gt;vuego wrote:&lt;BR /&gt;I have another question. I am getting binary data with my http request into GS::IChannelX. My binary data is a gsm object.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
How can I store data from GS::ChanelX into IO::File?&lt;BR /&gt;
Or, is it possible to use IO::File as IChannel and store request directly to file using clientConnection.BeginReceive(response) ?&lt;BR /&gt;
&lt;BR /&gt;
Thank you in advance.&lt;/BLOCKQUOTE&gt;

The 'I' in IChannel stands for input channel. You have to open an output channel (GS::OChannel), which can be an IO::File, then write the data directly into it.&lt;BR /&gt;
&lt;BR /&gt;
Best, Akos</description>
    <pubDate>Mon, 18 Sep 2017 09:35:20 GMT</pubDate>
    <dc:creator>Akos Somorjai</dc:creator>
    <dc:date>2017-09-18T09:35:20Z</dc:date>
    <item>
      <title>[SLVD] Prefered way to make a http request and parse xml doc</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225579#M3922</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I've noticed that there is a XML engine included with AC Api in GSRoot module. &lt;BR /&gt;&lt;BR /&gt;Unfortunately there are no examples nor is it mentioned in the documentation. Is it just undocumented section or are there any examples for us to use? &lt;BR /&gt;&lt;BR /&gt;Secondly, is there a preferred "AC API" way to execute a http request from a plugin? An example would be great too.&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Dec 2022 13:00:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225579#M3922</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2022-12-06T13:00:51Z</dc:date>
    </item>
    <item>
      <title>Re: Prefered way to make a http request and parse xml docume</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225580#M3923</link>
      <description>Hey Vuego,&lt;BR /&gt;
&lt;BR /&gt;
I don't have an answer for you, I'm just joining this thread because I'd like to know how to make HTTP requests.  HTTPS requests would be even better.</description>
      <pubDate>Thu, 31 Aug 2017 21:18:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225580#M3923</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-08-31T21:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: Prefered way to make a http request and parse xml docume</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225581#M3924</link>
      <description>Hello,  
&lt;BLOCKQUOTE&gt;vuego wrote:&lt;BR /&gt;I've noticed that there is a XML engine included with AC Api in GSRoot module. &lt;/BLOCKQUOTE&gt;  &lt;BR /&gt;
There is more than one XML Engine which you can use. For what purpose would you like to use it?  &lt;BR /&gt;
  
&lt;BLOCKQUOTE&gt;vuego wrote:&lt;BR /&gt;Secondly, is there a preferred "AC API" way to execute a http request from a plugin? An example would be great too.&lt;/BLOCKQUOTE&gt;  &lt;BR /&gt;
You can find examples about http/https request in API DevKit's Examples/Goodie_Functions/Src/Goodie_Functions.cpp.  &lt;BR /&gt;
One of them is &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Do_DownloadWebpage&lt;E&gt;&lt;/E&gt; function.  &lt;BR /&gt;
  &lt;BR /&gt;
Best,  &lt;BR /&gt;
Mihály</description>
      <pubDate>Tue, 12 Sep 2017 12:24:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225581#M3924</guid>
      <dc:creator>Mihaly Palenik</dc:creator>
      <dc:date>2017-09-12T12:24:05Z</dc:date>
    </item>
    <item>
      <title>Re: Prefered way to make a http request and parse xml docume</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225582#M3925</link>
      <description>Thanks Mihály for pointing me in the right direction.&lt;BR /&gt;
&lt;BR /&gt;
Besides Do_DownloadWebpage, there are also Do_XML_From_String() and Do_XML_Write(), that are all I needed.</description>
      <pubDate>Tue, 12 Sep 2017 13:09:01 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225582#M3925</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2017-09-12T13:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Prefered way to make a http request and parse xml</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225583#M3926</link>
      <description>I have another question. I am getting binary data with my http request into GS::IChannelX. My binary data is a gsm object.&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;Response response;
	GS::IChannelX channel(clientConnection.BeginReceive(response), GS::GetNetworkByteOrderIProtocolX());&lt;/PRE&gt;

I would like to store binary response to a file object IO::File..
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;	IO::Location rab("C:/GDLTest/11204.gsm2");
	IO::File targetFile(rab, IO::File::Create);&lt;/PRE&gt;

How can I store data from GS::ChanelX into IO::File?&lt;BR /&gt;
Or, is it possible to use IO::File as IChannel and store request directly to file using clientConnection.BeginReceive(response) ?&lt;BR /&gt;
&lt;BR /&gt;
Thank you in advance.</description>
      <pubDate>Mon, 18 Sep 2017 09:28:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225583#M3926</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2017-09-18T09:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: Prefered way to make a http request and parse xml</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225584#M3927</link>
      <description>&lt;BLOCKQUOTE&gt;vuego wrote:&lt;BR /&gt;I have another question. I am getting binary data with my http request into GS::IChannelX. My binary data is a gsm object.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
How can I store data from GS::ChanelX into IO::File?&lt;BR /&gt;
Or, is it possible to use IO::File as IChannel and store request directly to file using clientConnection.BeginReceive(response) ?&lt;BR /&gt;
&lt;BR /&gt;
Thank you in advance.&lt;/BLOCKQUOTE&gt;

The 'I' in IChannel stands for input channel. You have to open an output channel (GS::OChannel), which can be an IO::File, then write the data directly into it.&lt;BR /&gt;
&lt;BR /&gt;
Best, Akos</description>
      <pubDate>Mon, 18 Sep 2017 09:35:20 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225584#M3927</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2017-09-18T09:35:20Z</dc:date>
    </item>
    <item>
      <title>Re: [SLVD] Prefered way to make a http request and parse xml</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225585#M3928</link>
      <description>Sorry, I ment IO::File as output channel. &lt;BR /&gt;
&lt;BR /&gt;
I am having trouble receiving/writing data from HTTP::ClientConnection directly into IO::File (GS::OChannel)... how do I achieve that?</description>
      <pubDate>Mon, 18 Sep 2017 10:10:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225585#M3928</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2017-09-18T10:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: [SLVD] Prefered way to make a http request and parse xml</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225586#M3929</link>
      <description>&lt;BLOCKQUOTE&gt;vuego wrote:&lt;BR /&gt;Sorry, I ment IO::File as output channel. &lt;BR /&gt;
&lt;BR /&gt;
I am having trouble receiving/writing data from HTTP::ClientConnection directly into IO::File (GS::OChannel)... how do I achieve that?&lt;/BLOCKQUOTE&gt;

Again: IChannels are for input OChannel are for output. The http connection is the input channel, and you yourself have to write that information to the output channel (== IO::File). So the pseudo code:&lt;BR /&gt;
&lt;BR /&gt;
read bytes from input&lt;BR /&gt;
write bytes to output&lt;BR /&gt;
&lt;BR /&gt;
Best, Akos</description>
      <pubDate>Mon, 18 Sep 2017 10:56:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225586#M3929</guid>
      <dc:creator>Akos Somorjai</dc:creator>
      <dc:date>2017-09-18T10:56:52Z</dc:date>
    </item>
    <item>
      <title>Re: [SLVD] Prefered way to make a http request and parse xml</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225587#M3930</link>
      <description>Ok, Akos, thanks.&lt;BR /&gt;
&lt;BR /&gt;
I thought there would be a more elegant way of connecting input and output channels than that &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_smile.gif" style="display : inline;" /&gt;</description>
      <pubDate>Mon, 18 Sep 2017 11:09:32 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SLVD-Prefered-way-to-make-a-http-request-and-parse-xml-doc/m-p/225587#M3930</guid>
      <dc:creator>Miha Nahtigal</dc:creator>
      <dc:date>2017-09-18T11:09:32Z</dc:date>
    </item>
  </channel>
</rss>

