exposing webservices

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

exposing webservices

c.harder
Hi,
I have some difficulties exposing webservices with ops (version 3 beta 4).
Currently I know how to call a webservice with ops. I build a webservice with web project tools (eclipse plugin), let it run on an other tomcat and integrated it in ops successfully.
I already had a look to your yim and employees example, but they are a little to complex for me.
Can somebody give a smaller example for exposing webservices with ops?
Maybe a webservice with: get a username and send it back again or after request, webservice response with generated xhtml of a tutorial (hello1-4) example.
Thanks for all



--
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: exposing webservices

Claudio Delgado

Hi.

 

I'm using 2.8. But it should be the same thing...

 

 

1.- Declare a page in you page flow without view, such as:

 

<c:page id="someID" path-info="/yourWebServicePath" model="doSomething.xpl"/>

 

2.- The processor doSomething should be similar to this one:

 

<?xml version="1.0" encoding="UTF-8"?>

 

 

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline">

 

    <!-- Get the request for an operation  -->

    <p:processor name="oxf:request">

        <p:input name="config">

            <config stream-type="xs:anyURI">

                <include>/request/body</include>

            </config>

        </p:input>

        <p:output name="data" id="request"/>

    </p:processor>

   

    <!--  The URL generator fetches a document from a URL and produces an XML output document-->

    <p:processor name="oxf:url-generator">

        <p:input name="config" href="aggregate('config', aggregate('url', #request#xpointer(string(/request/body))))"/>

        <p:output name="data" id="file"/>

    </p:processor>

   

    <!—Here you work with the document sent by the consumer (it should be within /request/body)

For example you can set parameters for another Pipe input-->

    <p:processor name="oxf:xslt">

        <p:input name="data" href="#file"/>

        <p:input name="config">

            <xsl:stylesheet version="1.0"

            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"

            xmlns:m="-">

                <xsl:template match="/">

                    <form>

                        <xsl:if test="boolean(/SOAP-ENV:Envelope/SOAP-ENV:Body/m:setConnection)">

                        <username><xsl:copy-of select="/SOAP-ENV:Envelope/SOAP-ENV:Body/m:setConnection/m:username"/></username>

                        <password><xsl:copy-of select="/SOAP-ENV:Envelope/SOAP-ENV:Body/m:setConnection/m:password"/></password>

                        </xsl:if>

                    </form>                           

                </xsl:template>

            </xsl:stylesheet>

        </p:input>

        <p:output name="data" id="form"/>

    </p:processor>

 

ß Here you can call another processor with the the WS logic à               

                    <p:processor name="oxf:pipeline">

                        <p:input name="config" href="../doSomethingII.xpl"/>

                        <p:input name="instance" href="#form"/>

                        <p:output name="data" id="result"/>

                    </p:processor>

 

   

    <!-- Writes the XML Documet in the Pipe out -->

    <p:processor name="oxf:xml-serializer">

        <p:input name="config">

            <config/>

        </p:input>

        <p:input name="data" href="#result">

        </p:input>

    </p:processor>

</p:config>

 

Hope it helps,

 

Claudio Delgado

Software AG

 

-----Mensaje original-----
De: [hidden email] [mailto:[hidden email]]
Enviado el: martes, 13 de diciembre de 2005 12:39
Para: [hidden email]
Asunto: [ops-users] exposing webservices

 

Hi,

I have some difficulties exposing webservices with ops (version 3 beta 4).

Currently I know how to call a webservice with ops. I build a webservice with web project tools (eclipse plugin), let it run on an other tomcat and integrated it in ops successfully.

I already had a look to your yim and employees example, but they are a little to complex for me.

Can somebody give a smaller example for exposing webservices with ops?

Maybe a webservice with: get a username and send it back again or after request, webservice response with generated xhtml of a tutorial (hello1-4) example.

Thanks for all

 



--
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: exposing webservices

Alessandro  Vernet
Administrator
Hi Claudio,

The same thing works with PresentationServer 3.0, but with 3.0 you can
simplify your code: pointing to your XPL file using the "view"
attribute instead of the "model" attribute in the page flow, and feed
the generated XML to a new "data" output of that pipeline, instead of
using the XML serializer. The epilogue will notice that your view does
not output XHTML, or XSL-FO, and so will send the XML as-is.

Alex

On 12/13/05, Claudio Delgado <[hidden email]> wrote:

>
>
>
> Hi.
>
>
>
> I'm using 2.8. But it should be the same thing...
>
>
>
>
>
> 1.- Declare a page in you page flow without view, such as:
>
>
>
> <c:page id="someID" path-info="/yourWebServicePath"
> model="doSomething.xpl"/>
>
>
>
> 2.- The processor doSomething should be similar to this one:
>
>
>
> <?xml version="1.0" encoding="UTF-8"?>
>
>
>
>
>
> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline">
>
>
>
>     <!-- Get the request for an operation  -->
>
>     <p:processor name="oxf:request">
>
>         <p:input name="config">
>
>             <config stream-type="xs:anyURI">
>
>                 <include>/request/body</include>
>
>             </config>
>
>         </p:input>
>
>         <p:output name="data" id="request"/>
>
>     </p:processor>
>
>
>
>     <!--  The URL generator fetches a document from a URL and produces an
> XML output document-->
>
>     <p:processor name="oxf:url-generator">
>
>         <p:input name="config" href="aggregate('config', aggregate('url',
> #request#xpointer(string(/request/body))))"/>
>
>         <p:output name="data" id="file"/>
>
>     </p:processor>
>
>
>
>     <!—Here you work with the document sent by the consumer (it should be
> within /request/body)
>
> For example you can set parameters for another Pipe input-->
>
>     <p:processor name="oxf:xslt">
>
>         <p:input name="data" href="#file"/>
>
>         <p:input name="config">
>
>             <xsl:stylesheet version="1.0"
>
>
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
>             xmlns:m="-">
>
>                 <xsl:template match="/">
>
>                     <form>
>
>                         <xsl:if
> test="boolean(/SOAP-ENV:Envelope/SOAP-ENV:Body/m:setConnection)">
>
>                         <username><xsl:copy-of
> select="/SOAP-ENV:Envelope/SOAP-ENV:Body/m:setConnection/m:username"/></username>
>
>                         <password><xsl:copy-of
> select="/SOAP-ENV:Envelope/SOAP-ENV:Body/m:setConnection/m:password"/></password>
>
>                         </xsl:if>
>
>                     </form>
>
>                 </xsl:template>
>
>             </xsl:stylesheet>
>
>         </p:input>
>
>         <p:output name="data" id="form"/>
>
>     </p:processor>
>
>
>
> ß Here you can call another processor with the the WS logic à
>
>                     <p:processor name="oxf:pipeline">
>
>                         <p:input name="config" href="../doSomethingII.xpl"/>
>
>                         <p:input name="instance" href="#form"/>
>
>                         <p:output name="data" id="result"/>
>
>                     </p:processor>
>
>
>
>
>
>     <!-- Writes the XML Documet in the Pipe out -->
>
>     <p:processor name="oxf:xml-serializer">
>
>         <p:input name="config">
>
>             <config/>
>
>         </p:input>
>
>         <p:input name="data" href="#result">
>
>         </p:input>
>
>     </p:processor>
>
> </p:config>
>
>
>
> Hope it helps,
>
>
>
> Claudio Delgado
>
> Software AG
>
>
>
> -----Mensaje original-----
>  De: [hidden email] [mailto:[hidden email]]
>  Enviado el: martes, 13 de diciembre de 2005 12:39
>  Para: [hidden email]
>  Asunto: [ops-users] exposing webservices
>
>
>
>
> Hi,
>
> I have some difficulties exposing webservices with ops (version 3 beta 4).
>
> Currently I know how to call a webservice with ops. I build a webservice
> with web project tools (eclipse plugin), let it run on an other tomcat and
> integrated it in ops successfully.
>
> I already had a look to your yim and employees example, but they are a
> little to complex for me.
>
> Can somebody give a smaller example for exposing webservices with ops?
>
> Maybe a webservice with: get a username and send it back again or after
> request, webservice response with generated xhtml of a tutorial (hello1-4)
> example.
>
> Thanks for all
>
>
>
> --
> 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
>
>
>

--
Blog (XML, Web apps, Open Source): 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
--
Follow Orbeon on Twitter: @orbeon
Follow me on Twitter: @avernet