url-generator

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

url-generator

Marc.Benimeli
Hi all,
 
In my app I'm using a ASP.NET web server as an XML Server. OPS get data
from this server with the url-generator and post data with submit.xpl.

I have a problem using the url-generator. When I run the code below, the
url is called 2 times on the ASP.NET server.
 
<p:processor name="oxf:url-generator">
        <p:input name="config">
                <config>
       
<url>http://marc/Test01/Default.aspx?op=Init</url>
                        <content-type>application/xml</content-type>
                </config>
        </p:input>
        <p:output name="data" ref="data"/>
</p:processor>

But when I'm using any browser and I run the url in the address bar, the
url is only called 1 time as expected on the ASP.NET server.

Any idea ?

Thanks,

Marc



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: url-generator

Stephen Bayliss
I would debug by comparing the request sent by a browser, and the
request sent by OPS.

To debug the browser request, you could use (if you are using Firefox)
http://livehttpheaders.mozdev.org/

To debug the request sent by OPS might be more difficult -- is there
some logging you can turn on in ASP.NET to show the full request and
response information?  Maybe the HTTP result codes will shed some light
on the problem.

Could be something to do with authentication, as in this case the server
will return an HTTP response indicating authoristation is required, then
the client will send another request.

Steve

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
Sent: 08 June 2006 16:51
To: [hidden email]
Subject: [ops-users] url-generator

Hi all,
 
In my app I'm using a ASP.NET web server as an XML Server. OPS get data
from this server with the url-generator and post data with submit.xpl.

I have a problem using the url-generator. When I run the code below, the
url is called 2 times on the ASP.NET server.
 
<p:processor name="oxf:url-generator">
        <p:input name="config">
                <config>
       
<url>http://marc/Test01/Default.aspx?op=Init</url>
                        <content-type>application/xml</content-type>
                </config>
        </p:input>
        <p:output name="data" ref="data"/>
</p:processor>

But when I'm using any browser and I run the url in the address bar, the
url is only called 1 time as expected on the ASP.NET server.

Any idea ?

Thanks,

Marc





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: url-generator

Marc.Benimeli
In reply to this post by Marc.Benimeli
Steve,

In addition to your informations, I have found the same kind of tool for
IE : http://www.blunck.info/iehttpheaders.html

In ASP.NET I log the input request and the page_load event is fired 2
times with OPS.

As it's quite difficult to me to understand what's going on, I write a
java class to read from an url.
All is ok. Then I include this java class into the API
processor(oxf:java). All is ok again.

Here is my java class:

public class appelASP extends SimpleProcessor {

    public appelASP() {
        addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA));
    }

    public void generateData(PipelineContext context,
                             ContentHandler contentHandler)
    throws SAXException {
    try
                        {
    URL yahoo = new
URL("http://marc/Test01/Default.aspx?op=Init");
    URLConnection yc = yahoo.openConnection();
                                BufferedReader in = new BufferedReader(
       
new InputStreamReader(
       
yc.getInputStream()));
                                String inputLine;
                                String buffer = "";

                                while ((inputLine = in.readLine()) !=
null)
                                        buffer += inputLine;

                                in.close();

                                contentHandler.startDocument();
                                contentHandler.startElement("", "root",
"root", new AttributesImpl());
       
contentHandler.characters(buffer.toCharArray(), 0, buffer.length());
                                contentHandler.endElement("", "root",
"root");
                                contentHandler.endDocument();
                        }
    catch (Exception e) {
                                String buffer = "Erreur";
                                contentHandler.startDocument();
                                contentHandler.startElement("", "root",
"root", new AttributesImpl());
       
contentHandler.characters(buffer.toCharArray(), 0, buffer.length());
                                contentHandler.endElement("", "root",
"root");
                                contentHandler.endDocument();
    }
    }
}

Can someone explain that ?

--
Marc

>I would debug by comparing the request sent by a browser, and the
request sent by OPS.

>To debug the browser request, you could use (if you are using Firefox)
http://livehttpheaders.mozdev.org/

>To debug the request sent by OPS might be more difficult -- is there
some logging you can turn on in ASP.NET to show the >full request and
response information?  Maybe the HTTP result codes will shed some light
on the problem.

>Could be something to do with authentication, as in this case the
server will return an HTTP response indicating >authoristation is
required, then the client will send another request.

>Steve





--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: url-generator

Erik Bruchez
Administrator
Marc,

Here is what I suspect: that the first request comes from the caching
mechanism checking the last modification date of the URL, and the second
one from the actual reading of the URL.

This works great when using protocols like "oxf:" or "file:", because
getting the last modified date is very efficient. With HTTP, ideally you
would like to handle local caching, use the HEAD method, or disable
caching altogether.

A similar thing happened recently with improving caching of the XForms
processor, and we addressed it by making sure that the loading of HTTP
URLs happened once only for that processor. However, that fix is
specific to the XForms processor.

I think ideally OPS (at least the XPL engine) should globally handle
HTTP URLs in a smarter way. I have entered a bug to track this:

http://forge.objectweb.org/tracker/index.php?func=detail&aid=305475&group_id=168&atid=350207

In the meanwhile, is it unreasonable that you use your own processor to
access HTTP URLs?

-Erik

[hidden email] wrote:

> Steve,
>
> In addition to your informations, I have found the same kind of tool for
> IE : http://www.blunck.info/iehttpheaders.html
>
> In ASP.NET I log the input request and the page_load event is fired 2
> times with OPS.
>
> As it's quite difficult to me to understand what's going on, I write a
> java class to read from an url.
> All is ok. Then I include this java class into the API
> processor(oxf:java). All is ok again.
>
> Here is my java class:
>
> public class appelASP extends SimpleProcessor {
>
>     public appelASP() {
>         addOutputInfo(new ProcessorInputOutputInfo(OUTPUT_DATA));
>     }
>
>     public void generateData(PipelineContext context,
>                              ContentHandler contentHandler)
>     throws SAXException {
>     try
> {
>     URL yahoo = new
> URL("http://marc/Test01/Default.aspx?op=Init");
>     URLConnection yc = yahoo.openConnection();
> BufferedReader in = new BufferedReader(
>
> new InputStreamReader(
>
> yc.getInputStream()));
> String inputLine;
> String buffer = "";
>
> while ((inputLine = in.readLine()) !=
> null)
> buffer += inputLine;
>
> in.close();
>
> contentHandler.startDocument();
> contentHandler.startElement("", "root",
> "root", new AttributesImpl());
>
> contentHandler.characters(buffer.toCharArray(), 0, buffer.length());
> contentHandler.endElement("", "root",
> "root");
> contentHandler.endDocument();
> }
>     catch (Exception e) {
> String buffer = "Erreur";
> contentHandler.startDocument();
> contentHandler.startElement("", "root",
> "root", new AttributesImpl());
>
> contentHandler.characters(buffer.toCharArray(), 0, buffer.length());
> contentHandler.endElement("", "root",
> "root");
> contentHandler.endDocument();
>     }
>     }
> }
>
> Can someone explain that ?
>
>
>
> ------------------------------------------------------------------------
>
>
> --
> You receive this message as a subscriber of the [hidden email] mailing list.
> To unsubscribe: mailto:[hidden email]
> For general help: mailto:[hidden email]?subject=help
> ObjectWeb mailing lists service home page: http://www.objectweb.org/wws

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

RE: url-generator

Marc.Benimeli
In reply to this post by Marc.Benimeli
 

>Marc,

>Here is what I suspect: that the first request comes from the caching
mechanism checking the last modification date of >the URL, and the
second one from the actual reading of the URL.

>This works great when using protocols like "oxf:" or "file:", because
getting the last modified date is very efficient. >With HTTP, ideally
you would like to handle local caching, use the HEAD method, or disable
caching altogether.

ok

>A similar thing happened recently with improving caching of the XForms
processor, and we addressed it by making sure that >the loading of HTTP
URLs happened once only for that processor. However, that fix is
specific to the XForms processor.

>I think ideally OPS (at least the XPL engine) should globally handle
HTTP URLs in a smarter way. I have entered a bug to >track this:

>http://forge.objectweb.org/tracker/index.php?func=detail&aid=305475&gro
up_id=168&atid=350207

ok

>In the meanwhile, is it unreasonable that you use your own processor to
access HTTP URLs?

Yes of course, it's very reasonable that we use our own processor for
that use.

Thanks Erik,

--
Marc




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: url-generator

Marc.Benimeli
In reply to this post by Marc.Benimeli


>Marc,

>Here is what I suspect: that the first request comes from the caching
mechanism checking the last modification date of >the URL, and the
second one from the actual reading of the URL.

>This works great when using protocols like "oxf:" or "file:", because
getting the last modified date is very efficient. >With HTTP, ideally
you would like to handle local caching, use the HEAD method, or disable
caching altogether.

ok

>A similar thing happened recently with improving caching of the XForms
processor, and we addressed it by making sure that >the loading of HTTP
URLs happened once only for that processor. However, that fix is
specific to the XForms processor.

>I think ideally OPS (at least the XPL engine) should globally handle
HTTP URLs in a smarter way. I have entered a bug to >track this:

>http://forge.objectweb.org/tracker/index.php?func=detail&aid=305475&gro
>up_id=168&atid=350207

ok

>In the meanwhile, is it unreasonable that you use your own processor to
access HTTP URLs?

Yes of course, it's very reasonable that we use our own processor for
that use.

Thanks Erik,

--
Marc




--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws