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

1 Answer 1

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();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.