send_message Method
Sends a SOAP message to the server.
Syntax
def send_message(url: str) -> None: ...
Remarks
The SendMessage() does the following:
- Loads the data from input_bytes, input_file or input_stream properties.
If the data contains a SOAP message, no pre-send processing is performed.
If the data contains XML content, then basing on operation_name, operation_namespace_uri and soap_version properties new SOAP envelope will be created. The XML content will be used either as either the operation itself or the operation parameters, depending on operation_name value.
- Sends the SOAP message to the service Url.
Use soap_action, encoding and mime_type properties to set SOAP HTTP request parameters.
- If the request is successful, the received content is saved in either output_bytes, output_file or output_stream.
If the response contains attachment(s) then on_before_receive_attachment event will be fired for each attachment, following which the attachment will be saved to either output_attachment_bytes, output_attachment_file or output_attachment_stream.
Use soap_response_type to get the type of the received content. If the received content is recognized as a SOAP message, then operation_response_name, operation_response_namespace_uri operation_response_text_content and operation_response_xml properties will be populated.
- If an error happens during the request, an exception is thrown.
Use soap_response_type to identify the received content. The type set to Unknown means that either a connection error has occurred or the service has returned an unexpected HTTP status code. In this case, the error details are published in status_code and reason_phrase properties.
If soap_response_type set to a different value indicates that the service has returned HTTP status code in the range 500 - 599, indicating a service error.
If the type of received content is SOAP message, then fault_actor, fault_code, fault_detail and fault_string properties will contain error details returned by the service.
If the request has succeeded then the received content will also be available in either output_bytes, output_file or output_stream properties.