Suppose you have some php services which return a string using this simple code:
$name = $_GET['name'];
echo 'The service returned: ', $name
You can consume this services by your Silverlight application using the WebClient class:
<StackPanel x:Name="LayoutRoot" Background="White">
<Button x:Name="btnCall" Click="btnCall_Click" Content="Call php"/>
<TextBlock Text="" x:Name="txtResult" Height="80"/>
<Button x:Name="btnCallPar" Click="btnCallPar_Click" Content="Call php with parameter"/>
<TextBox x:Name="txtParameter" Text="Enter your name" Width="200"/>
<TextBlock Text="" x:Name="txtResultPar"/>
And in code behind:
public partial class MainPage : UserControl
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.
Take a look at this great discussion on the Silverlight forum, about Web-Services interoperability.
As described, Web-Services must be implemented following the specifications reported on the WS-I Organization site.
Click here to download the driver.
Ths Source code is available on CodePlex.
The new release is available for download.
Arun Gupta has posted a nice article on his blog describing the new features:
- Enhanced Code Completion
- Database-related code snippets
- Multiple project configurations
- Find Usages
- Java SE Project Integration
- Grails support
- Javadoc Analyzer
- Call Hierarchy
- CamelCase code completion
- New Multithreaded Debugging Support
- Debugging Window
- Current Thread Chooser
Additional enhancements have been made to
- Web Frameworks (Spring, Hibernate, JSF, JSF CRUD Generator, JPA)
- GUI Builder
- Web Services
- Improvements to XML and Schema Tools
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?
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.
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: