OpenEdge.Net - Possible bug?

Posted by tbergman on 29-May-2015 16:20

I've been checking out the classes provided with 11.5 SP1 for HTTP requests. I seem to be stuck with an off error when trying to urlencode a string. Now I'm not sure I'm doing this right but when I execute the code below, I get the error "Only "Character" is a valid type option for a LONGCHAR variable (11673).

What am I doing wrong?

USING OpenEdge.Net.*.
def var address as char.
Address = "Some Test Address".
Address = URI:Encode(Address, UriEncodingTypeEnum:Query)	.
MESSAGE Address
VIEW-AS ALERT-BOX.


All Replies

Posted by Roger Blanchard on 29-May-2015 16:32

Tom, does address need to be defined as a longchar? 

Roger Blanchard
Sent from my mobile device

On May 29, 2015, at 5:22 PM, tbergman <bounce-tbergman@community.progress.com> wrote:

Thread created by tbergman

I've been checking out the classes provided with 11.5 SP1 for HTTP requests. I seem to be stuck with an off error when trying to urlencode a string. Now I'm not sure I'm doing this right but when I execute the code below, I get the error "Only "Character" is a valid type option for a LONGCHAR variable (11673).

What am I doing wrong?

USING OpenEdge.Net.*.
def var address as char.
Address = "Some Test Address".
Address = URI:Encode(Address, UriEncodingTypeEnum:Query)	.
MESSAGE Address
VIEW-AS ALERT-BOX.


Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by tbergman on 29-May-2015 16:38

Hi Roger,

No, defining it as a longchar won't even compile as it's not a proper data type for the first parameter of the encode method.

Posted by Roger Blanchard on 29-May-2015 16:53

I think I had a similar issue recently...just can't remember. I think it was with push notifications which also uses the OpenEdge.net 

When I get home I will check.

Roger Blanchard
Sent from my mobile device

On May 29, 2015, at 5:41 PM, tbergman <bounce-tbergman@community.progress.com> wrote:

Reply by tbergman

Hi Roger,

No, defining it as a longchar won't even compile as it's not a proper data type for the first parameter of the encode method.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Posted by Peter Judge on 31-May-2015 12:07

This is a AVM bug in the URL encode code (I logged it as PSC00333253 - hex-encode() acts like it returns longchar , if you want to add your name to it).
 
Basically the fix is to change the OpenEdge.Net.URI class at around line 434 to
 
                /* Replace character with %hh hexidecimal triplet */
                substring(pcString, iLoop, 1, "RAW":U) = substitute('%&1', hex-encode(rChar)). 
instead of
                substring(pcString, iLoop, 1, "RAW":U) = '%' + hex-encode(rChar). 
 
-- peter
 
[collapse]
From: tbergman [mailto:bounce-tbergman@community.progress.com]
Sent: Friday, 29 May, 2015 17:21
To: TU.OE.Development@community.progress.com
Subject: [Technical Users - OE Development] OpenEdge.Net - Possible bug?
 
Thread created by tbergman

I've been checking out the classes provided with 11.5 SP1 for HTTP requests. I seem to be stuck with an off error when trying to urlencode a string. Now I'm not sure I'm doing this right but when I execute the code below, I get the error "Only "Character" is a valid type option for a LONGCHAR variable (11673).

What am I doing wrong?

USING OpenEdge.Net.*.
def var address as char.
Address = "Some Test Address".
Address = URI:Encode(Address, UriEncodingTypeEnum:Query)    .
MESSAGE Address
VIEW-AS ALERT-BOX.

 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by tbergman on 01-Jun-2015 07:32

Hi Peter,

 

Thanks, that does make the method work without the error message.

 

It still has a bug. Passing a string with more than 3 words, results in the last space not being encoded.

 

The result from “14 Oak Bedford ma” is “14%20Oak%20Bedford ma”.

 

Thanks,

 

Tom

USING OpenEdge.Net.*.
def var address as char.
Address = "14 Oak Bedford ma".
Address = URI:Encode(Address, UriEncodingTypeEnum:Default)	.
MESSAGE Address
VIEW-AS ALERT-BOX.


Posted by Peter Judge on 01-Jun-2015 07:54

Hey Tom,
 
Please log that 3-word bug.
 
-- peter
 
[collapse]
From: tbergman [mailto:bounce-tbergman@community.progress.com]
Sent: Monday, 01 June, 2015 08:33
To: TU.OE.Development@community.progress.com
Subject: RE: [Technical Users - OE Development] OpenEdge.Net - Possible bug?
 
Reply by tbergman

Hi Peter,

 

Thanks, that does make the method work without the error message.

 

It still has a bug. Passing a string with more than 3 words, results in the last space not being encoded.

 

The result from “14 Oak Bedford ma” is “14%20Oak%20Bedford ma”.

 

Thanks,

 

Tom

USING OpenEdge.Net.*.
def var address as char.
Address = "14 Oak Bedford ma".
Address = URI:Encode(Address, UriEncodingTypeEnum:Default)  .
MESSAGE Address
VIEW-AS ALERT-BOX.

 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Brian K. Maher on 15-Jun-2015 14:37

Hi Folks,

I have logged bug number PSC00334668 for this issue.

Sincerely, Brian Maher

This thread is closed