How I should set the session identifier for communication with the server ?
@service 开发者_开发知识库= SOAP::WSDLDriverFactory.new(WSDL_URL).create_rpc_driver
@service.getExecutionInfo({})
SOAP::FaultError: The session identifier is missing. A session identifier is required for this operation. ---> The session identifier is missing. A session identifier is required for this operation. from #< SOAP::Mapping::Object:0xb5bfef2c>
First I need to note I don't know anything about ruby-on-rails or soap4r but I've had a similar issue using the ReportExecutionService2005 web service from Java, so I can point you in the right direction.
The session identifier is generated once you load a report, so you need to call the LoadReport method of the web serivice which returns an ExecutionInfo object on which you call getExecutionID which gives you the session identifier you need.
This identifier needs to go into the SOAP headers for all subsequent requests for that report (change reports and you need to change the identifier in your header). Your SOAP header should end up looking something like this:
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header>
<ssrs:ExecutionHeader xmlns:ssrs='http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices'>
<ssrs:ExecutionID>your-execution-id</SSRS:ExecutionID>
</ssrs:ExecutionHeader>
...
</env:Header>
...
</env:Envelope>
Obviously the your-execution-id will be replace with the return from getExecution ID.
How you get the header there in ruby and soap4r is not something I can help with.
精彩评论