I just had a scenario where one of our client needs to consume our Asp.Net web service in their PHP host application.

Calling Asp.Net web service from PHP turned out to be easier then I thought. Here is how you can do.

First you need to download open source nusoap soap library, and put the lib folder under your application root directory. (I have renamed the folder name lib to nusoap in app directory).

The sample PHP code is below:

<?php
require_once(‘nusoap/nusoap.php’);

$client = new nusoap_client(‘http://www.yourdomain.com/service.asmx?WSDL’, ‘wsdl’,”, ”, ”, ”);

$err = $client->getError();
if ($err) {
echo ‘<h2>Constructor error</h2><pre>’ . $err . ‘</pre>’;
}
$param = ”;
$result = $client->call(‘functionName’, $param, ”, ”, false, true);

if ($client->fault) {
echo ‘<h2>Fault</h2><pre>’;
print_r($result);
echo ‘</pre>’;
} else {
// Check for errors
$err = $client->getError();
if ($err) {
// Display the error
echo ‘<h2>Error</h2><pre>’ . $err . ‘</pre>’;
} else {
// Display the result
echo ‘<h2>Result</h2><pre>’;
print_r($result);
echo ‘</pre>’;
}
}
?>

Of course, you can do much more than this, check out samples provided in downloaded nusoap source.

I use all three popular browsers (IE, FF and Chrome) but IE is still my primary browser for development. Till final version of IE8 released I used to use FF for testing my ajax application since Firebug add-on over there is doing nice job. IE8 has built in Developer Tools window now which covers almost all feature which Firebug has, plus there are some more. Very handy to use and does the job well.

 

Since couple of months we are working on a new project based on Asp.Net 3.5 Framework which is using Backbase as a client rendering framework. Backbase provides a rich user interface which is independent of development platform. It sure has a learning curve but once you are through that phase you will see the real advantage of RAD.

If you are trying to use Backbase with Asp.Net and have any questions then I may try to answer them since we have passed that phase of sorting out initial hiccups.

Asp.Net MVC is a great framework. But, developers coming from Webforms background will find it little bit difficult not having a set of Validation controls which automatically validates form input by user. JQuery is a part of Asp.Net MVC application and I just found a nice JQuery plugin which fills the gap of Validator Controls of Webforms. It can be downloaded from here.

There are enough examples which coveres most of the routine validation needs and using it is as easy as Webforms validator controls.

Recently I had a case where an application which was working fine suddenly started slowing down and apparently there were no code changes made. After checking around at Database properties found that Recovery Model was set to “Full”. In fact it was not needed according to the backup policy as only full backup was scheduled, not at the level of transaction log.

Setting the Recovery Model to “Simple” solved the problem and application was back on acceptable performance.

Check this link to know more about Recovery Model :
http://msdn.microsoft.com/en-us/library/aa173531.aspx

I have a code which makes Ajax post using JQuery in asp.net. It worked fine in IE and Chrome but failed in Firefox. When debugged using Firebug it showed 411 “Lenght Required” error. After wasting couple of hours on google it finally turned out a kind of Jquery bug.

Normally I wrote code like:

    $.ajax({ type: “POST”,
        url: “URL”,
        dataType: “xml”,
        processData: true,
        error: function(XMLHttpRequest, textStatus, errorThrown) {},
        success: {}
    });

Looks normal and works in IE and Chrome but not in FF, to make work in FF we have to provide an empty data header like below:

    $.ajax({ type: “POST”,
        url: “URL”,
        dataType: “xml”,
        data:{},
        processData: true,
        error: function(XMLHttpRequest, textStatus, errorThrown) {},
        success: {}
    });

It is weird because there are so many other headers which we don’t pass it too and they are taken with default values and why not with data header.

Hope it will be solved in upcoming jquery releases and till then hope this helps.

I needed to align content bottom-up for one web-based IM interface, searched around but could not find a perfect solution after a while, so here is how I solved the problem:

<div style="height:400px;width:100%">

 <table style="border:0;height:400px;width:100%;overflow:scroll">

            <tr>

            <td  id="TableInner" style="vertical-align:bottom;">

            </td>

            </tr>

          </table>

</div>

In above code, key is to put a table inside a div. Vertical-Align does not work on div tag so no matter what style you apply it will never work. by default it will align top. by putting same Size of table inside div we create another container for our content. Now we can apply vertical-align:bottom to TD tag of our table. Whatever content we need to put now we put it inside that TD tag. problem solved.   The outer div around table provides the scrollbars to our content if it overflows.

In addition if you need to set scroll position of Div to bottom then following Javascript will do that:

var objScr = document.getElementById(‘myDiv’); 

objScr.scrollTop = objScr.scrollHeight;

 

Hope this helps.

You may get this error while calling your web service. In my case it was running perfectly under IIS7 and when deployed on IIS6 it started giving this error.  After searching a while I found that I have to enable GET and POST protocols in web.config file.

Check out the MS article on this. It says it applies on Framework 1.1 but it is still relevent in case of Framework 2.0 +

http://support.microsoft.com/kb/819267

Hope this helps

Older versions of IIS than IIS7 are not going to recognize MVC urls and there for you need to do a work around solution provided by mvc framework itself.

Need to do two things:

1. Register the .mvc extension in IIS by running following script found under your MVC installation folder:

C:\Program Files\Microsoft ASP.NET\ASP.NET MVC RC\Scripts\iismap.vbs

Note: if you are still using preview version then it might not be there.

2. Change your Global.asax file so that mvc urls can now be used with .mvc extensions:

routes.MapRoute(
"Default",                                              // Route name
"{controller}.mvc/{action}/{id}",                           // URL with parameters
new { controller = "Home", action = "Index", id = "" }  // Parameter defaults
);

Note the that we are adding .mvc after controller name. So your URL may look like http://yourdomain/controller.mvc/viewpage

Hope this helps.

I have faced this issue today and thought it would be useful to share.

We can solve this issue in following way.

In IIS 7:

1. Right Click on Authentication feature and select Edit Feature.

2. Right Click on Anonymous Authentication and select Edit.

3. Either put IUSR_XXX account in Specific User or Just select Application Pool Identity (whatever works in your case).

IIS7


In IIS 5/6:

1. Click “Start” – “Run” – Type “inetmgr” and press “Ok” or “Enter” Key

2. IIS Control panel opens.

3. Expand the appropriate nodes and navigate to the virtual directory of your Web Service Application.

4. Select the Virtual directory, Right Click and select “Properties”

5. Switch to the “Directory Security” Tab and then Click “Edit”.

6. Check the “Anonymous Access” CheckBox.

7. Click “Ok” twice to exit.

This should solve the issue.

« Previous PageNext Page »