Jump to content

Recommended Posts

Posted

I'm trying to send/recieve SOAP messages to a web service configured to use HTTPS. 

I've tried using the WinHTTP.au3 to no avail code is below

#Include <WinHTTP.au3>
#include<winapi.au3>

Global $wo = 1, $tvId = 2, $storeNumber = 1235
Global $url = "https://remoteServer"
ConsoleWrite(@ScriptLineNumber & @TAB & _WinAPI_GetLastError() & @crlf)

Global $envelope = "<?xml version=""1.0"" encoding=""utf-8""?>" & _
                    "<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"" xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">" & _
                      "<soap:Body>" & _
                        "<ProcessRequest xmlns=""http://www.tempuri.org"">" & _
                          "<storeNumber>" & $storeNumber & "</storeNumber>" & _
                          "<tvId>" & $tvId & "</tvId>" & _
                          "<wo>" & $wo & "</wo>" & _
                        "</ProcessRequest>" & _
                      "</soap:Body>" & _
                  "</soap:Envelope>"


$hw_open = _WinHttpOpen()
_WinHttpSetOption($hw_open, $WINHTTP_OPTION_SECURITY_FLAGS, 0x3300)
ConsoleWrite("Error: " & @ScriptLineNumber & @TAB & _WinAPI_GetLastError() & @crlf)

$hw_connect = _WinHttpConnect($hw_open, $url, $INTERNET_DEFAULT_HTTPS_PORT) ;-- this is returning 0


$h_openRequest = _WinHttpOpenRequest($hw_connect, "POST", "myFunction.asmx",Default,Default,Default,$WINHTTP_FLAG_SECURE)
$req = _WinHttpSendRequest($h_openRequest)

$recd = _WinHttpReceiveResponse($h_openRequest)

Could anyone please take a look and provide any suggestion?

Thanks

Posted (edited)
Please use the "A" ie "code" for text that is AutoIt script
Your code will be easier to read.
 
 

Do you have already read these threads?

'?do=embed' frameborder='0' data-embedContent>>

'?do=embed' frameborder='0' data-embedContent>>

'?do=embed' frameborder='0' data-embedContent>>

'?do=embed' frameborder='0' data-embedContent>>

 

EDIT:

btw.

Welcome to the forum

do not forget to read forum rules:

http://www.autoitscript.com/forum/index.php?app=forums&module=extras&section=boardrules

Edited by mlipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...