Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Procedure using Webservice

7 posts in General Discussion Last posting was on 2009-06-17 19:36:08.0Z
Martin Schmeling Posted on 2009-06-11 08:53:37.0Z
Sender: 5e38.4a30c35f.1804289383@sybase.com
From: Martin Schmeling
Newsgroups: ianywhere.public.general
Subject: Procedure using Webservice
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a30c611.5e65.1681692777@sybase.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 11 Jun 2009 01:53:37 -0700
X-Trace: forums-1-dub 1244710417 10.22.241.41 (11 Jun 2009 01:53:37 -0700)
X-Original-Trace: 11 Jun 2009 01:53:37 -0700, 10.22.241.41
Lines: 14
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7608
Article PK: 6003

Hello !
I am trying to query data from a webservide using a
procedure. That works fine, but in an envirinment with a
Proxy server it doesn´t work. The Proxyservers often
require authorisation.

I tried to add <<proxy 'http://USER:PASS@PROXY:PORT'>>, but
it didn´t help. I tried using a local proxy server to test
and it seems as if the proxy-clause is totally ignored.

What is going wrong ?

Martin Schmeling, B.Sc.
Kiel, Germany


Jeff Albion [Sybase iAnywhere] Posted on 2009-06-11 12:00:42.0Z
From: "Jeff Albion [Sybase iAnywhere]" <firstname.lastname@ianywhere.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Procedure using Webservice
References: <4a30c611.5e65.1681692777@sybase.com>
In-Reply-To: <4a30c611.5e65.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a30f1ea$1@forums-1-dub>
Date: 11 Jun 2009 05:00:42 -0700
X-Trace: forums-1-dub 1244721642 10.22.241.152 (11 Jun 2009 05:00:42 -0700)
X-Original-Trace: 11 Jun 2009 05:00:42 -0700, vip152.sybase.com
Lines: 28
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7612
Article PK: 6005

Martin,

Please post the text of the stored procedure you're attempting to use,
and the version and build of the product you're using (e.g. dbsrv11 -v).

Regards,

Martin Schmeling wrote:
> I am trying to query data from a webservide using a
> procedure. That works fine, but in an envirinment with a
> Proxy server it doesn´t work. The Proxyservers often
> require authorisation.
>
> I tried to add <<proxy 'http://USER:PASS@PROXY:PORT'>>, but
> it didn´t help. I tried using a local proxy server to test
> and it seems as if the proxy-clause is totally ignored.
>
> What is going wrong ?

--
Jeff Albion, Sybase iAnywhere

iAnywhere Developer Community :
http://www.sybase.com/developer/library/sql-anywhere-techcorner
iAnywhere Documentation : http://www.ianywhere.com/developer/product_manuals
SQL Anywhere Patches and EBFs :
http://downloads.sybase.com/swd/summary.do?baseprod=144&client=ianywhere&timeframe=0
Report a Bug/Open a Case : http://case-express.sybase.com/cx/


Viktor Kiss Posted on 2009-06-12 20:26:11.0Z
From: Viktor Kiss <vkiss@sybase.com>
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Procedure using Webservice
References: <4a30c611.5e65.1681692777@sybase.com> <4a30f1ea$1@forums-1-dub>
In-Reply-To: <4a30f1ea$1@forums-1-dub>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a32b9e3$1@forums-1-dub>
Date: 12 Jun 2009 13:26:11 -0700
X-Trace: forums-1-dub 1244838371 10.22.241.152 (12 Jun 2009 13:26:11 -0700)
X-Original-Trace: 12 Jun 2009 13:26:11 -0700, vip152.sybase.com
Lines: 36
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7617
Article PK: 6011


Jeff Albion [Sybase iAnywhere] wrote:
> Martin,
>
> Please post the text of the stored procedure you're attempting to use,
> and the version and build of the product you're using (e.g. dbsrv11 -v).
>
> Regards,
>
> Martin Schmeling wrote:
>> I am trying to query data from a webservide using a
>> procedure. That works fine, but in an envirinment with a
>> Proxy server it doesn´t work. The Proxyservers often
>> require authorisation.
>>
>> I tried to add <<proxy 'http://USER:PASS@PROXY:PORT'>>, but
>> it didn´t help. I tried using a local proxy server to test
>> and it seems as if the proxy-clause is totally ignored.
>>
>> What is going wrong ?
>

Martin,

Currently, HTTP procedures do not implicitly support Proxy
Authorization. You may be able to work around the issue using the
HEADER clause, i.e.:
HEADER 'Proxy-Authorization: Basic dXNlcjpwd2Q='
where I used, BASE64_ENCODE('usr:pwd'); to generate 'dXNlcjpwd2Q='.

For increased maintainability/readability you could pass the encoded
string using parameter substitution (such that the caller generates the
authorization string and passes it as a parameter for use within the
HEADER clause)

Regards,

Viktor


Martin Schmeling Posted on 2009-06-15 11:28:57.0Z
Sender: 1d9a.4a362e19.1804289383@sybase.com
From: Martin Schmeling
Newsgroups: ianywhere.public.general
Subject: Re: Procedure using Webservice
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a363079.1dd4.1681692777@sybase.com>
References: <4a32b9e3$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 15 Jun 2009 04:28:57 -0700
X-Trace: forums-1-dub 1245065337 10.22.241.41 (15 Jun 2009 04:28:57 -0700)
X-Original-Trace: 15 Jun 2009 04:28:57 -0700, 10.22.241.41
Lines: 60
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7618
Article PK: 6012

Hello !
I am using iAnywhere 10 and still cannot use the proxy. I
tried using the header-clause, but the only thing I get is a
timeout.

My Procedure looks like this:

CREATE PROCEDURE UPD_Login(in Li char(100),in LiN
char(100),in SN char(100),in M char(100),in IT long varchar)
returns char(40) url
'http://xxx.xxx.xxx.228/testmas/Update/Update.asmx' header
'Proxy-Authorization: Basic dXNlcjpwd2Q='
type 'SOAP:DOC' namespace 'http://www.xyz.de'
proxy 'http://127.0.0.1:3128'

The Proxy does not even notify to be connected.

Martin Schmeling,
Kiel, Germany

> Jeff Albion [Sybase iAnywhere] wrote:
> > Martin,
> >
> > Please post the text of the stored procedure you're
> > attempting to use, and the version and build of the
> > product you're using (e.g. dbsrv11 -v).
> > Regards,
> >
> > Martin Schmeling wrote:
> >> I am trying to query data from a webservide using a
> >> procedure. That works fine, but in an envirinment with
> a >> Proxy server it doesn´t work. The Proxyservers
often
> >> require authorisation.
> >>
> >> I tried to add <<proxy 'http://USER:PASS@PROXY:PORT'>>,
> but >> it didn´t help. I tried using a local proxy
server
> to test >> and it seems as if the proxy-clause is totally
> ignored. >>
> >> What is going wrong ?
> >
> Martin,
>
> Currently, HTTP procedures do not implicitly support Proxy
> Authorization. You may be able to work around the issue
> using the HEADER clause, i.e.:
> HEADER 'Proxy-Authorization: Basic dXNlcjpwd2Q='
> where I used, BASE64_ENCODE('usr:pwd'); to generate
> 'dXNlcjpwd2Q='.
>
> For increased maintainability/readability you could pass
> the encoded string using parameter substitution (such
> that the caller generates the authorization string and
> passes it as a parameter for use within the HEADER
> clause)
>
> Regards,
>
> Viktor


Viktor Kiss Posted on 2009-06-15 13:41:00.0Z
From: Viktor Kiss <vkiss@sybase.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Procedure using Webservice
References: <4a32b9e3$1@forums-1-dub> <4a363079.1dd4.1681692777@sybase.com>
In-Reply-To: <4a363079.1dd4.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a364f6c$1@forums-1-dub>
Date: 15 Jun 2009 06:41:00 -0700
X-Trace: forums-1-dub 1245073260 10.22.241.152 (15 Jun 2009 06:41:00 -0700)
X-Original-Trace: 15 Jun 2009 06:41:00 -0700, vip152.sybase.com
Lines: 74
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7620
Article PK: 6014


Martin Schmeling wrote:
> Hello !
> I am using iAnywhere 10 and still cannot use the proxy. I
> tried using the header-clause, but the only thing I get is a
> timeout.
>
> My Procedure looks like this:
>
> CREATE PROCEDURE UPD_Login(in Li char(100),in LiN
> char(100),in SN char(100),in M char(100),in IT long varchar)
> returns char(40) url
> 'http://xxx.xxx.xxx.228/testmas/Update/Update.asmx' header
> 'Proxy-Authorization: Basic dXNlcjpwd2Q='
> type 'SOAP:DOC' namespace 'http://www.xyz.de'
> proxy 'http://127.0.0.1:3128'
>
> The Proxy does not even notify to be connected.
>
> Martin Schmeling,
> Kiel, Germany
>
>> Jeff Albion [Sybase iAnywhere] wrote:
>>> Martin,
>>>
>>> Please post the text of the stored procedure you're
>>> attempting to use, and the version and build of the
>>> product you're using (e.g. dbsrv11 -v).
>>> Regards,
>>>
>>> Martin Schmeling wrote:
>>>> I am trying to query data from a webservide using a
>>>> procedure. That works fine, but in an envirinment with
>> a >> Proxy server it doesn´t work. The Proxyservers
> often
>>>> require authorisation.
>>>>
>>>> I tried to add <<proxy 'http://USER:PASS@PROXY:PORT'>>,
>> but >> it didn´t help. I tried using a local proxy
> server
>> to test >> and it seems as if the proxy-clause is totally
>> ignored. >>
>>>> What is going wrong ?
>> Martin,
>>
>> Currently, HTTP procedures do not implicitly support Proxy
>> Authorization. You may be able to work around the issue
>> using the HEADER clause, i.e.:
>> HEADER 'Proxy-Authorization: Basic dXNlcjpwd2Q='
>> where I used, BASE64_ENCODE('usr:pwd'); to generate
>> 'dXNlcjpwd2Q='.
>>
>> For increased maintainability/readability you could pass
>> the encoded string using parameter substitution (such
>> that the caller generates the authorization string and
>> passes it as a parameter for use within the HEADER
>> clause)
>>
>> Regards,
>>
>> Viktor

Martin,

I tried using the HTTP client proxy clause for version 10 - and it seems
to work as expected.

Try substituting the actual hostname instead of using 127.0.0.1. Also,
I couldn't help but notice that you have a RETURNS clause within your
stored procedure declaration, which is invalid syntax.

Thanks,

Viktor


Martin Schmeling Posted on 2009-06-17 08:37:59.0Z
Sender: 5bba.4a389563.1804289383@sybase.com
From: Martin Schmeling
Newsgroups: ianywhere.public.general
Subject: Re: Procedure using Webservice
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a38ab67.6bc7.1681692777@sybase.com>
References: <4a364f6c$1@forums-1-dub>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable
NNTP-Posting-Host: forums-3-dub.sybase.com
X-Original-NNTP-Posting-Host: forums-3-dub.sybase.com
Date: 17 Jun 2009 01:37:59 -0700
X-Trace: forums-3-dub.sybase.com 1245227879 10.22.241.188 (17 Jun 2009 01:37:59 -0700)
X-Original-Trace: 17 Jun 2009 01:37:59 -0700, forums-3-dub.sybase.com
Lines: 90
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7623
Article PK: 6019


> Martin Schmeling wrote:
> > Hello !
> > I am using iAnywhere 10 and still cannot use the proxy.
> > I tried using the header-clause, but the only thing I
> > get is a timeout.
> >
> > My Procedure looks like this:
> >
> > CREATE PROCEDURE UPD_Login(in Li char(100),in LiN
> > char(100),in SN char(100),in M char(100),in IT long
> > varchar) returns char(40) url
> > 'http://xxx.xxx.xxx.228/testmas/Update/Update.asmx'
> > header 'Proxy-Authorization: Basic dXNlcjpwd2Q='
> > type 'SOAP:DOC' namespace 'http://www.xyz.de'
> > proxy 'http://127.0.0.1:3128'
> >
> > The Proxy does not even notify to be connected.
> >
> > Martin Schmeling,
> > Kiel, Germany
> >
> >> Jeff Albion [Sybase iAnywhere] wrote:
> >>> Martin,
> >>>
> >>> Please post the text of the stored procedure you're
> >>> attempting to use, and the version and build of the
> >>> product you're using (e.g. dbsrv11 -v).
> >>> Regards,
> >>>
> >>> Martin Schmeling wrote:
> >>>> I am trying to query data from a webservide using a
> >>>> procedure. That works fine, but in an envirinment
> with >> a >> Proxy server it doesn�t work. The
> > Proxyservers often
> >>>> require authorisation.
> >>>>
> >>>> I tried to add <<proxy
> 'http://USER:PASS@PROXY:PORT'>>, >> but >> it
didn�t help.
> > I tried using a local proxy server
> >> to test >> and it seems as if the proxy-clause is
> totally >> ignored. >>
> >>>> What is going wrong ?
> >> Martin,
> >>
> >> Currently, HTTP procedures do not implicitly support
> Proxy >> Authorization. You may be able to work around
> the issue >> using the HEADER clause, i.e.:
> >> HEADER 'Proxy-Authorization: Basic dXNlcjpwd2Q='
> >> where I used, BASE64_ENCODE('usr:pwd'); to generate
> >> 'dXNlcjpwd2Q='.
> >>
> >> For increased maintainability/readability you could
> pass >> the encoded string using parameter substitution
> (such >> that the caller generates the authorization
> string and >> passes it as a parameter for use within the
> HEADER >> clause)
> >>
> >> Regards,
> >>
> >> Viktor
>
> Martin,
>
> I tried using the HTTP client proxy clause for version 10
> - and it seems to work as expected.
>
> Try substituting the actual hostname instead of using
> 127.0.0.1. Also, I couldn't help but notice that you
> have a RETURNS clause within your stored procedure
> declaration, which is invalid syntax.
>
> Thanks,
>
> Viktor
>

Hello !
Finally I got it to run. Maybe my Proxy-Testserver needed to
be restarted after so many tries.

Thanks to Viktor for the goot help !

There is one Question left: Is it possible to use the same
procedure in proxy and no-proxy environment ? An empty
proxy-clause doesn´t produce any result in a non-proxy
envireonment. I don´t want to exchange the procedure
when moving to another location.

Martin


Viktor Kiss Posted on 2009-06-17 19:36:08.0Z
From: Viktor Kiss <vkiss@sybase.com>
User-Agent: Thunderbird 2.0.0.21 (Windows/20090302)
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: Procedure using Webservice
References: <4a364f6c$1@forums-1-dub> <4a38ab67.6bc7.1681692777@sybase.com>
In-Reply-To: <4a38ab67.6bc7.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a3945a8$2@forums-3-dub.sybase.com>
Date: 17 Jun 2009 12:36:08 -0700
X-Trace: forums-3-dub.sybase.com 1245267368 10.22.241.152 (17 Jun 2009 12:36:08 -0700)
X-Original-Trace: 17 Jun 2009 12:36:08 -0700, vip152.sybase.com
Lines: 115
X-Authenticated-User: techsupp
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub ianywhere.public.general:7625
Article PK: 6016


Martin Schmeling wrote:
>> Martin Schmeling wrote:
>>> Hello !
>>> I am using iAnywhere 10 and still cannot use the proxy.
>>> I tried using the header-clause, but the only thing I
>>> get is a timeout.
>>>
>>> My Procedure looks like this:
>>>
>>> CREATE PROCEDURE UPD_Login(in Li char(100),in LiN
>>> char(100),in SN char(100),in M char(100),in IT long
>>> varchar) returns char(40) url
>>> 'http://xxx.xxx.xxx.228/testmas/Update/Update.asmx'
>>> header 'Proxy-Authorization: Basic dXNlcjpwd2Q='
>>> type 'SOAP:DOC' namespace 'http://www.xyz.de'
>>> proxy 'http://127.0.0.1:3128'
>>>
>>> The Proxy does not even notify to be connected.
>>>
>>> Martin Schmeling,
>>> Kiel, Germany
>>>
>>>> Jeff Albion [Sybase iAnywhere] wrote:
>>>>> Martin,
>>>>>
>>>>> Please post the text of the stored procedure you're
>>>>> attempting to use, and the version and build of the
>>>>> product you're using (e.g. dbsrv11 -v).
>>>>> Regards,
>>>>>
>>>>> Martin Schmeling wrote:
>>>>>> I am trying to query data from a webservide using a
>>>>>> procedure. That works fine, but in an envirinment
>> with >> a >> Proxy server it doesn�t work. The
>>> Proxyservers often
>>>>>> require authorisation.
>>>>>>
>>>>>> I tried to add <<proxy
>> 'http://USER:PASS@PROXY:PORT'>>, >> but >> it
> didn�t help.
>>> I tried using a local proxy server
>>>> to test >> and it seems as if the proxy-clause is
>> totally >> ignored. >>
>>>>>> What is going wrong ?
>>>> Martin,
>>>>
>>>> Currently, HTTP procedures do not implicitly support
>> Proxy >> Authorization. You may be able to work around
>> the issue >> using the HEADER clause, i.e.:
>>>> HEADER 'Proxy-Authorization: Basic dXNlcjpwd2Q='
>>>> where I used, BASE64_ENCODE('usr:pwd'); to generate
>>>> 'dXNlcjpwd2Q='.
>>>>
>>>> For increased maintainability/readability you could
>> pass >> the encoded string using parameter substitution
>> (such >> that the caller generates the authorization
>> string and >> passes it as a parameter for use within the
>> HEADER >> clause)
>>>> Regards,
>>>>
>>>> Viktor
>> Martin,
>>
>> I tried using the HTTP client proxy clause for version 10
>> - and it seems to work as expected.
>>
>> Try substituting the actual hostname instead of using
>> 127.0.0.1. Also, I couldn't help but notice that you
>> have a RETURNS clause within your stored procedure
>> declaration, which is invalid syntax.
>>
>> Thanks,
>>
>> Viktor
>>
>
> Hello !
> Finally I got it to run. Maybe my Proxy-Testserver needed to
> be restarted after so many tries.
>
> Thanks to Viktor for the goot help !
>
> There is one Question left: Is it possible to use the same
> procedure in proxy and no-proxy environment ? An empty
> proxy-clause doesn´t produce any result in a non-proxy
> envireonment. I don´t want to exchange the procedure
> when moving to another location.
>
> Martin

Hi Martin,

Glad you got it working!
Yes it is possible to use one client HTTP procedure. If the entire
value of a clause (i.e. PROXY or HEADER) is NULL, then the clause is
ignored and treated as if it does not exist. Here is an example:
call sa_make_object('procedure', 'cli_echo');
alter procedure cli_echo( str long varchar,
proxyhead long varchar,
proxyval long varchar )
url 'http://xxx/echo'
type 'http:get'
proxy '!proxyval'
header '!proxyhead';

// call that does not use proxy
call cli_echo('hello world', NULL, NULL);

// call that uses the proxy
call cli_echo('hello world', 'Proxy-Authorization: Basic
dXNlcjpwd2Q=', 'http://my_proxy_host:8080' );

Thanks,

Viktor