Programming is Passion,Software Development is an Adventure- Willy David Jr

Programming is Passion,Software Development is an Adventure- Willy David Jr

April 2008 - Posts

Consuming Web Service from Remote Machine

 

Consuming simple web service and understanding web service is a little bit difficult at first. It takes some time to understand the theory behind it. In my part, reading will be a good start. Read some articles and basics behind it. But as you move along, consuming will just be a basic part. You need to extend your web service so that it can be used by other application if not from your local, it can be a network, or in the internet.

On this simple article I've created, we will create a simple web service and use it on a local area network. Here are the steps:

1.) Create your web service in your VS 2005 environment, I prefer File - New - Web Site. Then choose ASP.NET Web Service template. Make sure you choose HTTP as your location.

2.) Create your web methods. Sample code below:

[WebMethod]public int Add(int a, int b)

{

return (a + b);

}

 

[
WebMethod]public System.Single Subtract(System.Single A, System.Single B)

{

return (A - B);

}

 

3.) Add a web config file. Add these nodes after system.web so that you can access this web service from a remote machine:

   <webServices>
        <protocols>
            <add name="HttpGet"/>
            <add name="HttpPost"/>
        </protocols>
    </webServices>

If you didn't put this, you will encounter this specific error: "The test form is only available for requests from the local machine" if you accessed this web service from a remote machine.

4.) Lastly, because your web service was running on your IIS, you can now accessed it and consumed your web service. For example, I have this remote machine, and my local machine where I published the above web service has a computer named PH-WWDTWDAVID, then I will just add a web reference like this link:

http://ph-wwdtwdavid/WebService/Service.asmx

5.) To use the code:

int xx; 

localhost.
Service myService = new localhost.Service();

xx=myService.Add(3, 3);

Response.Write(xx.ToString());

 

Regards,

Willy David Jr

Cannot Start Document Conversions Load Balancer Service (Fixes)

 

It was since yesterday that I want to figure out how to start this service in MOSS. I need this in order to start another service to complete my task in Central Administration. But recently, I found a way to fix this one, a simple fix actually. Reinstall your .NET 2.0 Framework. Reinstalling this doesn't just fix this error but also other issues as well like the OK button of Creating a New Web Application doesn't works. Even Cancel button doesn't works. How can you create your portal if this doesn't works. Indeed, some links in Central Administration doesn't works too. This makes me crazy because I need this settings for our test server to work, and I am the one who is assigned to configure it. Luckily, everything now works fine, and I have configured our portals to different users already.Smile

If you want another fix, and if my solution doesn't works, check this site: http://protegeit.blogspot.com/2007/12/document-conversions-launcher-service.html

Regards,

Willy David Jr