ServerHTTPRequest

Discussion in 'ASP General' started by eduardo.rosa@gmail.com, Jun 27, 2006.

  1. Guest

    Hi people, I need some help with ServerHTTPRequest.

    My question is: why can I load only the last rss? Somebody have any
    idea?

    Thanks a lot.


    Example:
    http://www.clas.com.br/loja/sedex.calculo.asp

    Code:
    Sub getXML(sourceFile)
    dim styleFile
    dim source, style
    styleFile = Server.MapPath("news.xsl")

    set source = Server.CreateObject("MSXML2.DomDocument")
    source.async = false
    source.setProperty "ServerHTTPRequest", true
    source.load CStr( sourceFile )

    'Se não for possível a conexão, mosta código de erro
    Response.Write( "<br/> Código de Erro: " & source.parseerror )
    Response.Write( "<br/> Código de Erro: " &
    source.parseerror.reason )

    set style = Server.CreateObject("Msxml2.DomDocument")
    style.async = false
    style.load styleFile

    'source.transformNodeToObject style, Response
    set source = nothing
    set style = nothing
    End Sub
    , Jun 27, 2006
    #1
    1. Advertising

  2. <> wrote in message
    news:...
    >
    >Hi people, I need some help with ServerHTTPRequest.
    >
    >My question is: why can I load only the last rss? Somebody have any
    >idea?
    >
    >Thanks a lot.
    >


    The code below seems fine although I'd use the more specific
    MSXML2.DOMDocument.3.0
    Prog ID. I'm afraid I find your question a very cryptic. In the link below
    the first item results in a empty html file, the second is a raw xml, the
    third is transformed to html and the forth returns raw xml.

    Can you explain more clearly what your problem is?

    >>

    Example:
    http://www.clas.com.br/loja/sedex.calculo.asp

    Code:
    Sub getXML(sourceFile)
    dim styleFile
    dim source, style
    styleFile = Server.MapPath("news.xsl")

    set source = Server.CreateObject("MSXML2.DomDocument")
    source.async = false
    source.setProperty "ServerHTTPRequest", true
    source.load CStr( sourceFile )

    'Se não for possível a conexão, mosta código de erro
    Response.Write( "<br/> Código de Erro: " & source.parseerror )
    Response.Write( "<br/> Código de Erro: " &
    source.parseerror.reason )

    set style = Server.CreateObject("Msxml2.DomDocument")
    style.async = false
    style.load styleFile

    'source.transformNodeToObject style, Response
    set source = nothing
    set style = nothing
    End Sub
    <<
    Anthony Jones, Jun 27, 2006
    #2
    1. Advertising

  3. Guest

    Of course.

    In the example ( http://www.clas.com.br/loja/sedex.calculo.asp ) I try
    to load 4 feeds.
    All the feeds, if access by browser are ok. But feeds 1, 2 and 3
    loading using the code generate a -2147012867 error.

    Only last feed works loaded by code, that's I don't undestand.

    thanks a lot


    Anthony Jones wrote:
    > <> wrote in message
    > news:...
    > >
    > >Hi people, I need some help with ServerHTTPRequest.
    > >
    > >My question is: why can I load only the last rss? Somebody have any
    > >idea?
    > >
    > >Thanks a lot.
    > >

    >
    > The code below seems fine although I'd use the more specific
    > MSXML2.DOMDocument.3.0
    > Prog ID. I'm afraid I find your question a very cryptic. In the link below
    > the first item results in a empty html file, the second is a raw xml, the
    > third is transformed to html and the forth returns raw xml.
    >
    > Can you explain more clearly what your problem is?
    >
    > >>

    > Example:
    > http://www.clas.com.br/loja/sedex.calculo.asp
    >
    > Code:
    > Sub getXML(sourceFile)
    > dim styleFile
    > dim source, style
    > styleFile = Server.MapPath("news.xsl")
    >
    > set source = Server.CreateObject("MSXML2.DomDocument")
    > source.async = false
    > source.setProperty "ServerHTTPRequest", true
    > source.load CStr( sourceFile )
    >
    > 'Se não for possível a conexão, mosta código de erro
    > Response.Write( "<br/> Código de Erro: " & source.parseerror )
    > Response.Write( "<br/> Código de Erro: " &
    > source.parseerror.reason )
    >
    > set style = Server.CreateObject("Msxml2.DomDocument")
    > style.async = false
    > style.load styleFile
    >
    > 'source.transformNodeToObject style, Response
    > set source = nothing
    > set style = nothing
    > End Sub
    > <<
    , Jun 27, 2006
    #3
  4. <> wrote in message
    news:...
    >Of course.
    >
    >In the example ( http://www.clas.com.br/loja/sedex.calculo.asp ) I try
    >to load 4 feeds.
    >All the feeds, if access by browser are ok. But feeds 1, 2 and 3
    >loading using the code generate a -2147012867 error.
    >
    >Only last feed works loaded by code, that's I don't undestand.
    >
    >thanks a lot


    This error is:-

    ERROR_WINHTTP_CANNOT_CONNECT

    do you have an outgoing firewall and a proxy server in place?



    Anthony Jones wrote:
    > <> wrote in message
    > news:...
    > >
    > >Hi people, I need some help with ServerHTTPRequest.
    > >
    > >My question is: why can I load only the last rss? Somebody have any
    > >idea?
    > >
    > >Thanks a lot.
    > >

    >
    > The code below seems fine although I'd use the more specific
    > MSXML2.DOMDocument.3.0
    > Prog ID. I'm afraid I find your question a very cryptic. In the link

    below
    > the first item results in a empty html file, the second is a raw xml, the
    > third is transformed to html and the forth returns raw xml.
    >
    > Can you explain more clearly what your problem is?
    >
    > >>

    > Example:
    > http://www.clas.com.br/loja/sedex.calculo.asp
    >
    > Code:
    > Sub getXML(sourceFile)
    > dim styleFile
    > dim source, style
    > styleFile = Server.MapPath("news.xsl")
    >
    > set source = Server.CreateObject("MSXML2.DomDocument")
    > source.async = false
    > source.setProperty "ServerHTTPRequest", true
    > source.load CStr( sourceFile )
    >
    > 'Se não for possível a conexão, mosta código de erro
    > Response.Write( "<br/> Código de Erro: " & source.parseerror )
    > Response.Write( "<br/> Código de Erro: " &
    > source.parseerror.reason )
    >
    > set style = Server.CreateObject("Msxml2.DomDocument")
    > style.async = false
    > style.load styleFile
    >
    > 'source.transformNodeToObject style, Response
    > set source = nothing
    > set style = nothing
    > End Sub
    > <<
    Anthony Jones, Jun 27, 2006
    #4
  5. Guest

    Well, I don't have the server then I need ask to config for me.

    The server people sad they create a rule in firewall to the file
    "sedex.calculo.asp".
    I really don't know other permissions that the script need.

    thanks a lot


    Anthony Jones wrote:
    > <> wrote in message
    > news:...
    > >Of course.
    > >
    > >In the example ( http://www.clas.com.br/loja/sedex.calculo.asp ) I try
    > >to load 4 feeds.
    > >All the feeds, if access by browser are ok. But feeds 1, 2 and 3
    > >loading using the code generate a -2147012867 error.
    > >
    > >Only last feed works loaded by code, that's I don't undestand.
    > >
    > >thanks a lot

    >
    > This error is:-
    >
    > ERROR_WINHTTP_CANNOT_CONNECT
    >
    > do you have an outgoing firewall and a proxy server in place?
    >
    >
    >
    > Anthony Jones wrote:
    > > <> wrote in message
    > > news:...
    > > >
    > > >Hi people, I need some help with ServerHTTPRequest.
    > > >
    > > >My question is: why can I load only the last rss? Somebody have any
    > > >idea?
    > > >
    > > >Thanks a lot.
    > > >

    > >
    > > The code below seems fine although I'd use the more specific
    > > MSXML2.DOMDocument.3.0
    > > Prog ID. I'm afraid I find your question a very cryptic. In the link

    > below
    > > the first item results in a empty html file, the second is a raw xml, the
    > > third is transformed to html and the forth returns raw xml.
    > >
    > > Can you explain more clearly what your problem is?
    > >
    > > >>

    > > Example:
    > > http://www.clas.com.br/loja/sedex.calculo.asp
    > >
    > > Code:
    > > Sub getXML(sourceFile)
    > > dim styleFile
    > > dim source, style
    > > styleFile = Server.MapPath("news.xsl")
    > >
    > > set source = Server.CreateObject("MSXML2.DomDocument")
    > > source.async = false
    > > source.setProperty "ServerHTTPRequest", true
    > > source.load CStr( sourceFile )
    > >
    > > 'Se não for possível a conexão, mosta código de erro
    > > Response.Write( "<br/> Código de Erro: " & source.parseerror )
    > > Response.Write( "<br/> Código de Erro: " &
    > > source.parseerror.reason )
    > >
    > > set style = Server.CreateObject("Msxml2.DomDocument")
    > > style.async = false
    > > style.load styleFile
    > >
    > > 'source.transformNodeToObject style, Response
    > > set source = nothing
    > > set style = nothing
    > > End Sub
    > > <<
    , Jun 27, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page