Recent Posts

Pages: 1 2 3 4 5 6 7 8 9 10
1
C++ programming (SDK style) / ObjReader version 2.00 is coming soon
« Last post by Patrice Terrier on January 14, 2018, 09:43:51 PM »
Here is a quick video presentation of some of the things that could be done with version 2.00.

onyx.mp4
2
I use the following code to consume restful apis which return lists of contacts and tickets for a customer.  The trace code produces good results on my Windows 10 Pro system.

On the Windows Embedded Standard Service Pack 1 system I get Response=<<> 0<>>

50 PTDEBUGPyriTeamSupportApi = 50=True
15:58:49>TEAMSUPP_GETCUSTKTS URLPath=</xml/Customers/1103428/Tickets>
15:58:49>TeamSupportAPI Open bstrURL=https://app.teamsupport.com/api/xml/Customers/1103428/Tickets
15:58:49>TeamSupportAPI Send Verb=GET bstrURL=https://app.teamsupport.com/api/xml/Customers/1103428/Tickets XML=
15:58:49>TeamSupportAPI Response=<<> 0<>>
15:58:49>TEAMSUPP_GETCUSTKTS Response=<<> 0<>>
15:58:49>TeamSupportAPI Open bstrURL=https://app.teamsupport.com/api/xml/Customers/1103428/Contacts
15:58:49>TeamSupportAPI Send Verb=GET bstrURL=https://app.teamsupport.com/api/xml/Customers/1103428/Contacts XML=
15:58:49>TeamSupportAPI Response=<<> 0<>>

Results on Windows 10 Pro system I get Response=<<?xml version="1.0" encoding="utf-8"?>
<Tickets>
  <Ticket>
...
    <Tags />
  </Ticket>
</Tickets><> 200<>OK>



15:52:02>TeamSupportAPI Open bstrURL=https://app.teamsupport.com/api/xml/Customers/1103428/Tickets
15:52:02>TeamSupportAPI Send Verb=GET bstrURL=https://app.teamsupport.com/api/xml/Customers/1103428/Tickets XML=
15:52:12>TeamSupportAPI Response=<<?xml version="1.0" encoding="utf-8"?>
<Tickets>
  <Ticket>
...
    <Tags />
  </Ticket>
</Tickets><> 200<>OK>


15:52:12>TeamSupportAPI Open bstrURL=https://app.teamsupport.com/api/xml/Customers/1103428/Contacts
15:52:12>TeamSupportAPI Send Verb=GET bstrURL=https://app.teamsupport.com/api/xml/Customers/1103428/Contacts XML=
15:52:12>TeamSupportAPI Response=<<?xml version="1.0" encoding="utf-8"?>
<Contacts>
  <Contact>
    <Email>averspizza@msn.com</Email>
    <FirstName>Brad </FirstName>
    <ContactID>3824219</ContactID>
    <MiddleName />
    <LastName>Randall</LastName>
    <Title />
    <IsActive>True</IsActive>
    <LastLogin>5/9/2016 1:31 PM</LastLogin>
    <LastActivity>5/9/2016 12:31 PM</LastActivity>
    <LastPing />
    <IsPortalUser>False</IsPortalUser>
    <PrimaryGroupID />
    <InOffice>False</InOffice>
    <InOfficeComment />
    <ActivatedOn>5/9/2016 1:31 PM</ActivatedOn>
    <DeactivatedOn />
    <OrganizationID>1103428</OrganizationID>
    <Organization>Avers North</Organization>
    <DateCreated>5/9/2016 1:31 PM</DateCreated>
    <DateModified>5/9/2016 1:31 PM</DateModified>
    <CreatorID>3526274</CreatorID>
    <ModifierID>3526274</ModifierID>
    <DisableOrganizationTicketsViewOnPortal>False</DisableOrganizationTicketsViewOnPortal>
    <PortalViewOnly>False</PortalViewOnly>
    <BlockInboundEmail>False</BlockInboundEmail>
    <EMail2 />
    <isar>False</isar>
  </Contact>
</Contacts><> 200<>OK>


Code: [Select]
FUNCTION TeamSupportAPI(BYVAL Verb AS STRING, BYVAL XMLString AS STRING, BYVAL URLPath AS STRING) AS STRING
   LOCAL objHTTP AS IXMLHTTPRequest
   LOCAL bstrURL AS WSTRING
   LOCAL bstrResponse AS WSTRING
   LOCAL vXML AS VARIANT
   vXML = XMLString
   objHTTP = NEWCOM "Msxml2.ServerXMLHTTP.6.0"
   IF ISNOTHING(objHTTP) THEN
     IF PTDebugCfgVal(%PTDEBUGPyriTeamSupportApi) THEN WriteDebugLogFile("TeamSupportAPI objHTTP is Nothing")
     EXIT FUNCTION
   END IF
   ' Opens an HTTP connection to an HTTP resource
   bstrURL = "https://app.teamsupport.com/api"
   '15:20:00>Open bstrURL=https://app.teamsupport.com/api/xml/Tickets//Actions   
   bstrURL = bstrURL + URLPath
   objHTTP.Open Verb, bstrURL, 0, $orgID, $apiToken
   ' Sends an HTTP request to the HTTP server
   IF PTDebugCfgVal(%PTDEBUGPyriTeamSupportApi) THEN WriteDebugLogFile("TeamSupportAPI Open bstrURL="+bstrURL)
   objHTTP.SetRequestHeader "Authorization", "Basic " + Get_Base64_Encode($orgID & ":" & $apiToken)
   objHTTP.SetRequestHeader "Cache-Control", "max-age=0"
   objHTTP.SetRequestHeader "Access-Control-Allow-Origin", "*"
   objHTTP.SetRequestHeader "Access-Control-Allow-Headers", "*"
   objHTTP.SetRequestHeader "Access-Control-Allow-Methods", "POST, GET, OPTIONS, DELETE, PUT"
   '15:20:00>Send Verb=POST bstrURL=https://app.teamsupport.com/api/xml/Tickets//Actions XML=<Ticket><TicketStatusID>251029</TicketStatusID>
   '<TicketTypeID>41053</TicketTypeID><TicketTypeName>Support</TicketTypeName><Name>test</Name><Description><![CDATA[<p>test</p>
   If PTDebugCfgVal(%PTDEBUGPyriTeamSupportApi) THEN WriteDebugLogFile("TeamSupportAPI Send Verb="+Verb+" bstrURL="+bstrURL+" XML="+VARIANT$(vXML))
   objHTTP.Send(vXML)
   bstrResponse = "x"
   IF objHTTP.Status = 200 THEN ' HTTP_STATUS_OK=200
      bstrResponse = objHTTP.ResponseText + "<>" + STR$(objHTTP.Status) + "<>" + objHTTP.StatusText
   ELSE
      bstrResponse = objHTTP.ResponseText + "<>" + STR$(objHTTP.Status) + "<>" + objHTTP.StatusText
   END IF
   IF PTDebugCfgVal(%PTDEBUGPyriTeamSupportApi) THEN WriteDebugLogFile("TeamSupportAPI Response=<"+TRIM$(bstrResponse)+">")
   FUNCTION = bstrResponse
END FUNCTION
  Does anyone have any idea why it does not work on the Windiws Embededd SyeTem?  I have installed all windows updates. The system has IE11 Version 10.0.9600.18124 which is the latest.

If I use POSTMAN to send the request on the Windows Embededd Standard machine it returns tickets and contacts just fine.
3
Discussion / Re: Browser control fails to recognize response to chat request
« Last post by Douglas Martin on January 05, 2018, 09:28:43 PM »
I made pWindow and PWBEvents global vars.  I still get the same result.  Click on submit,  the team support web site recognizes there is a chat request.

I accept the chat but browser control never renders that the chat has been accepted.

The app works on my Windows 10 Pro system and some other systems.

Does not respond to chat acceptance on Windows Embedded Standard Service Pack 1.

I will apply all windows updates to see if that helps.

Any other suggestions?
4
Discussion / Re: Browser control fails to recognize response to chat request
« Last post by José Roca on January 05, 2018, 12:39:29 AM »
You are connecting events in a SUB using a local variable? The class will be destroyed as soon as the SUB will end.
5
Discussion / Re: How to use the AXISMEDIACONTOL in a powerbasic program
« Last post by Douglas Martin on January 04, 2018, 11:38:27 PM »
I did get it working,  I can send you my code if you need it.

6
Discussion / Browser control fails to recognize response to chat request
« Last post by Douglas Martin on January 04, 2018, 11:37:15 PM »
I am using the following code to launch a browser control inside a PBWIN application. I pass in the URL https://app.teamsupport.com/Chat/ChatInit.aspx? with some additional parameters to start a CHAT feature. The page renders asking the user to identify themselves and enter a question and then click submit to request a chat.

We see the chat request, and accept. The issue is the page never responds to the fact that the chat has been accepted. eventually it just times out.

I am trying to figure how to debug what is happening and why the browser control, is not responding to the response that we have accepted the chat?. I can paste the URL into chrome and open the developer tools, not sure what I should be looking for, it all works fine. Same for IE11.

At some locations the CHAT feature works fine. Could it have something to do with the ISP blocking some content or the firewall having some ports closed?

Some browser settings blocking Javascript?

If i copy and paste the CHAT URL into IE11 and run it on the machine it works fine?
Code: [Select]
SUB AddBrowser(BYVAL FormName$, Layer As Integer, HTMLfile As String)
   ' // Save the script as a temporary file
   LOCAL bstrTempFileName AS WSTRING
'   bstrTempFileName = AfxSaveTempFile(s, "", "TMP", "html", 1)
   ' // Create the WebBrowser control with the embedded map
   LOCAL nWide, nHigh AS LONG
   ' // Create an instance of the class
   LOCAL pWindow AS IWindow
   pWindow = CLASS "CWindow"

' **********************************************
'    DIALOG GET CLIENT hDlg TO nWide, nHigh
' **********************************************
'   EZGUI version:
' ------------------
   LOCAL FW!, FH!, hDlg AS LONG
   EZ_GetSize FormName$, FW!, FH!, 2 ' get client area in pixels
   nWide = FW!*.5
   nHigh = FH!*.5
   hDlg = EZ_Handle(FormName$,0)
' **********************************************
   EZ_SetLayer Layer

   ' // Create an instance of the event class
   LOCAL pWBEvents AS DWebBrowserEvents2Impl
   pWBEvents = CLASS "CDWebBrowserEvents2"


   If InStr(HTMLfile, "http") Then
     pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, HTMLfile, pWBEvents,  1, 1, nWide, nHigh)
   Else
     pWindow.AddWebBrowserControl(hDlg, %IDC_WEBBROWSER, RamDrive+HTMLfile, pWBEvents,  1, 1, nWide, nHigh)
   End If     
     ' hCtrl& is handle of a control created using a
     ' non-EZGUI command. ie. a Third party DLL
   EZ_AssignID hDlg, %IDC_WEBBROWSER
   EZ_SetLayer Layer
   EZ_PutOnLayer FormName$, %IDC_WEBBROWSER

   ' // Default message pump (you can replace it with your own)
   'pWindow.DoEvents(iCmdShow)

 END SUB
7
Web Development / Re: Embedding the WebBrowser Control
« Last post by José Roca on December 28, 2017, 12:23:43 PM »
You have to use my Windows API headers instead of the ones provided with the compiler.

See: http://www.jose.it-berater.org/smfforum/index.php?topic=5061.0
8
Web Development / Re: Embedding the WebBrowser Control
« Last post by Jassim Kareem on December 28, 2017, 11:14:31 AM »
Hi,
I would like to embed a web browser control in my PB program. I used the files of this tutorial to accomplish this but to no avail.  it keeps giving me the error of "compiler file is not accessible/found". I do not know whether it is a problem with the include files or not. What header files are needed to make this tutorial files work.
I will be grateful for you and you generous response
Regards,
Jassim.
 
9
Discussion / Re: How to use the AXISMEDIACONTOL in a powerbasic program
« Last post by Gareth Kerr on December 22, 2017, 12:04:30 PM »
Thanks José - that did it.  CWindow is now working under PB/EZgui.
Superb job with the headers.
Gareth
Pages: 1 2 3 4 5 6 7 8 9 10