Hi Alex,

 

I think I have found a bug in the DelegationProcessor.java which results in the closing </root> element of the call input to be stripped (see below). The code is annotated below. The parameters var is used in several places to switch the call to endElement().

 

When the parameters var is set to null in the Stateless session EJB branch the </root> element appears OK.

 

Regards

 

Avinder

 

 

public ProcessorOutput createOutput(String name) {

 

      public void readImpl(.....) {

           

            readInputAsSAX(context, INPUT_CALL, new               ForwardingContentHandler(contentHandler) {

           

            public void endElement(String uri, String localname, String qName) {

                  ....

                  if (localname.equals("execute")) {

                        ....

                        if (service.type == ServiceDefinition.WEB_SERVICE_TYPE) {

                              // Call Web service

                              parameters = null;

                        ....

 

                        } else if (service.type == ServiceDefinition.STATELESS_EJB_TYPE

                                    || service.type == ServiceDefinition.JAVABEAN_TYPE) {

 

                              // BUG: in this logic branch parameters is not set to null

                        .....

                  } else {

                        // Store values if we are inside a <delegation:execute>

                        if (parameters == null) {

                              super.endElement(uri, localname, qName);

                        } else {

                              parameters.endElement(uri, localname, qName);

                        }

                  }

                             

                             

                             

 

-----Original Message-----

From: Avinder Bahra

Sent: 08 February 2005 10:36

To: '[email protected]'

Subject: RE: [orbeon-user] Parsing the return string of an EJB method into an XML document

 

Hi Alex

 

I tried the below suggestion but the XML produced does not include the closing </root> element - perhaps there is something wrong with the XPL. The XPL code is:

 

<!-- Call the EJB method using the Delegation Processor  --> <p:processor name="oxf:delegation">

  <p:input name="interface">

      <config>

          <service id="read-data" type="stateless-ejb" uri="ejb/MyBeanHome"/>

      </config>

  </p:input>

  <p:input name="call">

    <root>

      <delegation:execute service="read-data" operation="getName">

          <theform xsi:type="xs:string">SomeStringValue</theform>

      </delegation:execute>

    </root>

  </p:input>

 

  <p:output name="data" id="ejb-data"/>

</p:processor>

 

The output is

 

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

<root xmlns:delegation="http://orbeon.org/oxf/xml/delegation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:oxf="http://www.orbeon.com/oxf/processors" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:p="http://www.orbeon.com/oxf/pipeline" xmlns:saxon="http://saxon.sf.net/">

      &lt;document&gt;

&lt;xml-string&gt;

&lt;name&gt;Joe Bloggs Junior&lt;/name&gt; &lt;/xml-string&gt; &lt;/document&gt;

 

Note there is a missing </root> element.

 

The XML string returned from the EJB is

<document>

<xml-string>

<name>Joe Bloggs Junior</name>

</xml-string>

</document>

 

Any help appreciated,

 

Avinder

 

-----Original Message-----

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] On Behalf Of Alessandro Vernet

Sent: 07 February 2005 18:53

To: [email protected]

Subject: Re: [orbeon-user] Parsing the return string of an EJB method into an XML document

 

--- Avinder Bahra <[EMAIL PROTECTED]> wrote:

 

> There is an FAQ ( http://www.orbeon.com/community/faq#2.21  ) for

> parsing an XML string to an XML document using the XSLT processor and

> the saxon:parse function. However the input for the processor in the

> FAQ example uses an XML document. Is there a way I can wrap the above

> XML string inside a document so that I can use the same technique as

> the FAQ?

 

Yes. This will put the string returned by your EJB in a element named

"root":

 

    <root>

        <delegation:execute service="..." operation="...">

            ...

        </delegation:execute>

    </root>

 

Alex

 

 

 

-------------------------------------------------------

SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users.

Discover which products truly live up to the hype. Start reading now.

http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click

_______________________________________________

orbeon-user mailing list

[email protected]

https://lists.sourceforge.net/lists/listinfo/orbeon-user

 

 

Reply via email to