Expand my Community achievements bar.

Enhance your AEM Assets & Boost Your Development: [AEM Gems | June 19, 2024] Improving the Developer Experience with New APIs and Events

Output Service invocation with webservices

Avatar

Former Community Member
Hello,
I want to invoke the output service with a Java Client using webservices. I have generated the proxy Java classes using Apache Axis, and then I wrote a Java Client invoking the output service, using a simple form (xdp file) and a data xml file.
The service invocation looks good (I have no erros in the log file) but I have no pdf file generated and I get the following error message..


Print request successful. No output generated as recordLevel or recordName does not matches with the data file.


If anyone can help. Thanks !
5 Replies

Avatar

Level 10
Which operation of the output service are you using?



Some operations return value some don't.



Jasmin

Avatar

Former Community Member
I am using the "generatePDFOutput" method of the output service. Then I try to get the binary data from the "generatePDFOutputResultDoc" parameter of the method. Here the sample of Java code :



outputClient.generatePDFOutput(TransformationFormat.PDF,

] _xdpFile,

] _path,

] pdfoptions,

] renderOptions,

] inDoc,

] new BLOBHolder(generatePDFOutputPDFDoc),

] new BLOBHolder(generatePDFOutputMetaDataDoc),

] new BLOBHolder(generatePDFOutputResultDoc),

] new OutputResultHolder(outResult));



byte[] outByteArray = generatePDFOutputResultDoc.getBinaryData();



There are no exceptions throwed, but byte array is null ...

Avatar

Level 10
Try to add ?blob=dime or ?blob=base64 at the end of your wsdl URL.



Jasmin

Avatar

Former Community Member
after change the wsdl Url, there is the same error returned.

Avatar

Former Community Member
The problem looks like you have not referenced your data source properly. <br /><br />Assume that you had this XML data source:<br /><br /><?xml version="1.0" encoding="UTF-8"?><br /><batch><br /><LoanRecord><br /><mortgageAmount>500000</mortgageAmount><br /><lastName>Blue</lastName><br /><firstName>Tony</firstName><br /><SSN>555666777</SSN><br /><PositionTitle>Product Manager</PositionTitle><br /><Address>555 No Where Dr</Address><br /><City>New York</City><br /><StateProv>New York</StateProv><br /><ZipCode>51256</ZipCode><br /><Email>TBlue@NoMailServer.com</Email><br /><PhoneNum>555-7418</PhoneNum><br /><FaxNum>555-9981</FaxNum><br /><Description>Buy a home</Description><br /></LoanRecord><br /><LoanRecord><br /><mortgageAmount>300000</mortgageAmount><br /><lastName>White</lastName><br /><firstName>Sam</firstName><br /><SSN>555666222</SSN><br /><PositionTitle>Program Manager</PositionTitle><br /><Address>557 No Where Dr</Address><br /><City>New York</City><br /><StateProv>New York</StateProv><br /><ZipCode>51256</ZipCode><br /><Email>SWhite@NoMailServer.com</Email><br /><PhoneNum>555-7445</PhoneNum><br /><FaxNum>555-9986</FaxNum><br /><Description>Buy a home</Description><br /></LoanRecord><br /><LoanRecord><br /><mortgageAmount>700000</mortgageAmount><br /><lastName>Green</lastName><br /><firstName>Steve</firstName><br /><SSN>55566688</SSN><br /><PositionTitle>Project Manager</PositionTitle><br /><Address>445 No Where Dr</Address><br /><City>New York</City><br /><StateProv>New York</StateProv><br /><ZipCode>51256</ZipCode><br /><Email>SGreeb@NoMailServer.com</Email><br /><PhoneNum>555-2211</PhoneNum><br /><FaxNum>555-2221</FaxNum><br /><Description>Buy a home</Description><br /></LoanRecord><br /></batch><br /><br />You must reference the XML data source that contains data records. An XML element is used to separate the data records. For example, in this XML data source, the XML element that separates data records is named LoanRecord.<br /><br />Plus - the XML element name must match the field name in your form. <br /><br />Your error is saying that the recordName or recordLevel does not match your data file. <br /> <br />Set the Record Name option by invoking the OutputOptionsSpec objects setRecordName method and passing a string value that specifies the XML element name in the data source that separates the data records. (For example-- LoanRecord).<br /><br />Hope this helps