Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Please Help with a Web Service!

Please Help with a Web Service!

Scheduled Pinned Locked Moved ASP.NET
csharpasp-nethelptutorialquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    BigBlueEye
    wrote on last edited by
    #1

    I have code that calls a report (report service 2005) that I have to put into a web service and then stream to a client app (vb - asp.net). The code that runs the report, gets and displays the report fine if I place it on a regular aspx page but I can't figure out how to put it in a web service and stream it to a client for consumption. The following code will display the report: Response.ClearContent() Response.AppendHeader("content-length", result.Length.ToString()) Response.ContentType = "application/PDF" Response.BinaryWrite(result) Response.Flush() Response.Close() and this will write it to a file: Dim stream As System.IO.FileStream = System.IO.File.OpenWrite(fileName) stream.Write(result, 0, result.Length) But how to I do this as a web method????? Full code is below: --------------------------------------------------------------------------- Imports System.IO Imports System.Web Imports System.Net Imports System.Web.Services Imports System.Web.Services.Protocols _ _ _ Public Class ServicesBus Inherits System.Web.Services.WebService _ Public Function GetReport() As String Dim rs As RptSrv2005.ReportingService2005 Dim rsExec As RptExec2005.ReportExecutionService 'create new proxy to the web service rs = New RptSrv2005.ReportingService2005() rsExec = New RptExec2005.ReportExecutionService() 'authenticate to the web service using windows credentials rs.Credentials = System.Net.CredentialCache.DefaultCredentials rsExec.Credentials = System.Net.CredentialCache.DefaultCredentials 'assign the url of the web service rs.Url = "http://192.168.248.12/ReportServer/ReportService2005.asmx" rsExec.Url = "http://192.168.248.12/ReportServer/ReportExecution2005.asmx" 'prepare render arguments Dim result As Byte() = Nothing 'Dim reportPath As String = "/AP Recovery Audits Reports/VendorsStatus " Dim format As String = "PDF" Dim historyID As String = Nothing Dim devInfo As String = "False" Dim extension As String = Nothing Dim encoding As String = Nothing Dim mimeType As String = Nothing Dim warnings As RptExec2005.Warning() = Nothing

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups