Jul
8
2009
Suppose you have some php services which return a string using this simple code:
phpInfo.php:
<?=
phpInfo()
?>
phpGetExample.php:
<?
if($_GET['name'])
{
$name = $_GET['name'];
}
echo 'The service returned: ', $name
?>
You can consume this services by your Silverlight application using the WebClient class:
<UserControl x:Class="phpTest.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/ presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Width="400" Height="300">
<StackPanel x:Name="LayoutRoot" Background="White">
<Button x:Name="btnCall" Click="btnCall_Click" Content="Call php"/>
<TextBlock Text="Result:"/>
<TextBlock Text="" x:Name="txtResult" Height="80"/>
<StackPanel Orientation="Horizontal">
<Button x:Name="btnCallPar" Click="btnCallPar_Click" Content="Call php with parameter"/>
<TextBox x:Name="txtParameter" Text="Enter your name" Width="200"/>
</StackPanel>
<TextBlock Text="Result:"/>
<TextBlock Text="" x:Name="txtResultPar"/>
</StackPanel>
</UserControl>
And in code behind:
<?
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
}
private void btnCall_Click(object sender, RoutedEventArgs e)
{
WebClient wc = new WebClient();
wc.DownloadStringCompleted += (s1, e1) => txtResult.Text = e1.Result;
wc.DownloadStringAsync(new Uri("<YourPhpUriHere>/phpInfo.php", UriKind.Absolute));
}
private void btnCallPar_Click(object sender, RoutedEventArgs e)
{
WebClient wc = new WebClient();
wc.DownloadStringCompleted += (s1, e1) => txtResultPar.Text = e1.Result;
wc.DownloadStringAsync(new Uri("<YourPhpUriHere>?name="+txtParameter.Text, UriKind.Absolute));
}
}
Read here the original post on the Siverlight forum and download the source code.
10 comments | tags: .NET Programming, PHP, Silverlight | posted in .NET Programming, PHP, Programming, Rich Internet Applications
Jul
8
2008
The new release is available for download.
Arun Gupta has posted a nice article on his blog describing the new features:
PHP
- Enhanced Code Completion
- Database-related code snippets
- Multiple project configurations
- Find Usages
Ajax
- JavaScript Debugger
- JavaScript Library Manager
- Bundled JavaScript Libraries
Groovy
- Editor
- Java SE Project Integration
- Grails support
Java
- Javadoc Analyzer
- Call Hierarchy
- CamelCase code completion
Debugger
- New Multithreaded Debugging Support
- Debugging Window
- Current Thread Chooser
Additional enhancements have been made to
- Web Frameworks (Spring, Hibernate, JSF, JSF CRUD Generator, JPA)
- Ruby
- Database
- Mobility
- GUI Builder
- Web Services
- Improvements to XML and Schema Tools
no comments | tags: Groovy, Java, Java EE, NetBeas, Open Source, PHP, Ruby | posted in Java Platform, Linux and Open Source, PHP, Programming, Ruby, Service Oriented Architecture, REST, Web 2.0
Jul
2
2008
Thanks to this post by Marco Cantù, I’ve found two interesting articles by Justin James about the future of the Embarcadero/CodeGear development environments:
Justin states that ”CodeGear’s .NET products are expanding in new directions, which include RIA development and targeting other platforms (through systems such as Mono)”.
Will we be able to write rich internet applications using Delphi and targeting both .NET and Mono platforms?
no comments | tags: .NET, Delphi, Open Source, PHP, Ruby | posted in .NET Programming, Delphi, Linux and Open Source, PHP, Rich Internet Applications, Ruby
Nov
17
2007
I’ve just tried to run PHP applications inside IBM WebSphere 2.0 Community Edition using the free PHP Integration Kit available on the IBM site, but it seems no more supported.
A better tool, based on a Open Source project called PHP/Java Bridge, can be downloaded from SoundForge.
The installation is very simple:
- install PHP (remember to enable the java extentions in the php.ini file);
- install WAS CE 2.0;
- log-on to the administration console and deploy JavaBridge.war included with the bridge.
no comments | tags: J2EE, Open Source, PHP, SOA, WebSphere | posted in Java Platform, Linux and Open Source, PHP, Service Oriented Architecture, REST, Web 2.0
Nov
9
2007
An interesting article,”Integrating PHP into Your SOA Solutions” by Rikki Kirzner, shows how to integrate PHP applications in an existing Service Oriented Architecture using:
no comments | tags: J2EE, PHP, SOA, WebSphere | posted in Java Platform, Linux and Open Source, PHP, Service Oriented Architecture, REST, Web 2.0