none
Calling Reporting Services Render using Soap Envelope

    Question

  • I'm having a lot of trouble achieving a simple alteration to some code which previously worked on Reporting Server 2000, but now needs to work on Reporting Services 2008R2. I'm trying to avoid redeveloping the whole solution, and would just like to unlock the problem with this code. I'm currently getting an error:

    <faultstring>The value for parameter 'Format' is not specified. It is either missing from the function call, or it is set to null. ---> Microsoft.ReportingServices.Diagnostics.Utilities.MissingParameterException: The value for parameter 'Format' is not specified. It is either missing from the function call, or it is set to null.</faultstring>

    This is from the ResponseText returned after the line

    oXMLHTTPRequest.send (oDocument.XML)

    The function code is below. I'm setting the Format property as "PDF" and I can't see why that'd be a problem. Do I have a namespace wrong, a case-sensitivity issue, or is this form of calling the Render method not supported in 2008R2?

    Public Function GenerateReportingService(oDom As MSXML2.DOMDocument, sReportName As String) As Variant Dim sSOAPMsg As String Dim oDocument As New MSXML2.DOMDocument60 Dim oXMLHTTPRequest As New MSXML2.XMLHTTP60 Dim sParamName As String Dim sParamValue As String Dim sUserName As String Dim sPassword As String Dim sWebMethod As String Dim sReport As String Dim sFormat As String Dim sHistoryID As String Dim sDeviceInfo As String Dim sShowHideToggle As String Dim sWebservicesURL As String Dim sWebservicesURI As String Dim nodeReport_Line As MSXML2.IXMLDOMNodeList Dim nodeInvReport_Line As MSXML2.IXMLDOMNodeList Dim nodeXMLErrorMsg As MSXML2.IXMLDOMNodeList sWebservicesURL = Reg_ReadRegistry(HKEY_LOCAL_MACHINE, REGKEY_REPORTS, REGKEY_REPORT_PATH) 'http://sqlrs01/reportserver/reportexecution2005.asmx/ sWebservicesURI = "http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/" sReportName = Trim(sReportName) Select Case sReportName Case "XML_ELEMENT_BR01_INVENTORY_ROOT" sReport = "/Binstock Reports/InventoryReport" sParamName = "XmlString" Case "XML_ELEMENT_BR02_ADJUSTMENT_ROOT" sReport = "/Binstock Reports/AdjustmentReport" sParamName = "XMLString" Case "XML_ELEMENT_BR03_STOCK_COUNT_ROOT" sReport = "/Binstock Reports/StockcountReport" sParamName = "XMLString" End Select sFormat = "PDF" sDeviceInfo = vbNullString sShowHideToggle = vbNullString sWebMethod = "Render" sParamValue = oDom.XML Set nodeReport_Line = oDom.getElementsByTagName("report_line") Set nodeXMLErrorMsg = oDom.getElementsByTagName("error_level") Set nodeInvReport_Line = oDom.getElementsByTagName("report_line") If (nodeReport_Line.length = 1) Then If (nodeXMLErrorMsg.Item(0).Text = "0") Then sParamValue = Replace(sParamValue, "<message>", "<message>.") sParamValue = Replace(sParamValue, "<MESSAGE>", "<MESSAGE>.") End If End If sParamValue = Replace(sParamValue, vbCrLf, "") sParamValue = Replace(sParamValue, "<", "&lt;") sParamValue = Replace(sParamValue, ">", "&gt;") sSOAPMsg = "<?xml version='1.0' encoding='utf-8'?>" & vbCrLf sSOAPMsg = sSOAPMsg & "<soap:Envelope xmlns:soap = 'http://schemas.xmlsoap.org/soap/envelope/' xmlns:xsi = 'http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>" sSOAPMsg = sSOAPMsg & "<soap:Body><Render xmlns = 'http://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/'>" sSOAPMsg = sSOAPMsg & "<Report>" & sReport & "</Report>" sSOAPMsg = sSOAPMsg & "<Format>" & sFormat & "</Format>" sSOAPMsg = sSOAPMsg & "<DeviceInfo>" & sDeviceInfo & "</DeviceInfo>" sSOAPMsg = sSOAPMsg & "<Parameters><ParameterValue><Name>" & sParamName & "</Name><Value>" & sParamValue & "</Value></ParameterValue></Parameters>" sSOAPMsg = sSOAPMsg & "<Credentials><UserName>" & sUserName & "</UserName><Password>" & sPassword & "</Password></Credentials>" sSOAPMsg = sSOAPMsg & "<ShowHideToggle>" & sShowHideToggle & "</ShowHideToggle>" sSOAPMsg = sSOAPMsg & "</Render></soap:Body></soap:Envelope>" oDocument.loadXML sSOAPMsg oXMLHTTPRequest.open "POST", sWebservicesURL, False oXMLHTTPRequest.setRequestHeader "Accept", "text/xml" oXMLHTTPRequest.setRequestHeader "Cache-Control", "no-cache" oXMLHTTPRequest.setRequestHeader "SOAPAction", sWebservicesURI & sWebMethod oXMLHTTPRequest.setRequestHeader "Content-Type", "text/xml; charset=utf-8" oXMLHTTPRequest.send (oDocument.XML) GenerateReportingService = SavePDF(oXMLHTTPRequest.responseText, COMPONENT_NAME, sReportName) End Function

    I've done extensive searching for a solution to this and am really struggling.

    Thank you.


    Tim Johnstone Senior Technical Consultant Computacenter (UK) Ltd

    Thursday, August 15, 2013 1:03 PM

Answers

  • Tim.  If you haven't resolved this yet then give me a shout at chrismisztur@yahoo.com.

    There is a couple ways to go about this.

    -chris

    • Marked as answer by Tim Johnstone Wednesday, December 04, 2013 10:40 AM
    Tuesday, December 03, 2013 1:18 PM

All replies

  • Hi Tim,

    Thank you for your question. 
    I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.

    Thank you for your understanding and support.

    Regards,
    Charlie Liao

    If you have any feedback on our support, please click here.


    Charlie Liao
    TechNet Community Support

    Friday, August 16, 2013 3:30 AM
  • Hi,

    I think you can refer to this article http://support.microsoft.com/kb/875447


    Regards,
    Christian HL
    Microsoft Online Community Support


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Friday, August 16, 2013 5:55 AM
  • Hi Christian - thanks for the link. That's a particularly good example for creating a reporting services connection using .Net, but I'm trying to use a SOAP message sent to the ReportExection2005.asmx endpoint which requires a slightly different method for calling the Render command. So it's not quite going to help.

    Charlie - I appreciate your message. I look forward to a response.


    Tim Johnstone Senior Technical Consultant Computacenter (UK) Ltd

    Friday, August 16, 2013 9:02 AM
  • Hi,

    The link that I provide is using SOAP API as the title suggested. And it also connect using ReportExecution2005.asmx endpoint.

    at step 6 from previous link:

    "

    In the Add Web Reference dialog box,
    type
    http://<var>ReportServerName</var>/ReportServer/ReportExecution2005.asmx
    in the URL box, and then click Go.

    "


    Regards,
    Christian HL
    Microsoft Online Community Support


    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

    Tuesday, August 20, 2013 1:45 AM
  • Thank you, but I'm using VB6, not VB.Net, so I don't believe I can add a web reference. At least that's not an option when I try adding references to the project. That's why that method doesn't work for me and I don't want to have to upgrade the project to VB.Net.

    The current code doesn't use a reference, it just sends a SOAP envelope to ReportExecution2005.asmx, and that's what I'm trying to maintain.

    I appreciate VB6 is out of support and very old, so if it's just completely unsupportable then I'll move on and get round the problem another way.


    Tim Johnstone Senior Technical Consultant Computacenter (UK) Ltd

    Tuesday, August 20, 2013 8:46 AM
  • Tim.  If you haven't resolved this yet then give me a shout at chrismisztur@yahoo.com.

    There is a couple ways to go about this.

    -chris

    • Marked as answer by Tim Johnstone Wednesday, December 04, 2013 10:40 AM
    Tuesday, December 03, 2013 1:18 PM