0

I'm writig a Script for CATIA to run under both Windows and Unix based systems.
For this I'm using CATScript which is a derivative of VBScript, so maybe the VBScript pro's here will have an answer ;-)
For this script i need to perfom a webservice request, following code is working fine for Windows:

Sub CATMain()
    Dim url As String
    Dim oHttpReq As Object
    Dim responseText As String

    url = "http://some.webservice.php?request=some_reuest&params=some_param"
    Set oHttpReq = CreateObject("MSXML2.ServerXMLHTTP") 

    oHttpReq.Open "POST", url, False
    oHttpReq.Send

    'Response
    responseText = oHttpReq.responseText

    MsgBox responseText

End Sub

However this won't work on Unix of course, as it doesn't know the MSXML2.ServerXMLHTTP object. Do you have any idea about what object to use for Unix? Or any other workaround that will be good for Unix systems?

Thanks in advance & Best Regards
Sverre

SverreN
  • 177
  • 1
  • 9

1 Answers1

0

I don't have experience with CATIA, but if you can run external programs you might be able to utilize a Perl script:

use LWP::UserAgent;

my $ua = LWP::UserAgent->new();
my $response = $ua->post(
  'http://some.webservice.php',
  [
    'request' => 'some_request',
    'params'  => 'some_param'
  ]
);
print $response->as_string();
Community
  • 1
  • 1
Ansgar Wiechers
  • 193,178
  • 25
  • 254
  • 328