Defining some global properties.

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

Defining some global properties.

Nicolas Modrzyk-3
Hi,

My application is accessing a number of webservices.
I would like to take the urls of those webservices out of the xpl and
factorize them in an external file. The file is static and won't
change throughout the lifetime of the application. The content will
just be edited at deployment time.

What would be an easy way to achieve that without overhead for the application.
Is there an example somewhere ?

Thank you in advance,

Nicolas,


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Defining some global properties.

Alessandro Vernet
Administrator
Nicolas,

On Jan 23, 2008 3:01 AM, Nicolas Modrzyk <[hidden email]> wrote:
> My application is accessing a number of webservices.
> I would like to take the urls of those webservices out of the xpl and
> factorize them in an external file. The file is static and won't
> change throughout the lifetime of the application. The content will
> just be edited at deployment time.
>
> What would be an easy way to achieve that without overhead for the application.
> Is there an example somewhere ?

I would create an XML file somewhere in your resources (say
oxf:/config.xml) that contains those URLs in some simple format you
choose. In your XForms I assume you will be using this in submissions,
in the action attribute. Then instead of
action="http://intalio.com/end-world-hunger" you would write
action="{doc('oxf:/config.xml')/config/end-world-hunger}" (assuming
your configuration contains <config> <end-world-hunger>
http://intalio.com/end-world-hunger </end-world-hunger> </config>).

If you are using a nightly build, it is even simpler: you can define
those in properties.xml and use the new XPath function
xxforms:property().

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
http://www.orbeon.com/


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Defining some global properties.

Nicolas Modrzyk-3
This is exactly what I am looking for !!
Except this is not exactly working for me. :)

I am using delegation as described in:
http://www.orbeon.com/ops/doc/integration-webservices

My service call is looking like:
 <p:processor name="oxf:delegation">
                <p:input name="interface">
                    <config>
                        <service id="callWS" type="webservice"
endpoint="{doc('oxf:/config/services.xml')/services/tmsuri}">
                            <operation name="callWSName" soap-action="callWS"/>
                        </service>
                    </config>
                </p:input>
                <p:input name="call" href="#..."/>
                <p:output name="data" id="output"/>
            </p:processor>

But the value for endpoint is not processed and is passed as is.
Can I get 1 more hint that will help to end the world hunger ? :)

Nicolas,



On 1/24/08, Alessandro Vernet <[hidden email]> wrote:

> Nicolas,
>
> On Jan 23, 2008 3:01 AM, Nicolas Modrzyk <[hidden email]> wrote:
> > My application is accessing a number of webservices.
> > I would like to take the urls of those webservices out of the xpl and
> > factorize them in an external file. The file is static and won't
> > change throughout the lifetime of the application. The content will
> > just be edited at deployment time.
> >
> > What would be an easy way to achieve that without overhead for the application.
> > Is there an example somewhere ?
>
> I would create an XML file somewhere in your resources (say
> oxf:/config.xml) that contains those URLs in some simple format you
> choose. In your XForms I assume you will be using this in submissions,
> in the action attribute. Then instead of
> action="http://intalio.com/end-world-hunger" you would write
> action="{doc('oxf:/config.xml')/config/end-world-hunger}" (assuming
> your configuration contains <config> <end-world-hunger>
> http://intalio.com/end-world-hunger </end-world-hunger> </config>).
>
> If you are using a nightly build, it is even simpler: you can define
> those in properties.xml and use the new XPath function
> xxforms:property().
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> http://www.orbeon.com/
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Defining some global properties.

Nicolas Modrzyk-3
Can anyone help me on this ?

Thank you in advance,

Nicolas,


On 1/24/08, Nicolas Modrzyk <[hidden email]> wrote:

> This is exactly what I am looking for !!
> Except this is not exactly working for me. :)
>
> I am using delegation as described in:
> http://www.orbeon.com/ops/doc/integration-webservices
>
> My service call is looking like:
>  <p:processor name="oxf:delegation">
>                 <p:input name="interface">
>                     <config>
>                         <service id="callWS" type="webservice"
> endpoint="{doc('oxf:/config/services.xml')/services/tmsuri}">
>                             <operation name="callWSName" soap-action="callWS"/>
>                         </service>
>                     </config>
>                 </p:input>
>                 <p:input name="call" href="#..."/>
>                 <p:output name="data" id="output"/>
>             </p:processor>
>
> But the value for endpoint is not processed and is passed as is.
> Can I get 1 more hint that will help to end the world hunger ? :)
>
> Nicolas,
>
>
>
> On 1/24/08, Alessandro Vernet <[hidden email]> wrote:
> > Nicolas,
> >
> > On Jan 23, 2008 3:01 AM, Nicolas Modrzyk <[hidden email]> wrote:
> > > My application is accessing a number of webservices.
> > > I would like to take the urls of those webservices out of the xpl and
> > > factorize them in an external file. The file is static and won't
> > > change throughout the lifetime of the application. The content will
> > > just be edited at deployment time.
> > >
> > > What would be an easy way to achieve that without overhead for the application.
> > > Is there an example somewhere ?
> >
> > I would create an XML file somewhere in your resources (say
> > oxf:/config.xml) that contains those URLs in some simple format you
> > choose. In your XForms I assume you will be using this in submissions,
> > in the action attribute. Then instead of
> > action="http://intalio.com/end-world-hunger" you would write
> > action="{doc('oxf:/config.xml')/config/end-world-hunger}" (assuming
> > your configuration contains <config> <end-world-hunger>
> > http://intalio.com/end-world-hunger </end-world-hunger> </config>).
> >
> > If you are using a nightly build, it is even simpler: you can define
> > those in properties.xml and use the new XPath function
> > xxforms:property().
> >
> > Alex
> > --
> > Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> > http://www.orbeon.com/
> >
> >
> > --
> > 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
> > OW2 mailing lists service home page: http://www.ow2.org/wws
> >
> >
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Defining some global properties.

Alessandro Vernet
Administrator
In reply to this post by Nicolas Modrzyk-3
Nicolas,

On Jan 23, 2008 11:04 PM, Nicolas Modrzyk <[hidden email]> wrote:

> This is exactly what I am looking for !!
> Except this is not exactly working for me. :)
>
> I am using delegation as described in:
> http://www.orbeon.com/ops/doc/integration-webservices
>
> My service call is looking like:
>  <p:processor name="oxf:delegation">
>                 <p:input name="interface">
>                     <config>
>                         <service id="callWS" type="webservice"
> endpoint="{doc('oxf:/config/services.xml')/services/tmsuri}">
>                             <operation name="callWSName" soap-action="callWS"/>
>                         </service>
>                     </config>
>                 </p:input>
>                 <p:input name="call" href="#..."/>
>                 <p:output name="data" id="output"/>
>             </p:processor>
You can use expressions like
{doc('oxf:/config/services.xml')/services/tmsuri} (called AVTs) in
some attributes in XForms and in XSLT. But the delegation processor
doesn't recognize AVTs. So in this case you would have to either
generate the "config" input of the delegation processor with XSLT, or
simply put that configuration in a separate file and just have
<p:input name="interface" href="/webservices-interface.xml">.

In fact this processor is using a separate input for the interface for
this very reason. It was assumed that many calls to the delegation
processor would use the same interface, and that you would want to
declare this interface in a file somewhere, and just refer to it
whenever you need to call the delegation processor.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Defining some global properties.

Nicolas Modrzyk-3
Hi Alex,

Thank you so much for the clarification and explanation.

We have approximately a dozen different service calls to do, most of
them from a single service providing server. (the service methods are
different, but the server serving them are the same)

I was looking at just changing the base URL for the server hosting the
services I need to call, if you see what I mean.
So a URLResourceLocator with a servlet-like thing that would generate
the xml config for delegation would be good then ? What do you think ?

Nicolas,

On 1/29/08, Alessandro Vernet <[hidden email]> wrote:

> Nicolas,
>
> On Jan 23, 2008 11:04 PM, Nicolas Modrzyk <[hidden email]> wrote:
> > This is exactly what I am looking for !!
> > Except this is not exactly working for me. :)
> >
> > I am using delegation as described in:
> > http://www.orbeon.com/ops/doc/integration-webservices
> >
> > My service call is looking like:
> >  <p:processor name="oxf:delegation">
> >                 <p:input name="interface">
> >                     <config>
> >                         <service id="callWS" type="webservice"
> > endpoint="{doc('oxf:/config/services.xml')/services/tmsuri}">
> >                             <operation name="callWSName" soap-action="callWS"/>
> >                         </service>
> >                     </config>
> >                 </p:input>
> >                 <p:input name="call" href="#..."/>
> >                 <p:output name="data" id="output"/>
> >             </p:processor>
>
> You can use expressions like
> {doc('oxf:/config/services.xml')/services/tmsuri} (called AVTs) in
> some attributes in XForms and in XSLT. But the delegation processor
> doesn't recognize AVTs. So in this case you would have to either
> generate the "config" input of the delegation processor with XSLT, or
> simply put that configuration in a separate file and just have
> <p:input name="interface" href="/webservices-interface.xml">.
>
> In fact this processor is using a separate input for the interface for
> this very reason. It was assumed that many calls to the delegation
> processor would use the same interface, and that you would want to
> declare this interface in a file somewhere, and just refer to it
> whenever you need to call the delegation processor.
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.com/
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Defining some global properties.

Alessandro Vernet
Administrator
Nicolas,

On Jan 29, 2008 11:29 PM, Nicolas Modrzyk <[hidden email]> wrote:
> We have approximately a dozen different service calls to do, most of
> them from a single service providing server. (the service methods are
> different, but the server serving them are the same)

You can declare multiple services in the same "interface" document.
For instance:

<service id="end-world-hunger" type="webservice" style="rpc"
        endpoint="http://intalio.com/end-world-hunger">
    <operation nsuri="urn:avernet" name="operation1" .../>
    <operation nsuri="urn:avernet" name="operation2" .../>
</service>

This way you don't repeat the endpoint. And that document can be a
static document in your resources that you reference from everywhere
else.

> I was looking at just changing the base URL for the server hosting the
> services I need to call, if you see what I mean.
> So a URLResourceLocator with a servlet-like thing that would generate
> the xml config for delegation would be good then ? What do you think ?

I am not sure to understand: you would like to dynamically change the
URL of the service?

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Defining some global properties.

Nicolas Modrzyk-3
Hi Alex,

Sorry for delay, been travelling all week.
I just tried, and it works perfectly.

One minor change is that you need to wrap the <sevice> tag with <config> tags.
<config>
<service id="end-world-hunger" ...>
   <operation .../>
</service>
</config>

and as you said, call it using:
<p:input name="interface" href="oxf:/config/services.xml"/>

This is great!
Thanks a lot for your suggestion and help.

Niko,




On 1/30/08, Alessandro Vernet <[hidden email]> wrote:

> Nicolas,
>
> On Jan 29, 2008 11:29 PM, Nicolas Modrzyk <[hidden email]> wrote:
> > We have approximately a dozen different service calls to do, most of
> > them from a single service providing server. (the service methods are
> > different, but the server serving them are the same)
>
> You can declare multiple services in the same "interface" document.
> For instance:
>
> <service id="end-world-hunger" type="webservice" style="rpc"
>         endpoint="http://intalio.com/end-world-hunger">
>     <operation nsuri="urn:avernet" name="operation1" .../>
>     <operation nsuri="urn:avernet" name="operation2" .../>
> </service>
>
> This way you don't repeat the endpoint. And that document can be a
> static document in your resources that you reference from everywhere
> else.
>
> > I was looking at just changing the base URL for the server hosting the
> > services I need to call, if you see what I mean.
> > So a URLResourceLocator with a servlet-like thing that would generate
> > the xml config for delegation would be good then ? What do you think ?
>
> I am not sure to understand: you would like to dynamically change the
> URL of the service?
>
> Alex
> --
> Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
> Orbeon's Blog: http://www.orbeon.com/blog/
> Personal Blog: http://avernet.blogspot.com/
>
>
> --
> 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
> OW2 mailing lists service home page: http://www.ow2.org/wws
>
>


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: Defining some global properties.

Alessandro Vernet
Administrator
Nicolas,

On 2/3/08, Nicolas Modrzyk <[hidden email]> wrote:

> Sorry for delay, been travelling all week.
> I just tried, and it works perfectly.
>
> One minor change is that you need to wrap the <sevice> tag with <config>
> tags.
> <config>
> <service id="end-world-hunger" ...>
>    <operation .../>
> </service>
> </config>
>
> and as you said, call it using:
> <p:input name="interface" href="oxf:/config/services.xml"/>
>
> This is great!
> Thanks a lot for your suggestion and help.
Excellent. I am glad to read that this is working for you.

Alex
--
Orbeon Forms - Web 2.0 Forms, open-source, for the Enterprise
Orbeon's Blog: http://www.orbeon.com/blog/
Personal Blog: http://avernet.blogspot.com/


--
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
OW2 mailing lists service home page: http://www.ow2.org/wws