Wednesday, August 02, 2006

Web Services - parameter value missing

When you pass parameters to WebMethod, not only the function name has to be the same, but also the parameters have to match. For example:

Web Service



public class User : System.Web.Services.WebService
{
public User() {}

[WebMethod]
public bool Login(string pLogin, string pPassword)
{
// implementation here
return true;
}
}



Proxy



public class UserPX : Microsoft.Web.Services3.WebServicesClientProtocol
{
public UserPX()
{
this.Url = @"http://localhost/user.asmx";
}

public bool Login(string pLogin, string pPassword)
{
object[] res = this.Invoke("Login", new object[] {pLogin, pPassword});
return (bool)res[0];
}


}

Tuesday, May 09, 2006

Windows XP - having multiple web sites under IIS

Long time ago I found a post which described how to set up multiple web sites in WinXP's IIS (which is not supported by default). Unfortunately I can't find it anymore and I didn't save the link either - since I found it very usefull, I'm posting it here (for my future reference mostly :) - once again, it's just a copy of someone else's post...


In the server versions of Windows, you can have multiple versions of web sites installed into IIS and running simultaneously. You can install and run more than one web site within IIS in the professional version of Windows XP or Windows 2000. You just have to pull a trick to modify the IIS metabase to that it is aware of the additional sites.. The user interface does not support creating more than one web site. Also, you still will not be able to have more than one site running at the same time.

To create the second web site:

Create a command prompt window.
Type "cd \Inetpub\Adminscripts" and press enter.
Find out what the highest numbered site you currently have is. You can do that by typing adsutil.vbs ENUM /P W3SVC

If you have never done this process before, the highest numbered site should be 1.
Add one to the highest numbered site. Then run this command:
adsutil.vbs COPY W3SVC/1 W3SVC/x

Where x is replaced by the new numbered site. For example if you run the enum command and the highest numbered site is 4, then type this:
adsutil.vbs COPY W3SVC/1 W3SVC/5

Run the IIS Manager. You should find a new site has been created. It will be an exact copy of site #1, so you will need to change a few things. Go into the properties for the web site. Change the site name, and the virtual directory for the root of the web site to point to another location on the hard disk. Usually, you will create a new subdirectory under Inetpub and point the virtual directory at that.
To use the site, you must first stop the currently running site, then start the new site.
To delete a site, first stop it if it is running (bad things happen if you don't!). Then type:

adsutil.vbs DELETE W3SVC/x

Where x is the number of the site you want to delete.

Windows XP - enable SMTP for IIS

I've had problems with my IIS on WinXP machine - emails wouldn't get sent. The CDO.Message would get created, but then during Send(), I'd get an error.
The trick is to set Relay - open IIS manager, go to properties of the virtual SMTP server, select the "Access" tab and there at the bottom is a "Relay..." button. Click it, the click "Add..." and type in 127.0.0.1 IP. That's it :)

Crystal XI and SMTP

I was working on setting up the SMTP part of Crystal XI (Business Objects).

1) First error I had was "destination DLL disabled. CrystalEnterprise.Smtp" - to fix that you need to go to the CMC (central management console), click "Servers", click "reportjobserver", select "Destinations" tab and there on the list enable the "Email (SMTP)" (check it and click the "enable" button).

2) Next 2 errors were "server error. CrystalEnterprise.Smtp: SMTP_E_TCPSOCKET_OPEN(2)" and "server error. CrystalEnterprise.Smtp: SMTP_E_COMMAND_NOT_IMPL(502)". Both are related to the SMTP configuration. To fix this, click on the "Email (SMTP)" and set the Domain/Server/Port. You may need to specify login as well - depends on yout network configuration.

Everything should be ok then - to test it, create a schedule for report and check the result.

Here are some useful links I found during my investigation.

1/ How to test SMTP:
http://seer.support.veritas.com/docs/252098.htm

2/ SMTP issue with McAfee
view...

3/ KB for Crystal
http://support.businessobjects.com/library/kbase/articles/c2018649.asp

Tuesday, April 18, 2006

Cuba - poster on the road from Trinidad to Varadero

 Posted by Picasa

Cuba : Trip & Tips

Just got back from Cuba - we did a little over 2 weeks there, travelled on our own. This was the general itinerary:
1/ Havana (2 days) - more than enough it you ask me, there's not that much to see
2/ Island of Youth (4 days) - this was quite tricky trip - i'll post detailed info on this one.
3/ Havana -> Santiago de Cuba (1 day) - on the bus (Viazul, 14 hrs, ~52 CUC), then rent a car
4/ Santiago De Cuba (1 day) - even worse than Havana, 1 day max
5/ Cayo Coco (2 days) - western-standard hotel resorts, not very cuban :)
6/ Trinidad (1 day) - nicest city in Cuba imho, 1 day is enough tho (it's very little)
7/ Varadero (2 days) - hotels & resorts...
8/ Playa Larga (2 days) - excellent for scuba diving, lots of moskitos!
9/ Havana (1 day) - flying out

Money - as foreigner, you have to use CUC (~1.1 USD, closer to EURo now tho) which you can change in banks (or if you get lucky and spot ATM). The prices are quite high, at least for foreigners - locals get things much cheaper.

Hotels / Casas Particular (CP) - we combined both, never had problem finding CP - usually ppl approach you on the street (especially when you get off the bus) and try to hook you up. They can be a bit annoying, but not too bad. All the CPs we used were very nice and clean, separate bathrooms, etc... Definitely worth the 15~25 CUC you spend. They like to offer food (b,l,d) - couple of times we tried it and it was always very good as well. Hotels were ok - Cayo Coco & Varadero were very nice (~100 CUC tho), Playa Larga was a bit run down (~60 CUC) with a lot of insect sharing our room :)