calling a Webservice DOCUMENT Style WITH user-inputs

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

calling a Webservice DOCUMENT Style WITH user-inputs

hospbene
Hey Guys,


I'm am trying out a few ways to call a webservice. Everything was great, but since I tried the DOCUMENT style with user-inputs, everything broke down =)

Here is my Problem:

I've got a delegation processor, which has to call a webservice. This is working fine as long as I am sending hardcoded inputs.
But I need to implement the user-inputs from a xforms-file.

1. This is the code which is working:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" 
                        xmlns:oxf="http://www.orbeon.com/oxf/processors" 
                        xmlns:delegation="http://orbeon.org/oxf/xml/delegation" 
                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                        xmlns:tns="http://www.ignyte.com/whatsshowing"> 

                <p:param type="output" name="data"/> 
                <p:param type="input" name="instance"/> 

   
    <p:processor name="oxf:delegation"> 
                <p:input name="interface" debug="interface-debug"> 
                   <config> 
                       <service id="MovieInformation" type="webservice" return-fault="true" style="document" endpoint="http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx"> 
                        <operation name="GetTheatersAndMovies" soap-action="http://www.ignyte.com/whatsshowing/GetTheatersAndMovies"/> 
                      </service> 
                   </config> 
                </p:input> 
                <p:input name="call" debug="call-debug"> 
                        <delegation:execute service="MovieInformation" operation="GetTheatersAndMovies"> 
                        <GetTheatersAndMovies xsl:version="2.0" xsl:version="2.0"> 
                           <zipCode>10001</zipCode> 
              <radius>35</radius> 
                   </GetTheatersAndMovies> 
                                </delegation:execute> 
                </p:input> 
                <p:output name="data" ref="data"/> 
        </p:processor> 
       
</p:config> 


But how do I get the pipeline inputs in my delegation-Element?



<p:input name="call" debug="call-debug"> 
                        <delegation:execute service="MovieInformation" operation="GetTheatersAndMovies"> 
                        <GetTheatersAndMovies xsl:version="2.0" xsl:version="2.0"> 
                           <zipCode> 

                            

                           </zipCode> 
              <radius> 

                             
                           </radius> 

                   </GetTheatersAndMovies> 
                                </delegation:execute> 
                </p:input> 



I thought something like xpath would help =)

<xsl:value-of select="//zipCode"/> and <xsl:calue-of select="//radius"/> 


Can somebody help me? I feel like cracking up!


greetz and thx,

bene
Reply | Threaded
Open this post in threaded view
|

Re: calling a Webservice DOCUMENT Style WITH user-inputs

hospbene
I've got a different way to solve the problem=)

I am writing the "call"-Element Body, in a xslt-Processor. And let the call-Element of the delegation Processor reference to that. it is not the best way and it's no beautiful way to do it, but it works!

Thanks to the search engines! But if someone has a better and nicer way to solve it, you're welcome to post it...



My compromise looks like this:

<p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" 
                        xmlns:oxf="http://www.orbeon.com/oxf/processors" 
                        xmlns:delegation="http://orbeon.org/oxf/xml/delegation" 
                        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
                        xmlns:tns="http://www.ignyte.com/whatsshowing"> 

                <p:param type="output" name="data"/> 
                <p:param type="input" name="instance"/> 

    <p:processor name="oxf:xslt"> 
                        <p:input name="data" href="#instance"/> 
                        <p:input name="instance" href="#instance"/> 
                        <p:input name="config"> 
                                <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> 
                                        <xsl:template match="/"> 
                                                <delegation:execute service="MovieInformation" operation="GetTheatersAndMovies" xmlns:delegation="http://orbeon.org/oxf/xml/delegation" xmlns:wsdl="urn:xxx.org/052007/xsd"> 
                                                        <GetTheatersAndMovies xmlns="http://www.ignyte.com/whatsshowing" xsl:version="2.0"> 
                  <zipCode> 
                                                                        <xsl:value-of select="doc('input:instance')//zipCode"/> 
                                                                </zipCode> 
            <radius> 
                                                                        <xsl:value-of select="doc('input:instance')//radius"/> 
            </radius> 
            </GetTheatersAndMovies> 
                                                </delegation:execute> 
                                        </xsl:template> 
                                </xsl:stylesheet> 
                        </p:input> 
                        <p:output name="data" id="callbody"/> 
                </p:processor> 
   
   
    <p:processor name="oxf:delegation"> 
                        <p:input name="interface" debug="interface-debug"> 
                                <config> 
                                        <service id="MovieInformation" type="webservice" return-fault="true" style="document" endpoint="http://www.ignyte.com/webservices/ignyte.whatsshowing.webservice/moviefunctions.asmx"> 
                                                <operation name="GetTheatersAndMovies" soap-action="http://www.ignyte.com/whatsshowing/GetTheatersAndMovies"/> 
                                        </service> 
                                </config> 
                        </p:input> 
                        <p:input name="call" href="#callbody" debug="call-debug"/> 
                        <p:output name="data" ref="data"/> 
                </p:processor> 
               
</p:config>