Pages

Tuesday, November 16, 2010

How to call web service in windows mobile

I have observed so many times on Microsoft and DNS (Dot Net Spider) forum in smart device category there is asking about web service call in windows mobile. So I have answered there and I have decided to write explained article about web service all in windows mobile application using C#.NET. This application is also useful for the US’s people only to get the one week weather forecast temperature.
In this article, I have considered two live web services used for Weather Forecast and Geo IP Service. The weather forecast web service provide one week weather forecast for place name in USA only. And Geo IP Service enables us to easily look up countries by IP address.
The WebserviceX.NET provides the free the web service provide access to functionality and data via web services
http://www.webservicex.net/ws/default.aspx
Let us create a project to consume web service in windows mobile application.
Step-1: Create smart device project using Visual Studio 2008.


Enter the project name and choose the project path location and press OK button.
Step-2: Select the Target platform and select .NET Compact framework and press OK button.
Step-3: Now let add the web service references in the project. Go to solution explorer of the project and right click on the References then a context menu will appear and click on the Add Web References…
Step-4: After click on the Add Web References… option then Add Web References dialog window will appear in the URL textbox I have entered “Weather Forecast” web service URL and click on Go Button right side of the textbox.
http://www.webservicex.net/WeatherForecast.asmx
Then web service page is displaying with the web methods, it mean web service is ready to use in our application, now enter the name of the web service which is using in the application here I have entered “WebSerWeatherForecast” and click on the Add Reference Button. See below picture.
Step-5: For add the Geo IP Web Service. Follow the Step-1 and Step-4
http://www.webservicex.net/geoipservice.asmx
Step-6: Now designing the UI for displaying data for Weather Forecast and Geo IP service acceding to requirement. Once the UI is ready then we can go ahead with the coding part to invoke the web service and download image for weather forecasting and GEO IP data. See below code snippet.
using WebServiceCall.WebSerGepIP;
using WebServiceCall.WebSerWeatherForecast;
using System.Net;
private void mnWeather_Click(object sender, EventArgs e)
{
using (frmCity ofrmCity = new frmCity())
{
ofrmCity.ShowDialog();
}
Cursor.Current = Cursors.WaitCursor;
WeatherForecast oWeatherForecast = null;
try
{
oWeatherForecast = new WeatherForecast();
object o = oWeatherForecast.GetWeatherByPlaceName(Program.strSelectedCity);
InitTextValues(o);
panel1.Visible = true;
panel2.Visible = true;
Title.Visible = false;
Message.Visible = false;
}
catch (WebException wx)
{
Cursor.Current = Cursors.Default;
switch (wx.Status)
{
case WebExceptionStatus.ConnectFailure:
MessageBox.Show(wx.Message);
break;
}
}
catch (Exception ex)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(ex.Message);
}
Cursor.Current = Cursors.Default;
}
The above code follows the sequence of code to choose the City first for getting the weather forecast information. Then create an instance of the web service of the weather forecasting; and invoked the method GetWeatherByPlaceName() this method has one string type of parameter which is the city name and this method will return an object which has all the weather forecasting data and pass the returned object to the InitTextValues() method which will parsing the object data.
Step-7: Now can go ahead for the Geo IP data code see below code snippet.
private void mnGeoIP_Click(object sender, EventArgs e)
{
Cursor.Current = Cursors.WaitCursor;
GeoIP oData = null;
try
{
GeoIPService oWebSerGepIP = new GeoIPService();
oData = oWebSerGepIP.GetGeoIPContext();
Cursor.Current = Cursors.Default;
using (GeoAreaIP ofrmCity = new GeoAreaIP(oData))
{
ofrmCity.ShowDialog();
}
}
catch (WebException wx)
{
Cursor.Current = Cursors.Default;
switch (wx.Status)
{
case WebExceptionStatus.ConnectFailure:
MessageBox.Show(wx.Message);
break;
}
}
catch (Exception ex)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(ex.Message);
}
}
The above code snippet is responsible to invoke the GeoIPService. Here I have create an object of the GeoIPService its instance allows us to invoke the GetGeoIPContext() method and its return type is GeoIP which will hold the data Geo IP Data.
Step-8: Now our application is ready to get web service data. In this case make sure that we need to cradle the Windows Mobile emulator see below picture to connect the emulator or device. Click on connect to device button.
After click on connect to device button below window will appear to see the device state is connected successful.
Now go to Tool Menu and click on it and click on the “Device Emulator Manager…” from the pool down menu see below picture.
After click on the Device Emulator Manager… a Device Emulator Manager window will open see below picture. It is showing green arrow on connected emulator or device.
Now right click on it and click on the Cradle from the context menu as depicted in the below picture.
After click on Cradle then Windows Mobile device center will connecting to Emulator this allows the internet access in the emulator.
Note if you are using Windows 7 and Vista Os then you have to install Windows Mobile Device center and if you are using Windows XP then you have to use Active Sync 4.5 for the same.
Now click on the “Connect Without setting up your device” after click on it the WMDC will connected properly see below picture.
Now run the application to press F5 Button the application’s first screen will appear see below picture

Now click on the Web Service Menu see below picture.




Now click on the Weather forecast option from the menu then it will open a window to select a city to get the weather forecast information of it. See below picture.


Now select the city from the drop down list and press Save Button then the web service is invoking and returns the appropriate data according to city see below screen.

Now click on the details button to view the one week weather forecast temperature.



Now go to main menu and click on the Web Service Menu -> Get Your Geo IP Area then it will open a screen with Geo IP Data. See below screen.
This application is also useful for the US’s people only to get the one week weather forecast temperature.
Download Source code here

Thanks you for your time.

Monday, November 15, 2010

SharePoint Server 2010 Capacity Management– talking about software boundaries and limits

Some interesting stuff about software boundaries and limits in SharePoint Server 2010 – take a look at the table below. You should make a distinction between hard limits (which you simply should not exceed) and soft limits – which are a sort of recommendation.

Soft limits    
  2007 2010
Content DB Size 100 GB 200 GB
File Size 2 GB 2 GB
DB’s per web app 100 300
Site collection size 100 GB 100 GB
List items per view 2000 5000
Application Pools 8 per web server 10 per web server
Managed Paths 20 per web app 20 per web app
Documents in a library   30 million with nesting. Depends heavily on usage and size of the documents
Indexed items in search 50 million 100 million

There is also a Technet article – SharePoint Server 2010 Capacity Management: Software Boundaries and limits – which provides some additional guidance – this also puts the numbers listed above a little more in perspective.

Content database sizes up to 1 terabyte are supported only for large, single-site repositories and archives with non-collaborative I/O and usage patterns, such as Records Centers. Larger database sizes are supported for these scenarios because their I/O patterns and typical data structure formats have been designed for, and tested at, larger scales.

For a full overview of the different white papers  - check out SharePoint Server 2010 performance and capacity test results and recommendations.

In general the new scale targets for 2010 go above and beyond the ones set in 2007 but design is still important although it becomes more difficult to bring a farm down by just putting millions of docs in one library – check out It looks like you’re building a large library. Would you like help? as well as Working with large lists in SharePoint 2010 – List Throttling .

Happy SharePoint-ing

 

Tuesday, November 9, 2010

BIWUG Session on SharePoint 2010 and FAST Search Server 2010 on December 1th

Agenda

18:00-18:30 Welcome with sandwich lunch

18:30-19:30 Building a public website with SharePoint Server 2010 – a practical case – www.vib.eu

19:30-19:45 Break

19:45-20:45 Introduction to FAST Search Server for SharePoint 2010

Location: RealDolmen, Industriezone Zenneveld, Vaucampslaan 42, 1654 Huizingen, Belgium

Registration is now opened on the BIWUG site www.biwug.be

Telerik RadControls for Windows Phone 7

     I am really happy that Telerik decided to develop controls for WP7. I have been using their silverlight controls since 2007 and they always added great controls. You can already download and try the CTP from the following this link . Even if it's just a CTP there are already many useful controls (Animation, DatePicker, DockPanel, PhoneApplicationFrame, DockPanel, TimePicker, Transition Control, UniformGrid, Window, WrapPanel, LayoutTransform, PickerBox, InfiniteListBox) . I would love to see a ProgressIndicator also and a decent MessageBox (I really don't like the default one). Also if you present a friend that downloads the tools you have the opportunity to win one of the 5 Windows Phone 7.  

   As always it's been a crazy period and I have little (no) time for writing code for the blog. Anyway when I find some spare time (usually from 1 o'clock in the morning till 3) I work on a DropBox library for WP7 (My Greatest Work Almost Completed) that I hope to publish soon along with an updated version of the IsolatedStorage Backup/Restore solution using DropBox. Everything works great: upload, download , create/delete folders and I am pretty excited. It could be a good alternative to Skydrive support that won't be available till early 2011. 

     I've also added a PayPal donation link at the blog this way if you find the source code on this blog useful feel free to donate (the donation will be invested in a brand new Windows Phone 7).

P.S. Wish I could have attended TechEd Europe. I really envy all of you that are attending.

NAMASTE

SharePoint 2010–Training videos overview

SharePoint 2010 on Chopsticks Belux

SharePoint 2010 Connections event

SharePoint 2010 Advanced developer training

TechEd 2009 Videos

SharePoint 2010 – Visual How to’s

Big Bang Theory and Information Management videos

MVP for another year

About a month ago I found out that I have been renewed as SharePoint Server MVP. For people who don’t know what a MVP is– here’s Microsoft’s definition:

“This award is given to exceptional technical community leaders who actively share their high quality, real world expertise with others. We appreciate your outstanding contributions in SharePoint Services technical communities during the past year.”

I became an MVP in 2005 and have been working with the Belgian SharePoint community ever since – it has been a great experience and I look forward to the next year.

Rational Guide to Multi tenancy in SharePoint 2010

Spence has an interesting series of articles about multi tenancy in SharePoint 2010 – a must read

Εκλογές...Τελικά ποιός κέρδισε ρε παιδια ????


Ολοι... Ολοι κέρδισαν...χα χα χα ...

115.000.000 (ΟΛΟΓΡΑΦΩΣ:Εκατόν δεκαπέντε εκατομμύρια ευρώ )αναμένεται να κοστίσουν οι εκλογές ....χωρις σε αυτα να συμπεριλαμβανονται οι κρατικες διαφημισεις, που... πεφτουν στα ΜΜΕ... 
Εν μέσω κρίσης και ΔΝΤ..... και ο Γιωργάκης απειλούσε και με πρόωρες εκλογές ....Ελεος...

Και μετά αναριωτιούνται γιατί ο κόσμος δεν θέλει να βλέπει κανένα τους ...



Παρτε να έχετε ...ΟΛΟΙ ΣΑΣ

Monday, November 8, 2010

Quick Tip–Accessing guest from host with VMWare Workstation

Most SharePoint 2010 developers probably use VMWare workstation (or Virtualbox). But what if you needed to access your SharePoint 2010 environment running in a VM from your host environment? I actually needed this to write a Windows Phone 7 app for SharePoint Server 2010 and since I can’t install the Windows Phone Developer Tools on Windows Server 2008 – I decided to use the install on my Windows 7 host and access SharePoint 2010 from there.

Quite easy – just change network settings to use VMWare Network Adapter VMNet1 (Host only) - A private network shared with the host - this way you can access the host from on your guest OS.

Technorati Tags: ,,

Overview of SharePoint 2010 powershell cmdlets

Ever wondered how you can quickly generate an overview of the available Powershell commandlets for SharePoint 2010? Try the next command:

Get-Command –PSSnapin “Microsoft.SharePoint.PowerShell” | select name, definition | format-list > C:\SP2010_PowerShell_Commands.txt

Thursday, November 4, 2010

Wednesday, November 3, 2010

Κάποιες Μέρες ξεκινάνε καλύτερα






Στα αλήθεια... Κάποιες μέρες ξεκινάνε αψογα.....

Προσέξτε το χαμόγελο του καλού κυρίου .....

How to localize The Title in a WP7 Silverlight application

This is a really interesting post by Pietro Brambati. It combines C++ and Silverlight projects:

http://blogs.msdn.com/b/pietrobr/archive/2010/11/01/how-to-localize-the-title-in-a-wp7-silverlight-application.aspx