Announcement Announcement Module
Collapse
No announcement yet.
OpenLaszlo + Spring WS sample Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • OpenLaszlo + Spring WS sample

    Hi,

    I made an example to show how to call Spring ws (Airline) from Laszlo. I'm a newbie in Spring WS and Laszlo (more or less a week), but here is my proposition. If somebody has a better solution please feel free. I just wonder if we can use Laszlo dataset to build the request instead of a 'stupid' string concatenation, I would be nicer and more clear.

    Here is the code:

    HTML Code:
    <canvas>
    	<bluestyle name="bluecolors" />
    
    	<dataset name="result" />
    
    	<soap name="airline"
    		wsdl="http://localhost:8080/airline/airline.wsdl">
    
    		<!-- 
    			Creates the document request for GetFlights request
    		-->
    		<method name="makedocGetFlights" args="from,to,date">
    			<![CDATA[
    				var s;
    				s = 
    				'<gfr:GetFlightsRequest'+' xmlns:gfr="http://www.springframework.org/spring-ws/samples/airline/schemas"'+'>'+
    					'<gfr:from>'+from+'</gfr:from>'+
    					'<gfr:to>'  + to +'</gfr:to>'+
    					'<gfr:departureDate>'+date+'</gfr:departureDate>'+
    				'</gfr:GetFlightsRequest>'
    
    				Debug.inspect(s);
    				return s;
    			]]>
    		</method>
    
    		<handler name="onload">
    			Debug.write('loaded'); Debug.inspect(this.proxy);
    		</handler>
    
    		<handler name="onerror" args="error">
    			Debug.write("------------- ERROR ------------");
    			Debug.inspect(error);
    		</handler>
    
    		<!-- 
    			Call the GetFlights operation in the airline service 
    			The operation is called with the string generated by the makedocGetFlights method
    			The response is stored in the result dataset 
    		-->
    		<remotecall funcname="GetFlights" dataobject="result">
    			<param
    				value="${canvas.airline.makedocGetFlights(from.text,to.text,date.text)}" />
    		</remotecall>
    
    	</soap>
    	<!-- Main window -->
    	<window width="550" height="360"
    		title="Spring WS Airline Sample - OpenLaszlo" bgcolor="gray">
    		<!-- General view -->
    		<view y="20" width="550" height="340">
    			<simplelayout axis="y" spacing="10" />
    			<!-- Parameter view -->
    			<view x="10">
    				<simplelayout axis="x" spacing="10" />
    				<text>From:</text>
    				<edittext id="from" text="AMS" />
    				<text>To:</text>
    				<edittext id="to" text="VCE" />
    				<text>Date:</text>
    				<edittext id="date" text="2006-01-31" />
    			</view>
    			<!-- Button view -->
    			<view x="10">
    				<button onclick="canvas.airline.GetFlights.invoke()">
    					Get Flights
    				</button>
    			</view>
    			<!-- Response view -->
    			<view x="10" bgcolor="silver">
    				<grid datapath="result:/item/GetFlightsResponse/"
    					width="500" style="bluecolors">
    					<gridtext width="100" editable="false"
    						datapath="number/text()">
    						Number
    					</gridtext>
    					<gridtext width="400" editable="false"
    						datapath="departureTime/text()">
    						Departure Time
    					</gridtext>
    				</grid>
    			</view>
    		</view>
    	</window>
    </canvas>
    http://www.vernier.be/spring-framewo...-openLazlo.png

    Regards
    Dominique

  • #2
    Looks nice!

    Comment


    • #3
      Hi,

      I found a solution with a dataset which represent your soap request, this dataset is used as a template and fill with screen values before the sending the request.

      For more information please check http://forum.openlaszlo.org/showthread.php?t=10185

      Regards
      Dominique

      Comment


      • #4
        Open Laszlo issue

        Hi all,

        I am a newbie in OpneLaszlo. I have created a login page using laszlo and configured the same in Spring Framework Controller. I could able to submit the form using the login form, but it is not redirecting me to the next page, which is my search screen.

        If someone could help me out, how to navigate from one laszlo page to another, it would be really helpful for me. (Note: Please note that I am using Spring Framework to configure my laszlo pages, ex-dispatcher-servlet.xml);

        Please help me out. Thanking you in advance.

        Regards

        Kannan

        Comment

        Working...
        X