Hello, We are working on a proof of concept page to demonstrate
making a call to a web service through a pipeline. Our starting point is
similar to the “web-service-weather” sample. We have been able to get this working when the submission to
the WS is made from within the view (as in the weather sample), but once we run
it through a pipeline, the “dummy” instance does not get updated,
and therefore the response is not written back to the page. Our pipeline looks like this: <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:delegation="http://orbeon.org/oxf/xml/delegation" xmlns:oxf="http://www.orbeon.com/oxf/processors">
<p:param name="instance" type="input" debug="my-instance-input" />
<p:param name="data" type="output" debug="my-data-output"/>
<p:processor name="oxf:xslt">
<p:input name="data" href="#instance"/>
<p:input name="config">
<delegation:execute service="hello" operation="Hello" xsl:version="2.0">
<hca:Hello xmlns:hca="http://ws.util.hca.com/">
<hca:input>
<xsl:value-of select="/say/hello-to" />
</hca:input>
</hca:Hello>
</delegation:execute>
</p:input>
<p:output name="data" id="delegation-call" />
</p:processor>
<p:processor name="oxf:delegation">
<p:input name="interface">
<config>
<service id="hello" type="webservice" style="document" endpoint="http://localhost/Service.asmx">
<operation name="Hello" soap-action="http://ws.util.hca.com/Hello" />
</service>
</config>
</p:input>
<p:input name="call" href="#delegation-call" />
<p:output name="data" ref="data" />
</p:processor> </p:config> And here is our view: <?xml version="1.0" encoding="windows-1252"?> <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xsl:version="2.0"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:xforms="http://www.w3.org/2002/xforms"
xmlns:widget="http://orbeon.org/oxf/xml/widget"
xmlns:ev="http://www.w3.org/2001/xml-events">
<head>
<title>XForms Hello</title>
<xforms:model>
<xforms:instance id="ws-request">
<say xmlns="">
<hello-to />
</say>
</xforms:instance>
<xforms:instance id="ws-response">
<dummy xmlns="" />
</xforms:instance>
<xforms:submission id="say-hello" ref="instance('ws-request')" action="/hello/" method="post" replace="instance" instance="ws-response" />
</xforms:model>
</head>
<body>
<p>
<xforms:input ref="/say/hello-to">
<xforms:label>Please enter your first
name:</xforms:label>
</xforms:input>
</p>
<p>
<xforms:trigger>
<xforms:label>Say Hello!</xforms:label>
<xforms:action ev:event="DOMActivate">
<xforms:recalculate />
<xforms:send submission="say-hello" />
</xforms:action>
</xforms:trigger>
</p>
<p>
<xforms:output ref="instance('ws-response')/HelloResponse/HelloResult" />
</p>
<widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget"/>
</body> </html> Any insight as to why the ‘ws-response’ instance
in the view is not being updated after submission is greatly appreciated. Bill
Brown Web Development Team Leader HealthCare Anytime (858) 453-3600,
ext. 260 -- 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 |
Looks like you're on to something. I tried to duplicate the problem, and I think I'm coming up with the same results. I tried to simplify what you are doing (sans web service), and the instance doesn't get populated. What's does your log say? Mine says, "instance replacement did not take place upon successful response because no body was provided" (whatever that means -- the log shows the proper data going in and out).
Maybe someone else has an idea? I'm probably overlooking the obvious. Here's how I recreated your example. First, I created an XPL in the sandbox that creates an XML response. Once that worked, I then created the XPL: <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:delegation="http://orbeon.org/oxf/xml/delegation" xmlns:oxf="http://www.orbeon.com/oxf/processors"> <p:param name="instance" type="input" debug="INSTANCE INPUT"/> <p:param name="data" type="output" debug="DATA OUTPUT"/> <p:processor name="oxf:xslt"> <p:input name="data" href="#instance"/> <p:input name="config"> <reply xsl:version="2.0">Hello, <xsl:value-of select="/say-hello/to"/>!</reply> </p:input> <p:output name="data" ref="data"/> </p:processor> </p:config> Next, I created a simple page (similar to yours) to access it: <?xml version="1.0"?> <xhtml:html xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <xhtml:head> <xhtml:title>Hello</xhtml:title> <xforms:model> <xforms:instance id="request"> <say-hello> <to>Dolly</to> </say-hello> </xforms:instance> <xforms:instance id="response"> <dummy/> </xforms:instance> <xforms:submission id="hello-submission" method="post" action="/hello/to" ref="instance('request')" replace="instance" instance="response"/> </xforms:model> </xhtml:head> <xhtml:body> <xforms:input ref="instance('request')/to"> <xforms:label>Name: </xforms:label> </xforms:input> <xforms:trigger> <xforms:label>Say Hello</xforms:label> <xforms:send submission="hello-submission" ev:event="DOMActivate"/> </xforms:trigger> <widget:xforms-instance-inspector xmlns:widget="http://orbeon.org/oxf/xml/widget"/> </xhtml:body> </xhtml:html> When this is run, the xforms-instance-inspector still shows the "<dummy/>" tag instead of the expected "<reply>Hello, Dolly!</reply>" (as shown in the log). My log says the following: 2008-06-19 15:35:17,513 INFO ProcessorService - /hello/to - Received request 2008-06-19 15:35:17,530 INFO DebugProcessor - INSTANCE INPUT: line 6, column 67 of oxf:/apps/hello/hello.xpl <say-hello xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xxforms="http://orbeon.org/oxf/xml/xforms" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:xforms="http://www.w3.org/2002/xforms"> <to>Dolly</to> </say-hello> 2008-06-19 15:35:17,530 INFO DebugProcessor - DATA OUTPUT: line 7, column 61 of oxf:/apps/hello/hello.xpl <reply xmlns:delegation="http://orbeon.org/oxf/xml/delegation" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:p="http://www.orbeon.com/oxf/pipeline">Hello, Dolly!</reply> 2008-06-19 15:35:17,530 INFO ProcessorService - /hello/to - Timing: 17 - Cache hits for cache.main: 222, fault: 8, adds: 8, expirations: 4, success rate: 96% 2008-06-19 15:35:17,605 WARN XFormsServer - XForms - submission - instance replacement did not take place upon successful response because no body was provided. Submission: hello-submission 2008-06-19 15:35:17,607 INFO ProcessorService - /xforms-server - Timing: 105 - Cache hits for cache.main: 24, fault: 1, adds: 0, expirations: 0, success rate: 96% |
In reply to this post by Bill Brown-16
Hi Bill, Back from a conference, trying to catch up on this list. A couple quick guesses. [interspersed] On Jun 19, 2008, at 12:23 PM, Bill Brown wrote: > Hello, > > > > We are working on a proof of concept page to demonstrate making a > call to a web service through a pipeline. Our starting point is > similar to the “web-service-weather” sample. > > > > We have been able to get this working when the submission to the WS > is made from within the view (as in the weather sample), but once > we run it through a pipeline, the “dummy” instance does not get > updated, and therefore the response is not written back to the page. > > > > Our pipeline looks like this: > > > > <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xmlns:delegation="http://orbeon.org/oxf/xml/delegation" > xmlns:oxf="http://www.orbeon.com/oxf/processors"> > > > > <p:param name="instance" type="input" debug="my-instance-input" /> > > <p:param name="data" type="output" debug="my-data-output"/> > I believe you must serialize your output. See the XML serializer (a legacy pipeline but with small configuration, or the http serialzier). http://www.orbeon.com/ops/doc/processors-serializers#xml-serializer http://www.orbeon.com/ops/doc/processors-serializers-http > <p:processor name="oxf:xslt"> > > <p:input name="data" href="#instance"/> > > <p:input name="config"> > > <delegation:execute service="hello" operation="Hello" > xsl:version="2.0"> > > <hca:Hello xmlns:hca="http://ws.util.hca.com/"> > > <hca:input> > > <xsl:value-of select="/say/hello-to" /> > OF view pages, you don't need this, but that is because the page-flow epilogue does this for you, inserting your page into a <xsl:template> then transforming. > </hca:input> > > </hca:Hello> > > </delegation:execute> > > </p:input> > > <p:output name="data" id="delegation-call" /> > > </p:processor> > > > > <p:processor name="oxf:delegation"> > > <p:input name="interface"> > > <config> > > <service id="hello" type="webservice" > style="document" endpoint="http://localhost/Service.asmx"> > > <operation name="Hello" soap-action="http:// > ws.util.hca.com/Hello" /> > > </service> > > </config> > > </p:input> > > <p:input name="call" href="#delegation-call" /> > > <p:output name="data" ref="data" /> > > </p:processor> > > </p:config> > > > > And here is our view: > > > > <?xml version="1.0" encoding="windows-1252"?> > > <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" > xsl:version="2.0" > > xmlns="http://www.w3.org/1999/xhtml" > > xmlns:xforms="http://www.w3.org/2002/xforms" > > xmlns:widget="http://orbeon.org/oxf/xml/widget" > > xmlns:ev="http://www.w3.org/2001/xml-events"> > > > > <head> > > <title>XForms Hello</title> > > > > <xforms:model> > > > > <xforms:instance id="ws-request"> > > <say xmlns=""> > > <hello-to /> > > </say> > > </xforms:instance> > > > > <xforms:instance id="ws-response"> > > <dummy xmlns="" /> > > </xforms:instance> > > > > <xforms:submission id="say-hello" ref="instance('ws- > request')" action="/hello/" method="post" replace="instance" > instance="ws-response" /> > > > am posting and returning. When satisfied it's the right content, then replace just the instance. There is also a widget:inspector to see if the xforms instance has been updated. I hope that is some help, Regards, Hank > > > </xforms:model> > > > > </head> > > > > <body> > > <p> > > <xforms:input ref="/say/hello-to"> > > <xforms:label>Please enter your first name:</ > xforms:label> > > </xforms:input> > > </p> > > > > <p> > > <xforms:trigger> > > <xforms:label>Say Hello!</xforms:label> > > <xforms:action ev:event="DOMActivate"> > > <xforms:recalculate /> > > <xforms:send submission="say-hello" /> > > </xforms:action> > > </xforms:trigger> > > </p> > > > > <p> > > <xforms:output ref="instance('ws-response')/ > HelloResponse/HelloResult" /> > > </p> > > > > <widget:xforms-instance-inspector xmlns:widget="http:// > orbeon.org/oxf/xml/widget"/> > > > > </body> > > </html> > > > > Any insight as to why the ‘ws-response’ instance in the view is not > being updated after submission is greatly appreciated. > > > > Bill Brown > > Web Development Team Leader > > HealthCare Anytime > 3655 Nobel Drive, Suite 300 > San Diego, CA 92122 > > (858) 453-3600, ext. 260 > > > > > -- > 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 NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- 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 |
Hank,
It doesn't seem to have anything to do with the web service call (see my response). When I switched to replace "all", no data is returned.
|
OK.
The next debug step I recommend is to set up tcpmon to see exactly what you are posting and response you are getting, although I would have expected at least a SOAP Fault. http://ws.apache.org/commons/tcpmon/tcpmontutorial.html Cheers, Hank On Jun 23, 2008, at 12:51 PM, Paedagogus wrote: > > Hank, > > It doesn't seem to have anything to do with the web service call > (see my > response). When I switched to replace "all", no data is returned. > > > > > Hank Ratzesberger wrote: >> >> >> Hi Bill, >> >> Back from a conference, trying to catch up on this list. >> >> A couple quick guesses. [interspersed] >> >> On Jun 19, 2008, at 12:23 PM, Bill Brown wrote: >> >>> Hello, >>> >>> >>> >>> We are working on a proof of concept page to demonstrate making a >>> call to a web service through a pipeline. Our starting point is >>> similar to the “web-service-weather” sample. >>> >>> >>> >>> We have been able to get this working when the submission to the WS >>> is made from within the view (as in the weather sample), but once >>> we run it through a pipeline, the “dummy” instance does not get >>> updated, and therefore the response is not written back to the page. >>> >>> >>> >>> Our pipeline looks like this: >>> >>> >>> >>> <p:config xmlns:p="http://www.orbeon.com/oxf/pipeline" >>> xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >>> xmlns:delegation="http://orbeon.org/oxf/xml/delegation" >>> xmlns:oxf="http://www.orbeon.com/oxf/processors"> >>> >>> >>> >>> <p:param name="instance" type="input" debug="my-instance- >>> input" /> >>> >>> <p:param name="data" type="output" debug="my-data-output"/> >>> >> If this is a web service with a consumer at the other end of an http >> session, >> I believe you must serialize your output. See the XML serializer (a >> legacy >> pipeline but with small configuration, or the http serialzier). >> >> http://www.orbeon.com/ops/doc/processors-serializers#xml-serializer >> >> http://www.orbeon.com/ops/doc/processors-serializers-http >> >>> <p:processor name="oxf:xslt"> >>> >>> <p:input name="data" href="#instance"/> >>> >>> <p:input name="config"> >>> >>> <delegation:execute service="hello" operation="Hello" >>> xsl:version="2.0"> >>> >>> <hca:Hello xmlns:hca="http://ws.util.hca.com/"> >>> >>> <hca:input> >>> >>> <xsl:value-of select="/say/hello-to" /> >>> >> >> To my knowledge, you must have a <xsl:template> in your config. In >> OF view pages, >> you don't need this, but that is because the page-flow epilogue does >> this >> for you, inserting your page into a <xsl:template> then transforming. >> >>> </hca:input> >>> >>> </hca:Hello> >>> >>> </delegation:execute> >>> >>> </p:input> >>> >>> <p:output name="data" id="delegation-call" /> >>> >>> </p:processor> >>> >>> >>> >>> <p:processor name="oxf:delegation"> >>> >>> <p:input name="interface"> >>> >>> <config> >>> >>> <service id="hello" type="webservice" >>> style="document" endpoint="http://localhost/Service.asmx"> >>> >>> <operation name="Hello" soap-action="http:// >>> ws.util.hca.com/Hello" /> >>> >>> </service> >>> >>> </config> >>> >>> </p:input> >>> >>> <p:input name="call" href="#delegation-call" /> >>> >>> <p:output name="data" ref="data" /> >>> >>> </p:processor> >>> >>> </p:config> >>> >>> >>> >>> And here is our view: >>> >>> >>> >>> <?xml version="1.0" encoding="windows-1252"?> >>> >>> <html xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >>> xsl:version="2.0" >>> >>> xmlns="http://www.w3.org/1999/xhtml" >>> >>> xmlns:xforms="http://www.w3.org/2002/xforms" >>> >>> xmlns:widget="http://orbeon.org/oxf/xml/widget" >>> >>> xmlns:ev="http://www.w3.org/2001/xml-events"> >>> >>> >>> >>> <head> >>> >>> <title>XForms Hello</title> >>> >>> >>> >>> <xforms:model> >>> >>> >>> >>> <xforms:instance id="ws-request"> >>> >>> <say xmlns=""> >>> >>> <hello-to /> >>> >>> </say> >>> >>> </xforms:instance> >>> >>> >>> >>> <xforms:instance id="ws-response"> >>> >>> <dummy xmlns="" /> >>> >>> </xforms:instance> >>> >>> >>> >>> <xforms:submission id="say-hello" ref="instance('ws- >>> request')" action="/hello/" method="post" replace="instance" >>> instance="ws-response" /> >>> >>> >>> >> >> When I have to debug these, I use replace="all" and serialize what I >> am posting and >> returning. When satisfied it's the right content, then replace just >> the instance. >> There is also a widget:inspector to see if the xforms instance has >> been updated. >> >> I hope that is some help, >> Regards, >> Hank >> >> >>> >>> >> >>> </xforms:model> >>> >>> >>> >>> </head> >>> >>> >>> >>> <body> >>> >>> <p> >>> >>> <xforms:input ref="/say/hello-to"> >>> >>> <xforms:label>Please enter your first name:</ >>> xforms:label> >>> >>> </xforms:input> >>> >>> </p> >>> >>> >>> >>> <p> >>> >>> <xforms:trigger> >>> >>> <xforms:label>Say Hello!</xforms:label> >>> >>> <xforms:action ev:event="DOMActivate"> >>> >>> <xforms:recalculate /> >>> >>> <xforms:send submission="say-hello" /> >>> >>> </xforms:action> >>> >>> </xforms:trigger> >>> >>> </p> >>> >>> >>> >>> <p> >>> >>> <xforms:output ref="instance('ws-response')/ >>> HelloResponse/HelloResult" /> >>> >>> </p> >>> >>> >>> >>> <widget:xforms-instance-inspector xmlns:widget="http:// >>> orbeon.org/oxf/xml/widget"/> >>> >>> >>> >>> </body> >>> >>> </html> >>> >>> >>> >>> Any insight as to why the ‘ws-response’ instance in the view is not >>> being updated after submission is greatly appreciated. >>> >>> >>> >>> Bill Brown >>> >>> Web Development Team Leader >>> >>> HealthCare Anytime >>> 3655 Nobel Drive, Suite 300 >>> San Diego, CA 92122 >>> >>> (858) 453-3600, ext. 260 >>> >>> >>> >>> >>> -- >>> 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 >> >> Hank Ratzesberger >> NEES@UCSB >> Institute for Crustal Studies, >> University of California, Santa Barbara >> 805-893-8042 >> >> >> >> >> >> >> >> -- >> 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 >> >> > > -- > View this message in context: http://www.nabble.com/XForms-call-to- > Web-Service-tp18016320p18076968.html > Sent from the ObjectWeb OPS - Users mailing list archive at > Nabble.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 NEES@UCSB Institute for Crustal Studies, University of California, Santa Barbara 805-893-8042 -- 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 |
Free forum by Nabble | Edit this page |