[ic] HTTP POSTing to another server from IC

Marc Brevoort marc.brevoort at armazemdedados.com
Fri Aug 22 09:52:31 EDT 2003

On Thu, 2003-08-21 at 18:54, Grant wrote:
> Thanks a lot for your help Marc.  I haven't delved into the XML parsing tag
> yet, but I'm trying to get posttourl.tag set up and it looks good to me but
> IC spits out an error after restarting with the tag in the UserTag folder.
> The error looks like this:
> Calling UI...UserTag 'posttourl' code is not a subroutine reference
> In line 34 of the configuration file
> '/trippystore/ic493/code/UserTag/posttourl.tag':

Okay, a few comments.

John R's suggestion (letting perl take a look at the code) sounds like a
good plan. I find this often helps me tracking errors that Interchange
doesn't specify. I tried to add your version of the tag here, and here
IC restarts without complaints, so most likely its a config issue (I
also checked the IC error.log files, nothing there)

An issue in runtime rather than syntactical, the filenames xxx.pem and
xxx.key in this case are the files containing SSL certificate and key,
if you don't have these files I suppose you can just comment these
lines. Getting SSL to work is, unfortunately, a topic in itself. For
restarting IC this shouldn't be an issue though.

Make sure you have all required perl packages. All of them are available
from www.cpan.org, usually compiling them is a matter of running

perl Makefile.PL
make test
make install

> and here's the code I plan to call it with as well:
> [perl]
>         $url="https://the.url";
>         $params="<?xml version='1.0' encoding='iso-8859-1'?>
>    	<request>
>    	<RequestUserId>userID</RequestUserId>
>    	<RequestPassword>pword</RequestPassword>
>    	<ErrorLevel>1</ErrorLevel>
>    	<DetailLevel>0</DetailLevel>
>    	<Verb>APICall</Verb>
>    	</request>";
>         $apicall="APICall";
>         my $to_eval="[posttourl $url $params $apicall]";
>         return $to_eval;
> [/perl]

Hm, I never posted an xml block before, but the code above outputs
something like 

[posttourl https://the.url <?xml version='1.0' encoding='iso-8859-1'?>
    	</request> APICall]

If this gives problems (because of newlines and spaces), you might try
quoting the xml and/or using named parameters in favor of positional

Anything else, just shout :)

e-mail:	marc.brevoort at armazemdedados.com
web:	http://www.armazemdedados.com

Armazem de Dados, Informatica, Lda
Dep. Desenvolvimento
Tel. +351 21 910 83 10 / Fax. +351- 21 910 83 19

More information about the interchange-users mailing list