jeudi 28 juillet 2016

Savon 2.11.1 set soap header after client is instantiated Rails + SSRS

I'm trying to integrate my rails app with a Sql Server Reports Services (SSRS) using Savon 2.11.1. I'm using the ReportServicesExecution2005 WSDL. The problem I have is that I have to add a session_id to the soap header after the client has been instantiated. This is because the session_id is generated by SSRS after the client makes a call to load_report.

client = Savon.client(wsdl: "http://ift.tt/2agxWl8", basic_auth: ["user", "pass"])

this call returns the session_id in the response:

response = client.call(:load_report, message: {report: "path/to/report"} ) 

the soap header needs to contain the session_id in the client when this call is made:

client.call(:set_execution_parameters, message: { report: "path/to/report", parameters: params  }  )

Tried this but it didn't work:

client.call(:set_execution_parameters, soap_header: {"session_id" => @session_id}, message: { report: "path/to/report", parameters: params  }  ) 

I get the following error:

(soap:Client) The session identifier is missing. A session identifier is required for this operation. ---> Microsoft.ReportingServices.Diagnostics.Utilities.MissingSessionIdException: The session identifier is missing. A session identifier is required for this operation.

Thanks for the help an advance.

Aucun commentaire:

Enregistrer un commentaire