I have tried what you suggested but still getting the same error <INVALID OREF> have also checked to see if the JSON string is present and checked on the instantiated object can not pin point where the error is coming from had look here they had the same problem but my guess is we are using different versions as I don't have this class in my version  HS.FHIR.Validation.ResourceValidator

Having tested this outside a restricted environment I realised my problem was the proxy server as the htttpResponse was not being instantiated, the work around was to use the proxy sever and running everything through the proxy tunnel.

ClassMethod MyReq()
{
set tSC=$$$OK
set req = ##class(%Net.HttpRequest).%New()
set req.Server = "msedgewebdriverstorage.blob.core.windows.net"
set req.ProxyPort=**
set req.ProxyServer="*******"
set req.ProxyHTTPS=1
set req.ProxyTunnel=1
set req.SSLConfiguration="Open" do:tSC req.Get("/edgewebdriver/?comp=list")     Do $System.OBJ.Dump(req.HttpResponse)
quit tSC
}

thank you everyone the problem I have been having is caused by the Describe column invoked by the Execute procedure  method on the procedure if data passed is not the same type as the stored procedure parameters the method issues a warning which is then log to the event log to stop that from happen I had to add the "*" to the pIO parameter of the method

@Eduard Lebedyuk 
I have classes with the similar structure in your test.Serial class I have Two properties  Serial1 and Serial2 as test.Serial1 and 2 respectively and i would like to print out XML maybe populate  Serial 1 and have Serial2 as an empty object and Leave it out when printing.How do I controll that ?,as it stands it prints out the empty elements even when ignore null is set.Please not all is the same as above so I am printing from a persistent Level.The difference being I have two serial objects properties In my test.Serial equavalent

This will do exactly what you want any problems give us shout

ClassMethod ImpCSV(fileName As %String = "C:\filepath where csv file is")
{
	;;Refresh globals data at the begin of proecess
	;;globals hold the file being written to data and the count of lines each file has 
	k ^ufile,^ufile2,^counter,^counter2
	set Reader =##class(%Stream.FileCharacter).%New() 
	
	;;link to the file to read	 
	set status=Reader.LinkToFile(fileName)
		
   if $$$ISERR(status)
	{
		do $System.Status.DisplayError(status)
	}
	;;initialise the counter for the file lines to write to one file	 
	set ^counter =0
	set ^counter2 =0	
	set ^ufile=""
	set ^ufile2=""
    
    ;;the count for the lines read in
	set lineCount=0
	;;start process the lines
	while 'Reader.AtEnd
	{
		;;read the incoming file
		set line=Reader.ReadLine()
		;;increment the line count by one as you read the next line
		set lineCount=lineCount+1		
	
	    ;;piece the column to check
	    ;;one is for the first column and so on
	    ;;string at after the equal sign is the value to check for 
		if ($piece(line,",",1)="Religion")
		{
			;;increment count for this file
			 set ^counter=^counter+1
			  ;;the counter is at one to assign the file path to write to
			   if (^counter=1)
				{
					;;set the file name to write to the global
					set ^ufile=..writeFileOut("fileone",".csv",line,,^counter)
				}
				else
				{
					;;check the count has no reached the limit for the number of lines to write to
					if (^counter=51)
					{
						;;reset the count if limit reach
						set ^counter=1
					    ;;new file
					    set ^ufile =..writeFileOut("fileone",".csv",line,,^counter)
					    }
					    else
					    {
						    ;;use the current file
						    do ..writeFileOut(,,line,,^counter,"REG")
						 }
					}			
		  }
		  ;;second check for the next set of data if you have more than 
		  ;;two to check for copy the below and change accordingly to accommodate the next check
		  ;;same as above
		  if ($piece(line,",",1)="description")
		  {
			  ;;set attributes for the second file to write to
			   set ^counter2=^counter2+1
			   if (^counter2=1)
			   {
					set ^ufile2=..writeFileOut("fileTwo",".csv",line,,^counter2)
				}else
				{
					if (^counter2=51)
					{
						set ^counter2=1
						;;new file
						set ^ufile2= ..writeFileOut("fileTwo",".csv",line,,^counter2)
					}else
					{
						do ..writeFileOut(,,line,,^counter2,"DESC")
					}
				}				 			
	}
		  
}

 kill ^ufile,^ufile2
}

ClassMethod writeFileOut(filename, fileext As %String, line As %String, directory = "C:\directory to store files", linecount As %Integer, FileToUse)
{
	set oLF = ##class(%Library.File).%New()
	if (linecount=1)
	{
		
	    Set filenam=directory_filename_$i(^timmmy)_fileext
	    set oLF.Name=filenam
	    if (oLF.Open("wns"))
	    {
		    set linecount=linecount+1
		    do oLF.WriteLine(line)
		    do oLF.Close()
		    ;;w oLF.Name
		    quit oLF.Name	
	   }
	}else
	{
		if (FileToUse="DESC")
		{
		     if (^ufile2'="")
		     {
		         set oLF.Name=^ufile2
			}
		}elseif(FileToUse="REG")
		{
		     if (^ufile'="")
			 {
			     set oLF.Name=^ufile
			  }
		}
	    If (##class(%File).Exists(oLF.Name))
	     {
		     
		     Do oLF.Open("EWA")
		     if (linecount'=51)
		     {
			     set linecount=linecount+1
		         do oLF.WriteLine(line)
		         do oLF.Close()
		          quit oLF.Name
		     }
		 }
	}
}

@Tomas Vaverka 
Yes that right but I know that the question may be was not clear I have an object class which has two properties one a string and a stream and was trying to pass that object ,all I could do was pass a string and an empty stream  but I have read around the stream and found out that I can pass a stream as a stream but not inside an object thanks again