Hi Stefan,

1. this example looks, much better. and I understand your example.

you actually wrap property values set/get with Iris native commands get/set

2. now I want to add to this : .myProperty event handler,

so if .myProperty changed (in objectscript) I want to add in .Net notify listener

to fire  event with .Net syntax ,

how can I do it ?

I think , I have difficulty to understand your example:

iris Class : 

PCG.myClass

with property:

myProperty

set objMyClass = ##class(PCG.myClass).%New()

set objMyClass.myProperty = "string Property"

in .Net :

1. I need to wrap the : PCG.myClass

2. make an instance of the myClass

3. set to .myProperty as String value, I expect syntax :

objNetMyClass.myProprty = "String Text in .Net Project"

Hi Marc,

I have another Topic, that did not get an answer (from26/08/2020) ,

can you help about, or notice the Owner ? :

 
located on :
my (emanuel Lazar) question :
Emanuel Lazar · Aug 26, 2020
to :
 
the question text :
********************

Dmitriy,
1. I tried the open socket script,  you wrote, and it works OK.

2.now I want to send some string messages on the opened socket,

how I do it ?

I have to add on each "MyMessage" string some header before ?

can you write exact script how I implement using send message(s), and handle get response on each

message.

did not find any docs about

*************************
 
any help ,
will be appreciated

Hi Marc,

1. I built ASP.NET some "server" http listener with [HttpPost] controller

2. I activate your code meanwhile on 1 file (.pdf)

with URL ...serverAsp/postfile/ ...

and got correctly the "file" from your POST() code, means in .NET:

var request = System.Web.HttpContext.Current.Request;

            var files = request.Files.Count;

---> files.Count = 1

so .NET server recognized multi-part structure with 1 file !

4. I saw you made little changes to Craig code, and made it more simpler with just .Post(Url),  without any "adapters"... and nor .SendFormDataArray... 

that did not work for me in the beginning.

5. I'll made more testing , to see if the whole file is transfered correctly

but its seems to work.

thanks,

Hi Marc,

1.

P1   ;

           Set url = HOST_"http://"_HOST_":"_PORT_"/"_jq
           Set tSC = httpRequest.SendFormDataArray(.httpResponse,"POST", httpRequest, "", "", url)

         //Set rc=httpRequest.Post(jq)

the error I get:

<METHOD DOES NOT EXIST>P1+2^HTTP3 *SendFormDataArray,%Net.HttpRequest

2. I asked berfore:

in what Part I set contentDisposition ?

I mean not in SetHeaders,  but as another part in Body ?

or, I don't need it ?

tried multi Part form with one file.pdf to own .Net listener 

the "POST" did not arrive to "web server" ?

my example (took from craig, with some corrections) :

on :

httpRequest.SendFormDataArray...

got error, so I tried .POST

code example :

HttpMimeRequest ;
S Q=$C(34)

 S HOST = "127.0.0.1" ;"localhost"
 S PORT = "8080"
 
 Set httpRequest=##class(%Net.HttpRequest).%New() 
 Set httpRequest.Server=HOST
 Set httpRequest.Port = PORT

 // Create root MIMEPart
 Set RootMIMEPart=##class(%Net.MIMEPart).%New()

 //Create binary subpart and insert file data
 Set BinaryMIMEPart=##class(%Net.MIMEPart).%New()
 
 Set contentDisp=""
 Set contentDisp=contentDisp_"form-data; name="_Q_"fileUpload"_Q
 Set contentDisp=contentDisp_"; filename="_Q_file_Q
 ;Set BinaryMIMEPart.ContentDisposition=contentDisp
  Do BinaryMIMEPart.SetHeader("Content-Disposition",contentDisp)
  Set BinaryMIMEPart.ContentType="application/pdf" ;"application/octet-stream"
 
 Set ContentType= "multipart/form-data; boundary="_RootMIMEPart.Boundary
 Set httpRequest.ContentType=ContentType

 // do we need it : ?
 Do BinaryMIMEPart.SetHeader("Content-Type", ContentType)

 Set stream=##class(%FileBinaryStream).%New()
 Set stream.Filename=file
 Do stream.LinkToFile(file)
 Set BinaryMIMEPart.Body=stream

 // Insert both subparts into the root part
 Do RootMIMEPart.Parts.Insert(BinaryMIMEPart)

 // create MIME writer; write root MIME message
 Set writer=##class(%Net.MIMEWriter).%New()

  // Prepare outputting to the HttpRequestStream
  Set status=writer.OutputToStream(httpRequest.EntityBody)
  if ('status) {do $SYSTEM.Status.DisplayError(status) Quit}

 // Now write down the content
 Set status=writer.WriteMIMEBody(RootMIMEPart)
 if ('status) {do $SYSTEM.Status.DisplayError(status) Quit}

 //  QueryString Example ;
 Set jq = " index.htm?CUSTID=myCust"

 //set url="alfresco/service/sample/upload.json?"
 //      _"alf_ticket=TICKET_caee62bf36f0ea5bd51194fce161f99092b75f62"
 ;set url="http://localhost:8080"
 ;set status=httpRequest.Post(url,0) 
 ;if ('status) {do $SYSTEM.Status.DisplayError(status) Quit}
P1 ; 
 ;Set url = HOST_"http://"_HOST_":"_PORT_"/"_jq
 ;Set tSC = httpRequest.SendFormDataArray(.httpResponse,"POST", httpRequest, "", "", url)
 
  Set rc=httpRequest.Post(jq) 
 //

Hi Craig,

I followed your code, there some obstacles, that I cannot implement your example :

1.  I run the from standard Module.int (not class)

2. what is the syntax : ..%HttpRequest.SetHeader(...) ?

3. what is : ..Adapter.SendFormDataArray(.tHttpResponse,"POST", ..%HttpRequest, "", "", tURL) ?

what the ..Adapter means in standard module ?

I used just :

 Set RootMIMEPart=##class(%Net.MIMEPart).%New()

 Set BinaryMIMEPart=##class(%Net.MIMEPart).%New()

 Set contentDisp=contentDisp_"form-data; name="_Q_"fileUpload"_Q

BPT> Set contentDisp=contentDisp_"; filename="_Q_file_Q

 SET contentDisp=contentDisp_"; filename="_Q_file_Q

Set BinaryMIMEPart.ContentDisposition=contentDisp

 Do BinaryMIMEPart.SetHeader("Content-Disposition",contentDisp)

  Set BinaryMIMEPart.ContentType="application/octet-stream"

and so on...

using standard objects

extreme types , C# .net project <-> cache :

1. stream ,

can I use C# stream and setting it in Cache stream , any doc about or code example ?

2.C# ArraySegment to cache (2018.4) "array" or ^global ?

3. C# byte[] , as I mentioned above, is not working Cache as byte stream, maybe it's implemented as string settings.

4. from C# , call cache procedure , working ok,

but I did not found, how to get back an argument(or more than one) byRef ?

something like :

XTPcon.CallMyProc(proc,method,arg1, arg2, .BackVal1, .BackVal2)

no docs about

VS code for object script as plugin in MS Visual Studio 2017

1. is it possible to add IS object script as plugin to MS VS2017,

 so I can use normally C#, C++ , JavaScript ... and additionally as plugin with IS IRIS objectscript

with full Debug mode ?

2. Hebrew Fonts

in the standard VS2017 the Hebrew letters  combined with English are working correctly

so I expect accordingly , the IRIS plugin will work OK.

3. now installing another VS Code ... (?) I think may harm the MS VS2017

regards

VS studio , with Hebrew Fonts also.

1. I use visual studio 2015 - microsoft for MS projects

it handle correctly Hebrew Language fonts.

2. the current ObjectScript studio (from cube), cannot handle correctly the Hebrew language(RTL) ?

what option you can advice for me:

1. enable to correct the Hebrew Font in intersystems Studio , so it will look ok ?

or :

2. add plugin IRIS (cache) to MS VS-2015 , so I can use Object script  Code, additional to all Existing Code (C++,C#, javascript...)

installing another VS Code, I think can harm the VS2015

I saw the 101-201 lectures, and it was very explanatory, to a developers, with not too much math background.

on the internet there are so much stuff,

but from this lecture I succeed to understand, and as developer I have the ability to implement it.

I want to implement a specific Neural net called : symbolic regression

given data-set(thousands rows, currently on a IRIS ^global)  will predict next value , do you know on some existing Lab(prefered Microsoft tool) , so I can download and run , as you showed, in the lectures ?

or IRIS can add the SYMBOLIC REGRESSION in integratedML ?

any help will be appreciated