wcf - Standards for accessing Webservice in C# -


i wanted know standard way of accessing web-services in c# webservice reference can defined programmatically.

i have following scenario :

  1. multiple webservices can set programmatically. hence cannot use "add webservice reference" provided visual studio (or think correct me if wrong).
  2. the webservices added have same structure/actions/operations/request/responses may have belong different domains feeding different data.

e.g :

  webservice 01 :  http://abc.example.com/getdata   webservice 02 :  http://xyz.example.net/getdata 
  1. can still use proxy generated 1 service , use or have handle raw xml responses?

edit 01 : wanted know if following snippet of accessing webservice can generalized used webservices

        var binding = new basichttpbinding();         var address = new endpointaddress("http://www.abc.com/service.asmx");         var factory = new channelfactory<igeneralproxy>(binding, address);          var obj = factory.createchannel();         var responsestring = obj.getdata("username", "password");         assert.isnotnull(responsestring); 

where igeneralproxy interface client

please let me know if if of above points not clear.

yes, can use same generated proxy both services long service same. time.

here snipit of code. use wse 3.0 project working on .net 2.0.

servicewse serivce = new servicewse(); cookiecontainer cookiecontainer = new cookiecontainer(); serivce.timeout = 1000 * 60 * commonfunctions.getconfigvalue<int>(consts.common.webservicetimeout, 20); serivce.url = commonfunctions.getconfigvalue(consts.urls.myservicesecuredurl, string.empty); serivce.cookiecontainer = cookiecontainer; if (commonfunctions.getconfigvalue(consts.security.usesecuredservices, false))     commonfunctions.setwssecurity(_service.requestsoapcontext); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -