CodeVerge.Net Beta


   Explore    Item Entry    Members      Register  Login  
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML

Free Download:




Zone: > NEWSGROUP > Asp.Net Forum > visual_studio.vs_2005_web_application_projects Tags:
Item Type: NewsGroup Date Entered: 4/25/2006 8:08:34 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 3 Views: 13 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
4 Items, 1 Pages 1 |< << Go >> >|
jamesqding
Asp.Net User
Should WAP avoid facade Design Pattern when calling WebServices ?4/25/2006 8:08:34 PM

0/0

ASP.Net Team,

In .Net 1.1, we do not call Web Services directly in ASP.net code.
We create separate DLL project and then call Web Service within that DLL.

Here is what happens with VS.Net 2005: When a DLL adding Web Reference to a Web Services,
a new App.Config and a new Settings.setting file are created, with url
saved in these files ( such as http://localhost:1056/WebService1/Service1.asmx). When we
complie the DLL project, the Url shows up in complied DLL (revealed by ILDASM).

Obviously, when this DLL is deployed with WAP, no one can change WebService
url endpoint since it is compiled into a DLL --- this is a problem for deployment configuration
since we need to recompile the DLL and WAP/WebSite in order to retarget WebService EndPoint.
If you look at WebService Proxy carefully, it uses       

"Global.ClassLibrary1.My.MySettings.Default.ClassLibrary1_localhost_Service1"
no long uses AppSetting as in .Net 1.1

One the other hand, if I call WebService directly from ASP.Net (WAP or WebSite), I can change
WebService Endpoint Url from Web.Config since there are no DLL at all.

Question:  During our Migration using WAP, Should we stay away from Facade design pattern so that
    WebServices ALWAYS get called from ASP.Net codebehind ?
           Does this mean the end to Facade pattern or this is something that can be fixed in
           VS.Net 2005 SP1, particular for people who use WAP?


Steps to re-produce:

Step1. Create a blank Solution
Step2. Crate a WebService Project
Step3. Create a ClassLibrary Project and Add Web Reference to 2. (This is Facade DLL)
     Note that VS.Net 2005 will default Web Reference as dynamic.
     And therefore, there will be a App.Config file with
       http://localhost:1056/WebService1/Service1.asmx as one property
     And there is another file Settings.setting repeat the same information.

Step4. Write a function for the class to return URL of the WebService Proxy
    public string Test()
     {
        return  (new localhost.Service1()).Url; 
     }

Step5. Create a WAP and add Step3 DLL as Reference.
Step6 Add a Label to default.aspx in the WAP and code as in
        proected void Page_Load(..)
        {
          this.Label1.Text=(new ClassLibrary1.Class1()).Test();
        }

Step7. Browser Default.aspx (do not run debug) and you should see
         http://localhost:1056/WebService1/Service1.asmx

Step8  Change App.Config, Web.Config, Settings.settings in all places using notepad to
         http://localhost:7777/WebService1/Service1.asmx

Step9. Refresh the browser showing default.aspx and you will NOT see the changes made.

Note: the same happens when WAP is published, where only Web.Config can be changed.


Partial Copy from ILDasm:
  .custom instance void [System]System.Configuration.DefaultSettingValueAttribute::.
    ctor(string) = ( 01 00 1E 68 74 74 70 3A 2F 2F 6C 6F 63 61 6C 68   // ...http://localh
                  6F 73 74 2F 53 65 72 76 69 63 65 31 2E 61 73 6D   // ost/Service1.asm
                  78 00 00 )                                        // x..


 

jamesqding
Asp.Net User
Re: Should WAP avoid facade Design Pattern when calling WebServices ?4/27/2006 3:04:46 AM

0/0

Hi, Everyone,

I found out that if I copied the content in app.config to web.config, I can re-target WebServices Endpoint without recompile.

This is the same as in vs.Net 2003, except the following:

   (1) appSetting is used in VS.Net 2003

   (2) Global.[Your DLL Project].My.MySettings.Default.[WS Proxy Url setting name]

          is used in VS.Net 2005 and we need to define multiple configSection for each DLL.

Hope this closes this post  Thank you for reading.

James

BradleyB
Asp.Net User
Re: Should WAP avoid facade Design Pattern when calling WebServices ?5/4/2006 7:26:15 PM

0/0

This post may also help explain some of the differences between proxy generation in Web Application Projects and Web Site Projects.

http://weblogs.asp.net/bradleyb/archive/2006/05/04/445133.aspx

Hope it helps,
Brad.

jamesqding
Asp.Net User
Re: Should WAP avoid facade Design Pattern when calling WebServices ?5/5/2006 6:23:31 PM

0/0

Hi, Bradley,

Thanks for your blog post, Your idea benefit our Facade pattern greatly. I will convince our team to use a shared DLL project during migration using WAP.

We still develop using "Software build" process where everything are packaged and replaced (vs. incremental, de-coupled upgrade). So have a shared DLL project containing Web Reference, Utility Function and constants is very appealling.

James

4 Items, 1 Pages 1 |< << Go >> >|


Free Download:


Web:
Should WAP avoid facade Design Pattern when calling WebServices ... Should WAP avoid facade Design Pattern when calling WebServices ? Rate It (1). Last post 05-05-2006 2:23 PM by jamesqding. 3 replies. Sort Posts: ...
Take control with the Proxy design pattern The proxy forwards that method call to the Web service, .... Design Pattern Facade Design Pattern Flyweight Design Pattern Proxy Design...; Factory Design ...
CodeProject: Use of design patterns in Web projects to decouple ... Facade Pattern: Facade is an object oriented design pattern; essentially, .... by use of design patterns should encourage more use of such patterns in ...
ng.asp-net-forum.vs_2005_web_application_projects/20 - error ... Should WAP avoid facade Design Pattern when calling WebServices ? 3, 9, 5/5/2006 6:23:31 PM. Problems after converting from Web Site to Web Application ...
Design Pattern in .NET 101 - Facade Pattern (Structural Pattern ... Jan 10, 2008 ... Facade Pattern provides a unified interface to a set of interfaces in a .... NET : Detect Incoming Call or SMS in Windows Mobile Phone ...
CodeProject: Manage ASP.NET Session variables using the Facade ... Dec 13, 2006 ... We can avoid this kind of bug by using constants: .... An additional benefit of the facade design pattern is that it hides the internal ...
How Web to Mobile Transcoding Should Work | Wap Review Mar 23, 2008 ... You should be thanking the developer community for showing the industry the way, and what's your reaction? you call the manifesto ...
A Web Services Framework for Mobile Payment Services façade interface to any framework implementation of a payment system. This integration. of Web Services technologies and framework design patterns explores ...
CodeProject: Software Architecture Interview Questions part 4 ... Aug 6, 2008 ... Part 1 Design pattern interview questions SoftArchInter1.aspx .... The advantages of using proxy are security and avoiding duplicating ...
HotScripts.com :: ASP.NET :: Computer Scripts & Applications ... You can be the FIRST one to write a review for Design Patterns Tutorial. ... Google on your WAP phone using Java Server Pages ...




Search This Site:










can't change module container on site (dnn 4.0)

lntranet only website?

launching the dotnetnuke directory – a useful tool for finding the dnn information you want

aspnet_membership_getuserbyname - number of calls to db

asp.net error???

installing dotnetnuke, please help :o(

master page and unique images for sub-sites. relative imageurl?

blowery compression and dnn 4

page is not shown correctly in netscape

dropdown list is empty after a postback

compiling 3.1

sorting rows in dataset...

change site map provider at runtime

cannot create a new user?

shopping cart, how to create a subtotal

moving dnn3 to different folder

download ie web control, but no dll seen, doesn't work on my page

question about codeline

forms authentication - timeout redirect

width of the <asp:login> component

excluding app_data from visual sourcesafe

how to interact between webpart and manage events in moss 2007 ?

configure required fields

when trying to use filemanager from the admin i get teh error message below

modified dnn jungle codesmith templates (vb only)

sharing user information with iframe applications

security confegration in asp.net 2.0 & sqlserver 2005 enterprise

asp.net and registry

i'm confused

anyone pls help out with my project which is due in one week time thank.. using asp.net

 
All Times Are GMT