Question
· Sep 23, 2019

How to return Stream a Soap response

I am trying to return a stream soap response using web services I can call my web service supply it with a xml string which works fine . I then work on that XML and try to return  a Stream but all works in the production when my service receives the stream after I get the error  as if its trying to copy stream to a variable and I am confused as to where that operation happens.

The errors I am getting 
ERROR <Ens>ErrException: <METHOD DOES NOT EXIST>zCopyFrom+28^%Stream.TmpCharacter.1 *Rewind

and here is the stack trace in case I am missing something

  • $$^zGetErrorTrace+3^Ens.Util.Trace.1 +1
  • $$^zCopyFrom+28^%Stream.TmpCharacter.1 +1
  • DO^zDocumentSet+8^PDFRendering.Message.FOPPDFRenderRequestMRES.1 +1
  • $$^zprocessTestTwo+9^PDFRendering.Service.FOPPDFSoapService.1 +1
  • $$^zOnProcessInput+11^PDFRendering.Service.FOPPDFSoapService.2 +1
  • $$^zProcessInput+11^Ens.BusinessService.1 +1
  • $$^zTestTwo+1^PDFRendering.Service.FOPPDFSoapService.3 +1
  • DO^zInvokeService+3^PDFRendering.Service.FOPPDFSoapService.TestTwo.1 +1
  • $$^zInvokeMsgClass+3^%SOAP.WebService.1 +1
  • DO^zProcess+413^%SOAP.WebService.1 +1
  • $$^zOnPage+33^%SOAP.WebService.1 +1
  • $$^zPage+10^%SOAP.WebService.1 +2
  • DO^CSPDispatch+718^%SYS.cspServer +2
  • DO^CSPDispatch+569^%SYS.cspServer +1
  • DO^zProcessRequest+1^%CSP.Session.1 +1
  • DO^Request+535^%SYS.cspServer2 +1
  • DO^Request+21^%SYS.cspServer2 +1
  • DO^zProcessRequest+1^%CSP.Request.1 +1
  • DO^css+36^%SYS.cspServer2 +1

 the service code is as follows please note the method being called by the web method is just a switch statement which directs to the intended method process thanks in advance

 

 

Method TestTwo(pInput As %String) As %String [ WebMethod ]
{
    set tSC=..ProcessInput(pInput,.oRes,"TestTwo")
    do:$$$ISERR(tSC) ..ReturnMethodStatusFault(tSC)
    
    quit oRes
}
Method processTestTwo(pInput As %String) As %String
{
   #;the message class for the file meta data
  #dim oMREQ as PDFRendering.Message.FOPPDFRenderRequestMREQ=##class(PDFRendering.Message.FOPPDFRenderRequestMREQ).%New()
    If (pInput'="")
    {
        do oMREQ.Source.Write(pInput)
        set tSC=..SendRequestSync(..TargetConfigNames,oMREQ,.response)
        
        if $$$ISERR(tSC) do ..ReturnMethodStatusFault(tSC)
        
        //use info from Ensemble response to create SOAP response
         set soapresponse=##class(PDFRendering.Message.FOPPDFRenderRequestMRES).%New()
         set soapresponse.Document=response
         
         set incoming=soapresponse.Document_""
     }else
     {
         set incoming="Input empty"
     }
    quit incoming
}

 


 

Discussion (3)1
Log in or sign up to continue