2 Replies Latest reply on Jan 3, 2008 6:41 AM by tfennelly

    SOAPProcessor questions

    viniciuscarvalho

      Hi there! following the previous discussion : http://www.jboss.com/index.html?module=bb&op=viewtopic&t=126705

      After all the support from Tom, I'm still having problems with this class. I believe what I'm trying to do is very trivial, yet, I just can't get it working. I've read all the pdfs from the esb, been reading forums and source code all day, and yet nothing.

      All I need is to have my WS called , put the request params inside the jboss esb message and send an empty response to the client. Simple right?

      Here's a piece of code to do that:

      public Source invoke(Source source) {
       Message message = SOAPProcessor.getMessage();
       Source response = null;
       if (message == null) {
       response = createFaultResponse();
       } else {
      
       try {
       Transformer transformer = TransformerFactory.newInstance().newTransformer();
       transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"yes");
       transformer.setOutputProperty(OutputKeys.METHOD, "xml");
       StringWriter writer = new StringWriter();
       StreamResult streamResult = new StreamResult(writer);
       transformer.transform(source, streamResult);
       message.getBody().add(writer.toString());
       response = getResponseSource();
       } catch (Exception e) {
       e.printStackTrace();
       }
       }
       return response;
       }
      


      and bellow the service config for that:

      <actions>
       <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
       <property name="message"
       value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint"/>
       </action>
       <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">
       <property name="jbossws-endpoint" value="CSMService"/>
       </action>
      
       <action name="ContentBasedRouter" class="org.jboss.soa.esb.actions.ContentBasedRouter">
       <property name="ruleSet" value="contentRouter.drl"/>
       <property name="ruleLanguage" value="NamespaceXpath.dsl"/>
       <property name="ruleReload" value="true"/>
       <property name="destinations">
       <route-to destination-name="CadastroCliente" service-category="Cliente" service-name="ClienteService"/>
       <route-to destination-name="RemocaoCliente" service-category="Cliente" service-name="ClienteService"/>
       <route-to destination-name="CadastroCPE" service-category="CPE" service-name="CPEService"/>
       <route-to destination-name="RemocaoCPE" service-category="CPE" service-name="CPEService"/>
       <route-to destination-name="ReservaIP" service-category="ReservaIP" service-name="ReservaIPService"/>
       </property>
      
       </action>
       </actions>
      



      With this config option, SOAPProcessor overrides my message.getBody.add() with the response of the WS. The client gets an ok response, but the subsequent action (CBR) can't route, since the default_location is empty.

      Other approach: Same as above, but this time I put the request parameter inside other place at the message (message.getBody.add("otherplace",source). Well the client gets an ok response, but, CBR can't find "otherplace" and fails.


      Another one: Put the request on another place just as before, and create an action on the pipeline (just before the CBR) that moves from otherplace->body_default_location. Now, CBR works, but client gets the request parameter as a response.

      Well, I tried to set the action mep="OneWay" and it just does not worked as well, client still gets the request as the payload of the message.

      I've ran other tests as well, and it seems that the ESB does not care about my WS response, it simply replies with the content of the message defaults body location. No matter the MEP used. The message flown is explained on the programmers guide, but it's missing the part about the SOAP invocation.

      Another big problem that I've noticed is that this way, all my request flow is synchronous. The client only gets the response after the last service of the flow finishes its job. How can I set my action flow to be called asynchronously after the WS sends a response?

      I'm really sorry about all the confusing question I've been posting these days, but this is how I'm feeling (pretty confused).

      Friday is my last day of ESB evaluation as a product. I've tried everything to get it in a production project, but its really hard to get things working.
      I know that I could use a "trick" or two to get all this working, for instance, I could have my WS as an unaware ESB service, that gets the message and sends it using JMS to an aware ESB service. But, if I need to do such thing, maybe I don't need the ESB at all.

      Best regards



        • 1. Re: SOAPProcessor questions
          viniciuscarvalho

          Hum, still not got what I need, but its been good to know the code of jboss esb.

          I still think the way WS are being exposed a bit odd... So I tried to set my jbr-listener as async, and for my surprise, I've go an as a response from it. Since it's hard coded inside the JBossRemotingGatewayListener class, there's nothing I could do about :(

          I've filled a JIRA (http://jira.jboss.com/jira/browse/JBESB-1428) asking for a feature that would allow this response to be set on the configuration.


          • 2. Re: SOAPProcessor questions
            tfennelly

            OK, I'm getting lost in all the prose :-) Could you create an arch diagram of what you're trying to achieve and include bulleted points of the important requirements, marking those that are causing you difficulty at the moment?

            Also, could you just send me a zip of your app (tom dot fennelly --- jboss dot com).