Gludek
Gludek

Reputation: 13

Signing Soap Headers with Savon

I'm using Savon to connect to SOAP with wsse signature. When trying to make call I recieve error that SOAP Header must be signed.

header = { "Header1": {
          "@xmlns:ns2": "1",
          "@xmlns:ns3": "2",
          "@xmlns:ns4": "3",
          "@xmlns:ns5": "4",
          "@xmlns:ns6": "5",
          "@xmlns:ns7": "6",
          "ns3:atrybut": actual_fields
        }
}

    client = Savon.client(
      wsdl: wsdl,
      endpoint: endpoint,
      soap_header: header,
      ssl_version: :TLSv1_2,
      ssl_ca_cert_file: ca_Cert,
      ssl_cert_file: tls_cert,
      ssl_cert_key_file: tsl_key,
      ssl_cert_key_password: tls_pass,
      open_timeout: 5, read_timeout: 5,
      log_level: :info,
      log: true,
      wsse_timestamp: true,
      env_namespace: :soap,
      wsse_signature: akami_sign,
      )

the error is this


I, [2024-09-04T12:02:33.100356 #1433]  INFO -- : SOAP request: endpoint
I, [2024-09-04T12:02:33.100427 #1433]  INFO -- : SOAPAction: "action"
Content-Type: text/xml;charset=UTF-8
Content-Length: 5995
I, [2024-09-04T12:02:33.226033 #1433]  INFO -- : SOAP response (status 500)
(wsse:InvalidSecurity) Soap Header must be signed : Header1

I have example of XML that is working and few things that are obviously different (compared to XML generated with client.build_request(:action) are

Upvotes: 0

Views: 41

Answers (0)

Related Questions