Best Practice for .Net Web Service access to a Web Service on a Test and Production Servers

Hello All,

What is the best way to control a .Net web service to be
able to access a remote server for testing and then point to
another remote server to access the web service in
production?  Do I need to generate and maintain 2 different
proxy objects?

TIA,

Bob
-1
Bob
9/1/2010 1:52:41 PM
sybase.powerbuilder.net 284 articles. 0 followers. Follow

6 Replies
1529 Views

Similar Articles

[PageSpeed] 27

Bob

//  first create the proxy
if not isvalid( i_service) then
	i_service = create 
fundtraderproxy_TradeServicesClient_BasicHttpBinding_ITradeServices

end if

///You'll see code something like this in the constructor of your proxy

//dynamically set the endpoint url with the user supplied value - 
//replace the one hardcoded in the proxy by the code generator

	PBWCF.WCFEndpointAddress d_endpoint
	d_endpoint = create PBWCF.WCFEndpointAddress
	d_endpoint.URL = as_url
	
	i_service.wcfConnectionObject.EndpointAddress = d_endpoint

---------
//If you are using WS DataWindow objects - use the WSConnection class
if not isvalid (i_wsconn) then
	i_wsconn = create wsconnection
end if
i_wsconn.endpoint =  as_url
//dynamically set the endpoint for the ws dwos

HTH

Yakov

On 9/1/2010 9:52 AM, Bob O. wrote:
> Hello All,
>
> What is the best way to control a .Net web service to be
> able to access a remote server for testing and then point to
> another remote server to access the web service in
> production?  Do I need to generate and maintain 2 different
> proxy objects?
>
> TIA,
>
> Bob

1
Yakov
9/1/2010 2:05:31 PM
What version of PowerBuilder are you using? If you are using
PowerBuilder 12 is it PowerBuilder .NET or Classic? 

Regards,
Dave Fish
Sybase

PowerBuilder Blog:
http://blogs.sybase.com/powerbuilder/

On 1 Sep 2010 06:52:41 -0700, Bob O. wrote:

>Hello All,
>
>What is the best way to control a .Net web service to be
>able to access a remote server for testing and then point to
>another remote server to access the web service in
>production?  Do I need to generate and maintain 2 different
>proxy objects?
>
>TIA,
>
>Bob
1
Dave
9/1/2010 3:05:09 PM
Dave,

I am using PowerBuilder 11.2 (Because I need to maintain JSP
targets at this time).  I am using the .Net WS engine and
not the EASYSOAP engine.

Bob

> What version of PowerBuilder are you using? If you are
> using PowerBuilder 12 is it PowerBuilder .NET or Classic?
>
> Regards,
> Dave Fish
> Sybase
>
> PowerBuilder Blog:
> http://blogs.sybase.com/powerbuilder/
>
> On 1 Sep 2010 06:52:41 -0700, Bob O. wrote:
>
> >Hello All,
> >
> >What is the best way to control a .Net web service to be
> >able to access a remote server for testing and then point
> to >another remote server to access the web service in
> >production?  Do I need to generate and maintain 2
> different >proxy objects?
> >
> >TIA,
> >
> >Bob
0
Bob
9/1/2010 5:21:41 PM
OK. Yakov's response is for the WCF client in PowerBuilder .NET, but
you need to use the PortName argument on the SoapConnection's
CreateInstance method to change the endpoint of your webservice. Look
up SoapConnection in the Help file and click on the CreateInstance
hyperlink to find a code example of what you need to do. 

Regards,
Dave Fish
Sybase

PowerBuilder Blog:
http://blogs.sybase.com/powerbuilder/


On 1 Sep 2010 10:21:41 -0700, Bob O. wrote:

>Dave,
>
>I am using PowerBuilder 11.2 (Because I need to maintain JSP
>targets at this time).  I am using the .Net WS engine and
>not the EASYSOAP engine.
>
>Bob
>
>> What version of PowerBuilder are you using? If you are
>> using PowerBuilder 12 is it PowerBuilder .NET or Classic?
>>
>> Regards,
>> Dave Fish
>> Sybase
>>
>> PowerBuilder Blog:
>> http://blogs.sybase.com/powerbuilder/
>>
>> On 1 Sep 2010 06:52:41 -0700, Bob O. wrote:
>>
>> >Hello All,
>> >
>> >What is the best way to control a .Net web service to be
>> >able to access a remote server for testing and then point
>> to >another remote server to access the web service in
>> >production?  Do I need to generate and maintain 2
>> different >proxy objects?
>> >
>> >TIA,
>> >
>> >Bob
0
Dave
9/1/2010 5:54:09 PM
Thanks Dave for asking the all important version question

Here's the same algorithm from 12.0 Classic (I imagine *hope* it's the 
same in 11.2)

if not isvalid( i_conn) then i_conn = create soapconnection	

//Classic only
//set the same server endpoint for use by datawindows
if not isvalid (i_wsconn) then 	i_wsconn = create wsconnection
i_wsconn.endpoint =  as_url

// in Classic we do the CreateInstance to get a proxy reference using 
the passed URL
int retcode
retcode=i_conn.createinstance(i_service,"tradeserviceasmx",as_url)
//specify the runtime URL (3rd parameter)

if retcode <> 0 then   ......



On 9/1/2010 1:21 PM, Bob O. wrote:
> Dave,
>
> I am using PowerBuilder 11.2 (Because I need to maintain JSP
> targets at this time).  I am using the .Net WS engine and
> not the EASYSOAP engine.
>
> Bob
>
>> What version of PowerBuilder are you using? If you are
>> using PowerBuilder 12 is it PowerBuilder .NET or Classic?
>>
>> Regards,
>> Dave Fish
>> Sybase
>>
>> PowerBuilder Blog:
>> http://blogs.sybase.com/powerbuilder/
>>
>> On 1 Sep 2010 06:52:41 -0700, Bob O. wrote:
>>
>>> Hello All,
>>>
>>> What is the best way to control a .Net web service to be
>>> able to access a remote server for testing and then point
>> to>another remote server to access the web service in
>>> production?  Do I need to generate and maintain 2
>> different>proxy objects?
>>>
>>> TIA,
>>>
>>> Bob

0
Yakov
9/1/2010 6:41:32 PM
Thank you guys!  I mistakenly thought that assigning a
server endpoint on the CONNECTION Object only worked for web
services generated for the EASYSOAP engine.  I will try it.

Bob


> Thanks Dave for asking the all important version question
>
> Here's the same algorithm from 12.0 Classic (I imagine
> *hope* it's the  same in 11.2)
>
> if not isvalid( i_conn) then i_conn = create
> soapconnection
>
> //Classic only
> //set the same server endpoint for use by datawindows
> if not isvalid (i_wsconn) then     i_wsconn = create
> wsconnection i_wsconn.endpoint =  as_url
>
> // in Classic we do the CreateInstance to get a proxy
> reference using  the passed URL
> int retcode
> retcode=i_conn.createinstance(i_service,"tradeserviceasmx"
> ,as_url) //specify the runtime URL (3rd parameter)
>
> if retcode <> 0 then   ......
>
>
>
> On 9/1/2010 1:21 PM, Bob O. wrote:
> > Dave,
> >
> > I am using PowerBuilder 11.2 (Because I need to maintain
> > JSP targets at this time).  I am using the .Net WS
> > engine and not the EASYSOAP engine.
> >
> > Bob
> >
> >> What version of PowerBuilder are you using? If you are
> >> using PowerBuilder 12 is it PowerBuilder .NET or
> Classic? >>
> >> Regards,
> >> Dave Fish
> >> Sybase
> >>
> >> PowerBuilder Blog:
> >> http://blogs.sybase.com/powerbuilder/
> >>
> >> On 1 Sep 2010 06:52:41 -0700, Bob O. wrote:
> >>
> >>> Hello All,
> >>>
> >>> What is the best way to control a .Net web service to
> be >>> able to access a remote server for testing and then
> point >> to>another remote server to access the web
> service in >>> production?  Do I need to generate and
> maintain 2 >> different>proxy objects?
> >>>
> >>> TIA,
> >>>
> >>> Bob
>
0
Bob
9/1/2010 8:13:15 PM
Reply:

Similar Artilces:

How to call web service from asp.net application if web service is on web hosting server
Hi! my question is that how to call web service from asp.net if web service is present on web hosting srver....  Actually i created a web service and configure it in IIS and then call it from other asp.net application it works fine but when i copy that web service to web hosting server and call it from asp.net application it gives the following error Server Error in '/' Application. Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modif...

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services.
I get that msg. Try several things, but not working yet!! help please http://support.microsoft.com/default.aspx?scid=kb;en-us;817267 <- Jase -> Try opening the Visual Studio .NET command prompt (Start > Programs > VS.NET > Toosl > VS.NET Command Prompt) and typing in: aspnet_regiis -i To install ASP.NET with IIS.Stanley Tan theSpoke Blog...

Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services. #2
I am getting the following error when I try to open a project. Please help me.  Visual Studio .NET has detected that the specified Web server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services. Thanks in advance, Prabaavaty      go to ur frameworx pathC:\Windows\Microsoft.NET\Framework\v[ur version here]  and type in aspnet_regiis -ithen try again If this post was useful to you, please mark it as correct answer. Thank you!no problem should ever be solved twice.net wand Hi Prabaavaty, Based on my und...

Noob ASP.NET/Web Services question (Moved from ASP.NET AJAX web services forum)
I'm connecting a ASP.NET project to a web service.  The web service was accessed on port 83, but when I added the web reference in Visual Studio 2008, it couldn't query the service and discover its interface.I switched the web service over to port 80 and it worked perfectly.  Do you know what's going on?  Has anyone experienced the same issue? Hello Cody, This really relates to the runtime setup of your projects.  When you are creating ASP.Net projects, Visual Studio runs the web apps/servers within Cassini.  Cassini is an internal web server to Visua...

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

Urgent
Hi All,   I have seen a number of posts regarding this error message and unfortunately none of the suggestions work for me. I am developing on WinXp Pro SP3 and have had VS Studio .Net 2003, Version 7.1.3088 with the .NET Framework Version 1.1.4322 SP 1 and VS Studio 2005 Version 8.0.50727.762 SP .050727-7600 with the .NET Framework Version 2.0.50727 SP1 on my development machine. Everything was working fine until recently. Certain errors that were happening on a server could not be reproduced on my development machine so I registered with DynDNS and created a dynamic dns that p...

web service hosted on same web server from ASP.NET Ajax web site
Hi,    We have create an ASP.NET AJAX enabled website and an another web service. Both were hosted on same server but have two different virtual directory. I have specified the 'Path' attribute of '<ServiceReference>' element of ScriptManager as 'http://localhost/virDirectory/myWS.asmx" (Absolute path). But when I run the ASP.NET application I am getting error. Same code worked when i moved asmx page to the asp.net application folder and point 'Path' attribute of Script Manager to relative one like Path="myWS.asmx". I have also ...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

Accessing IIS server's web services using asp.net and vb.net ...... READ INSIDE
  Hi everyone I am trying to develop an asp.net and vb.net web application. I am wondering that how my application will check that web services provided by the iis server is working ok. I am actually trying to access the www, ftp and smtp services offered by the iis server. And to see that if they are working ok. I am wondering that how do i access the iis server using my asp.net application or webpage. And thus after accessing this, how do i access the web services offered by iis server. Any hint guys. Hi sb_harp, Based on my understanding, you want to consume a web service in...

Visual Studio has detected that the specified Web Server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services
Hi All, First post, be gentle :) I'm trying to create an ASP.NET web application, but when I create a new project I get the following error. "Visual Studio has detected that the specified Web Server is not running ASP.NET version 1.1. You will be unable to run ASP.NET Web applications or services" I have googled and found the following answer. I install ASP.NET again: C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322>aspnet_regiis.exe -i Start installing ASP.NET (1.1.4322.0). Finished installing ASP.NET (1.1.4322.0). but I still get the same error. when I open a bro...

is it important that i need a web service for my ASP.NET Web Service?
HI is it important that i need a web service for my ASP.NET Web Service? Can u say what a web service is and what is the use of Web Service?Binu Mathew Wikipedia has a good description: http://en.wikipedia.org/wiki/Web_serviceSteve Wellens My blog Can you gave me any other information,and the neednees of webservice in my program?Binu Mathew Please detailed you question. What is "your program" and what you want to do with web services?...

ASP.NET Web Service VS XML Web Service
Folks Can you tell me the difference beween ASP.NET Web Service and XML Web Service. How to create XML Web Service using Visual Studio as I know only to create ASP.NET Web Service using Visual Studio (vide Code Snippet).   Code Snippet: using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Linq;namespace WebService1 { /// <summary> /// Summary description for Service1 /// </summary>[WebService(Namespac...

.NET CLIENT TO ACCESS a non. NET WEB SERVICE
I develop in .net and need to create a web client to connect to a web service built in Java. http://xchainj.com:8080/axis/services/ScsEnvirodatWaterQualityIndexServiceSoap Its pretty easy when the web service was also built in .net. You can just create a web reference with the gui and automatically can see its functions and stuff. when i put this url in the box and hit go i dont get to see its functions. maybe this shouldnt be the url of the WSDL?? I Have no idea. Im very new to all of this. If there are any examples of .net clients connecting to non .net web clients it woul...

Web resources about - Best Practice for .Net Web Service access to a Web Service on a Test and Production Servers - sybase.powerbuilder.net

Video production - Wikipedia, the free encyclopedia
Video production is videography , the process of capturing moving images on electronic media (e.g., video tape , direct to disk recording , or ...

Quanta reportedly starting trial Apple Watch 2 production later this month
The Chinese technology media site Commercial Times is claiming that Quanta will begin initial production runs of Apple Watch 2 in January, later ...

Samsung Announces 14LPP Mass Production
Today Samsung Semiconductors officialy announces mass production for its second generation 14nm FinFET manufacturing node. Early last year we ...

Production 2017 Lincoln Continental arrives with 400-hp V6
Filed under: 2016 Detroit Auto Show , Lincoln , Sedan , Luxury Lincoln's not divulging everything about the production 2017 Continental, but ...

Industrial Production Numbers and Revisions Shockingly Bad; Autos Have Peaked
Not only was December industrial production an awful -0.4%, November was revised lower from -0.6% to -0.9%. Not to fear, economists blame the ...

Fed: Industrial Production decreased 0.4% in December
From the Fed: Industrial production and Capacity Utilization Industrial production declined 0.4 percent in December, primarily as a result of ...

Elon Musk: “Every year, we are doubling our total cumulative production.”
... of you already know. He was also practically forced to say that [&hellip Elon Musk: “Every year, we are doubling our total cumulative production.” ...

Apple Watch 2 going into trial production this month
Quanta is reportedly set to enter trial production of the Apple Watch 2 by the end of this month — prior to a likely launch for the sequel wearable ...

Kenneth Halsband, Physical Production Exec, Promoted to COO of Relativity
BREAKING: Kenneth Halsband , who has long been President of physical and post production at Relativity Studios, will now take on additional responsibilities ...

'Fifty Shades Darker' Spoilers: Production For 'FSOG' Sequel To Begin On February 15
Here are some updates from the upcoming movie "Fifty Shades Darker." The production for "Fifty Shades of Grey" sequel " Fifty Shades Darker " ...

Resources last updated: 1/16/2016 10:45:47 PM