gctaylor1 has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I'm working on a project where I want to retrieve a 10 character string from an Outlook 2003 email, use that string to query Siebel to get the owner of a record, and then forward the email to the record owner. Right now the emails come to a common inbox and have to be manually looked up and forwarded.

At this point I'm focusing first on getting the record owner from Siebel because I think that'll be the biggest challenge and if I can't do that, then the whole project is moot anyway.

Our Siebel application(run by another department) is accessed via Internet Explorer and I've been using LWP in my first attempts. So far I can get logged in and get inital data back from Siebel.

The next task is to send the string to Siebel to get the record owner but I'm having a hard finding just what to send. When I look at a Wireshark trace on an inbound packet I see Javascript and some kind of packed data. On an outbound package I see the Siebel "commands" and more of the packed data. Here's a small example where I sent the string to Siebel to do a query.

POST /callcenter_enu/start.swe HTTP/1.1 Content-Type: application/x-www-form-urlencoded Connection: Keep-Alive User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .N +ET CLR 2.0.50727) Host: server.example.com Content-Length: 858 Cache-Control: no-cache Cookie: _sn=BsAIEBL0skPPwZeZQNBgthL4ZV6rupIEFYdIiz5edxyE_ SWECLK=1&SWEField=s_2_1_5_0&SWER=0&SWESP=false&crpc=1&s_2_2_61_0 =&s_2_2_46_0=1-77263209&s_2_2_47_0=&s_2_2_72_0=&s_2_2_73_0=&s_2_2_53_0 =&s_2_2_48_0=&s_2_2_50_0=&s_2_2_54_0=&s_2_2_56_0=&s_2_2_59_0=&s_2_2_49 _0=&s_2_2_64_0=&s_2_2_65_0=&s_2_2_31_0=&s_2_2_66_0=&s_2_2_67_0=&s_2_2_ +69_ 0=&s_2_2_35_0=&s_2_2_68_0=&s_2_2_34_0=&s_2_2_70_0=&s_2_2_71_0=&s_2_2_2 +9_ 0=&s_2_2_55_0=&s_2_2_57_0=&s_2_2_60_0=&s_2_2_74_0=&s_2_2_76_0=&s_2_2_7 +7_ 0=&s_2_2_75_0=&s_2_2_45_0=&s_2_2_33_0=&s_2_2_58_0=&s_2_2_30_0=&s_2_2_ 42_0=&SWERPC=1&SWEC=9&SWEStrCCnt=335&SWEActiveApplet=Service+Request+ List+Applet&SWEActiveView=All+Service+Request+across+Organizations& SWECmd=InvokeMethod&SWEVI=&SWEView=All+Service+Request+across+Organiza +tions &SWEApplet=Service+Request+List+Applet&SWEMethod=ExecuteQuery&SWERowId +=1%2b1QQ %2b1&SWEReqRowId=1&SWERowIds=&SWEP=&SWETS=1241540082386&SWSECancelID=1 +241540082
I don't know a whole lot about what the browser does to this data when sending or recieving except that an ActiveX control gets installed in the browser before I'm able to access the Siebel URL.

Given that the data being transferred back and forth between the browser and Siebel is not plain text, I'm wondering if I might be able to use COM/OLE instead? I've been trying to learn Perl as my first language and I've resisted an attempt at learning COM/OLE at the same time, but if that's the best way to accomplish this, then a small(hopefully) detour might be worth it. I've wondered too if I would be better to try and attempt this using some MS based tool. That's my last choice as my whole purpose of this project is not so much for the functionality it will provide but to learn Perl.

In the name of full disclosure, there's a node here CGI and Siebel databases from 2001 where another monk asked about accessing Siebel data and the response was to contact Siebel about various methods. That option is not open to me (unless Oracle/Siebel provides free support) because this is not a company sanctioned project(despite the fact that it will save them money). In fact I'm trying to stay under the radar until I've got something working and then I might have some influence in getting official support or have it maintained by IT.

Any input appreciated.
Thank-you.

Replies are listed 'Best First'.
Re: COM/OLE vs. LWP to access Siebel data?
by Anonymous Monk on May 05, 2009 at 20:28 UTC
      Thanks for the response. I guess I forgot to include in my original question that I've looked through Google results and didn't find anything that applied.

      Thanks for the links provided but as far as I can tell those are all for doing things to a running Siebel server that an admin would have access to.
      Just to be clear, I want to get data out of a Siebel server as a client. I don't have access as an admin.

        Oh, sorry :) try Win32::IE::Mechanize, its an OLE interface helper for automating InternetExplorer.
Re: COM/OLE vs. LWP to access Siebel data?
by gctaylor1 (Hermit) on May 26, 2009 at 01:18 UTC
    I switched to using Win32::IEAutomation because I thought maybe I could dump the page to get an idea of what to do next. When I use
    my @images = $ie->getAllImages; print "@images\n"; my @links = $ie->getAllLinks; print "@links\n";
    I don't get any output and am not sure how to coax any output from the page. Am I using this wrong? When I use this technique on www.google.com I either get an integer returned when using a scalar or references when using arrays so I know that I'm close.

    The full script:

    use strict; use warnings; use Win32::IEAutomation; use Data::Dumper; # Creating new instance of Internet Explorer my $ie = Win32::IEAutomation->new( visible => 1); # Site navigation #$ie->gotoURL('http://server.company.com/callcenter_enu/start.swe'); my @images = $ie->getAllImages; #print Dumper(@images); print "Image: @images\n"; my @links = $ie->getAllLinks; #print Dumper(@links); print "Link: @links\n";
    When I do a view source this is what I get:
    I have to use IE since Siebel won't work without it here. Seibel installs some kind of ActiveX control in the browser. Otherwise I would try some of the suggestions like LiveHeaders or some other tools.
    There are a lot of questions here on The Monastery Gates about How do I perform web automation with sites that use Javascript? so I'm sorry if this is a FAQ but I'm not sure how to procede.

      Quite an old node, but anyway...

      You really should quit using any way of browser simulation to get the desired data: Siebel High Interactive Client does uses ActiveX and Java applets so it could behave like a full GUI.

      Your best option is to use well defined interfaces like COM+, SOAP or the old method to post HTTP data and get an response. Of course, for the two latest options you would need to develop the interfaces from Siebel side. COM+ should be easier to implement, but it has it's drawbacks.

      Alceu Rodrigues de Freitas Junior
      ---------------------------------
      "You have enemies? Good. That means you've stood up for something, sometime in your life." - Sir Winston Churchill