3 Replies Latest reply on Apr 19, 2011 11:34 PM by Tom Cunningham

    Approach to integrate php/java through esb

    everson . Newbie




      I need do an integration between php and java through esb.



      There's a php website and the user will fill a form and submit. This values must be send to java between webservices using jbESB(After press submit button in php form, jbESB must detect automatic. Like happen when use <fs-bus** ).


      What I'd like know is, which approach to use ? http-bus or other ?  I'll need to use asynchronous/synchronous. And if there a something like that in quickstarts examples.



      **When I save a file on ../temp, the esb knows automatic

      <fs-bus busid="helloFileChannel">

                      <fs-message-filter directory="/home/everson/temp" input-suffix=".myfile" />





        • 1. Approach to integrate php/java through esb
          Tom Cunningham Master

          This thread has some information from people approaching the same issue, I think it'd probably be helpful.



          • 2. Re: Approach to integrate php/java through esb
            everson . Newbie

            Follow the steps from link above my test project works fine. But instead write a soap  message as string into php file, i did a call to java ws and get the soap message sent between ws-php and ws-java and i send that soap message as did on example(link)



            $clientClass = 'DebugSoapClient'; //wrapper to SoapClient.php

            $client = new $clientClass("http://localhost:8080/exe5/OrderPlacedWS?wsdl"); //********* first call

            ob_start(); //get the soap message sent

            $res = $client->orderPlaced($um); //here the method orderPlaced isn't executed because the wrapper, here just get the soap sent

            $out = ob_get_contents();



            $ch = curl_init();

            curl_setopt($ch, CURLOPT_POST, true);

            curl_setopt($ch, CURLOPT_URL, "localhost");

            curl_setopt($ch, CURLOPT_PORT, 8765);

            curl_setopt($ch, CURLOPT_POSTFIELDS, $out);

            $response = curl_exec($ch); //******************second call



            In this approach, I think, there's two calls for webservice. Couldn't it leave  a little overhead ? It's my first doubt. The second one is: How can i get an exception when occurs an error in SOAPProcessor ? I sent a wrong soap message to force an exception and I'd like get the error for log and to know that happened a wrong integration:



                        <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">

                            <property name="message" value="[Quickstart_webservice_producer] BEFORE invoking jbossws endpoint" />


                        <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.SOAPProcessor">

                            <property name="jbossws-endpoint" value="OrderPlacedWS" />


                        <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">

                            <property name="message" value="[Quickstart_webservice_producer] AFTER invoking jbossws endpoint" />


            • 3. Approach to integrate php/java through esb
              Tom Cunningham Master

              Glad to see you're making progress here, but what you are asking is really a php question - it's kind of out of the scope of this forum.       There's probably a ton of other forums or examples on Google for advice or examples on this sort of thing.