Highlighted

QueryMultipleRowsAsXML question

Elaine_Schmitz

03-03-2009

If you have a form, where the fields are properly mapped to a schema, and you use the QueryForMultipleRowsAsXml service (with an xml variable that is OUTPUT), is the data from the xml variable dynamically merged with the form fields?

Replies

Highlighted

Jasmin_Charbonn

03-03-2009

The xml generated by QueryForMultipleRowsAsXml would have to follow your schema if you want the data to merge with the field.



Jasmin
Highlighted

Elaine_Schmitz

04-03-2009

OK, I'm taking baby steps with this QueryMultipleAsXml thing...



I am receiving the error



Render processes is reader extended - rendering properly

Form displays properly



Clicking the invoke button to (try and) display records in the form causes this error:

2009-03-04 09:38:15,538 ERROR [com.adobe.idp.workflow.dsc.invoker.WorkflowDSCInvoker] An exception was thrown with name com.adobe.idp.dsc.DSCException message:No Credential or Context set while invoking service JdbcService and operation queryMultipleToXml and no fault routes were found to be configured.



The render service, the short lived query service, and the service to display the form all have security turned OFF.



When I use the "test" button inside the querymultiple service, rows are returned, so the data source is configured properly.



Thanks for any help you can provide,

Elaine
Highlighted

Jasmin_Charbonn

04-03-2009

Did you also turn security off on the JDBC service and all other services within the render service (even setValue).



You could also use the Run As instead. That way you don't have to disable security on every single service within your render process.



Jasmin
Highlighted

Elaine_Schmitz

04-03-2009

Here is the issue I am having. The schema has three nodes (let's say root, customers, customer). Inside the customer node is last,first,phone.<br /><br />So the schema looks like this:<br /><br /><?xml version="1.0" encoding="utf-8"?><br /><!-- Created with Liquid XML Studio 1.0.8.0 (http://www.liquid-technologies.com) --><br /><xs:schema elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema"><br /> <xs:element name="root"><br /> <xs:complexType><br /> <xs:sequence><br /> <xs:element name="customers"><br /> <xs:complexType><br /> <xs:sequence><br /> <xs:element maxOccurs="unbounded" name="customer"><br /> <xs:complexType><br /> <xs:sequence><br /> <xs:element name="lastName" /><br /> <xs:element name="firstName" /><br /> <xs:element name="phone" /><br /> </xs:sequence><br /> </xs:complexType><br /> </xs:element><br /> </xs:sequence><br /> </xs:complexType><br /> </xs:element><br /> </xs:sequence><br /> </xs:complexType><br /> </xs:element><br /></xs:schema><br /><br />The QueryForMultiple service only returns two nodes in the xml structure (customers, customer), because you can only specify the root and repeating element name. nd is stored in an xml output variable called "customerData".<br /><br />So the variable contains data that looks like this (note no "root" node).<br /><br /><customers><br /> <customer><br /> <lastName type="VARCHAR">SCHMITZ</lastName><br /> <firstName type="VARCHAR">AMAL</firstName><br /> <phone type="VARCHAR">123456789</phone><br /> </customer><br /> <customer><br /> <lastName type="VARCHAR">DOGGY</lastName><br /> <firstName type="VARCHAR">BUDDY</firstName><br /> <phone type="VARCHAR">222222222</phone><br /> </customer><br /></customers><br /><br />I've walked through record/playback and the variable holds the xml properly.<br /><br />How to get the data to map back to a dynamic table that has a repeatable row with fields last, first, phone?
Highlighted

Jasmin_Charbonn

04-03-2009

So if I understand properly, you're just missing the extra Root node.



What you could do is just create that extra node using xPath and set its content to the value returned by QueryForMultiple. For example



/process_data/myNewXML/Root = /process_data/xmlFromDB



In this case the Root node would be create in the empty myNewXML and the content of xmlFromDB (which contains your xml) would be added under the Root node.



Am I understanding the problem correctly.



Let me know,



Jasmin

Elaine_Schmitz

04-03-2009

Thanks Jasmine, progress! Now when I record / playback, the xml variable looks exactly like my schema def. So the data in the xml variable is now:




Smith
Tom
1234567890


Smith
Tom
1234567890




This variable is set as output from the process. I activate the process and add the data connection wsdl url to my form, and the data connection looks like this:

CustomerInfoQueryTableDC
invoke Request
Message Body
invoke (note there are no inputs to the process)
invoke Response
Message Body
invokeResponse
customerData
document
element

I have a table on the form that is bound to "customers" in the schema ($.customers) .
I have a repeating row in the table that is bound to "customer" in the schema ($.customer[*])
Each field in the repeating row, lastName, firstName, and phone, are bound to $.lastName, $.firstName, $.phone


What's my next step to get the data in the xml mapped to the form?
Thanks in advance,
Elaine
Highlighted

Han_Dao

19-03-2010

Hi Jasmin,

I have two PCs, onewas installed with Acrobat Pro 8.2.1 and the other one with 9.3.1. I have a form with the web service and it works fine on the PC with 9.3.1 installed but not on the one with 8.2.1. Every time I run the form, I get the same error like Elaine had. I compared all the setting for the 2 PCs and could not find any thing different so I could not tell why it is not working on one PC but not the other. I even tested on other user PC with 8.2.1 install and get the same error. Do you have any idea about this issue? Can you help on this?


Thanks in advance,

Han Dao