[ic] Using Interchange as a SOAP server - order/process

Mike Heins mike at perusion.com
Thu Apr 14 10:01:59 EDT 2005


Quoting Dr. Michael Streubel (michael.streubel at ibizplanet.com):
> 
> 
> Chris Sendall wrote:
> 
> >I can successfully log on to the SOAP server provided by Interchange and I 
> >am
> >now trying to order an item and checkout the shopping cart.
> >
> >My initial instinct was: 
> >my $order_opt = {
> >   code => 'os90001',
> >   quantity => '2',
> >   };
> >$ok = $Tag->order( $order_opt )->result;
> >
> >if($ok) {
> >   print "Successful order.\n";
> >}
> >else {
> >   print "FAILED order.\n";
> >}
> >
> >but this returns the html to order the item (missing "session"?) <a
> >href="http://milton.internal.admin.cam.ac.uk:81/cgi-bin/foundcscp/ord/basket.htm
> >l?mv_action=refresh&mv_order_item=os90001&mv_order_quantity=2&=MErpPqPA">
> >
> >I suspect I need to call a SOAP_Action but the information on how to do 
> >this is
> >fairly sketchy, can anyone help please?
> >
> >Chris
> > 
> >
> 
> Example:
> In your catalog conf, something like
> 
> SOAP_Action  soap_time   <<EOR
> sub {
>         my $locale = @_;
>        return $Tag->time($locale);
> }
> EOR
> 
> SOAP_Control  Action/soap_time always
> 
> 
> Now you can query the SOAP server according to
> 
> my $soap_response = SOAP::Lite
>   -> proxy('http://localhost:7780/yourCat/')
>    -> uri('http://yourserver/Vend/SOAP')
>  -> soap_time($locale)
> ;
> 
> But once again:  Do the right thing in the global conf! (Whatever that is).

I think it would be

	SOAP_Control  Action/soap_time always

or the promiscuous

	SOAP_Control  Action   always

WRT an action that would order something:

SOAP_Action  order   <<EOR
sub {
       my $opt = shift;
       $CGI->{mv_order_item} = $opt->{code};
       $CGI->{mv_order_quantity} = $opt->{quantity};
       $CGI->{mv_todo} = 'refresh';
       return $Tag->update( { function => 'process' });
}
EOR

-- 
Mike Heins
Perusion -- Expert Interchange Consulting    http://www.perusion.com/
phone +1.765.647.1295  tollfree 800-949-1889 <mike at perusion.com>

People who want to share their religious views with you
almost never want you to share yours with them. -- Dave Barry


More information about the interchange-users mailing list