Translation from vb.net

Translation from vb.net

Postby MarcoBoschi » Tue Jul 29, 2008 8:24 am

My intention is to create some little utilities in xHarbour/Fivewin that will be able to drive some innovaphone equipments, such as telephone, gateway and so on.

The question is: is it possible to translate the below sample in xharbour/fivewin and obtain the same result?
Thanks in advance
Marco



I've found this sample

Module Module1

Sub Main()
Dim pbx As com.innovaphone.www.pbx
Dim session_h As Integer
Dim user_h As Integer
Dim i As Integer
Dim inf() As com.innovaphone.www.Info

pbx = New com.innovaphone.www.pbx()

pbx.Url = "http://x.x.x.x/PBX0/user.soap"
pbx.Credentials = New Net.NetworkCredential("admin", "ip400")

session_h = pbx.Initialize("eighteen", "demo", 0)
user_h = pbx.UserInitialize(session_h, "eighteen")

pbx.UserCall(user_h, "", "152", "", i, inf)
End Sub

End Module

below there is complete tex of word documents with other explanation.
How to use the PBX API from VB.NET
This information applies to
− PBX API V5

Summary
This document will guide you in a few steps to control an ip200 by means of the PBX API in such, that an ip200 is calling another ip200 on request of a Visual Basic .NET application.
The sample provided here is far from being a fully-fledged demonstration of the PBX API. It rather serveres as a “Hello World” sample.

More Information
System Requirements
.NET Runtime
Visual Studio .NET
2x IP200
1x IP400

Hello World in a few steps

· Get a v5 ip400, install a PBX and create two users
Long Name Name Number
hundredfiftytwo einszwofünf 152
eighteen einsacht 18

· Start Visual Studio
· Go into FILE/NEW/PROJECT/
· The New Project Dialog will appear
· Select Visual Basic Project
· Select Console Application
· Type the application’s name as ConsoleApplication1
· Go into the Solution Explorer an right-click on ConsoleApplication1
· Select Add Web Reference from the context menu
· The Add Web Reference Dialog appears
· As Address enter http://www.innovaphone.com/wsdl/pbx.wsdl
· Hit the ENTER key
· The XML Content of the WSDL file now appears in the left window pane
· Click on the Add Reference Button
· You will now see a new Web Reference has been added, the whole picture now looks like this:


· Now enter the following few lines as content for Module1.vb

Module Module1

Sub Main()
Dim pbx As com.innovaphone.www.pbx
Dim session_h As Integer
Dim user_h As Integer
Dim i As Integer
Dim inf() As com.innovaphone.www.Info

pbx = New com.innovaphone.www.pbx()

pbx.Url = "http://x.x.x.x/PBX0/user.soap"
pbx.Credentials = New Net.NetworkCredential("admin", "ip400")

session_h = pbx.Initialize("eighteen", "demo", 0)
user_h = pbx.UserInitialize(session_h, "eighteen")

pbx.UserCall(user_h, "", "152", "", i, inf)
End Sub

End Module

That’s it. When you’re running the code you’ll see the ip200 with the number 18 calling the phone with the number 152.
If it does not compile, go to reference.vb and remove the function License. This is a VB bug.
Code Discussion
· Dim pbx As com.innovaphone.www.pbx
A so-called proxy object with name pbx is the point of interest

· pbx = New com.innovaphone.www.pbx()
The proxy object must be allocated

· pbx.Url = http://192.168.0.18/PBX0/user.soap
The ip400 with the PBX has the ip address 192.168.0.18

· pbx.Credentials = New Net.NetworkCredential("admin", "ip400")
We're using the default user account and password

· session_h = pbx.Initialize("eighteen")
Getting a session handle for user eighteen

· user_h = pbx.UserInitialize(session_h, "eighteen")
Getting a user handle for user eighteen

· pbx.UserCall(user_h, "", "152", "")
Submitting the call from user eighteen towards number 152

If everything worked fine, the ip200 with number 152 is ringing.
User avatar
MarcoBoschi
 
Posts: 1066
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Fri Aug 01, 2008 6:40 am

Marco,

Please try this:
Code: Select all  Expand view  RUN
local pbx := CreateObject( "com.innovaphone.www.pbx" )
local inf := CreateObject( "com.innovaphone.www.Info" )

pbx:Url = "http://x.x.x.x/PBX0/user.soap"

// not sure about this one
// pbx:Credentials = New Net.NetworkCredential("admin", "ip400")
// maybe this:
pbx:Credentials = CreateObject( "Net.NetworkCredential" )

session_h = pbx:Initialize("eighteen", "demo", 0)
user_h = pbx:UserInitialize(session_h, "eighteen")

pbx:UserCall(user_h, "", "152", "", i, inf)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Fri Aug 01, 2008 7:21 am

Thank You
Here's runtime error
Application
===========
Path and name: C:\soap\Web References\com.innovaphone.www\soap_api.exe (32 bits)
Size: 1,419,264 bytes
Time from start: 0 hours 0 mins 0 secs
Error occurred at: 08/01/08, 09:20:17
Error description: Error TOleAuto/-1 CO_E_CLASSSTRING: TOLEAUTO:NEW
Args:
[ 1] = C com.innovaphone.www.pbx

Stack Calls
===========
Called from: => THROW(0)
Called from: win32ole.prg => TOLEAUTO:NEW(0)
Called from: win32ole.prg => CREATEOBJECT(0)
Called from: soap_api.prg => ANTONIO(4)

System
======
CPU type: Intel(R) Pentium(R) 4 CPU 2.40GHz 2400 Mhz
Hardware memory: 992 megs

Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %

Compiler version: xHarbour build 0.99.61 Intl. (SimpLex)
Windows version: 5.1, Build 2600 Service Pack 3

Windows total applications running: 0

Variables in use
================
Procedure Type Value
==========================
THROW
Param 1: O Class: ERROR
Local 1: U
Local 2: N 0
TOLEAUTO:NEW
Param 1: C "com.innovaphone.www.pbx"
Local 1: U
Local 2: O Class: TOLEAUTO
Local 3: O Class: ERROR
CREATEOBJECT
Param 1: C "com.innovaphone.www.pbx"
ANTONIO
Local 1: U
Local 2: U
Local 3: U
Local 4: U
Local 5: U
User avatar
MarcoBoschi
 
Posts: 1066
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Fri Aug 01, 2008 7:28 am

Marco,

"com.innovaphone.www.pbx" seems an OleAuto object. I don't think that it is an ActiveX, but just to be sure please try this too:
Code: Select all  Expand view  RUN
   DEFINE WINDOW oWnd TITLE "FiveWin ActiveX Support"

   oActiveX = TActiveX():New( oWnd, "com.innovaphone.www.pbx" )

   ACTIVATE WINDOW oWnd

Do you have that OleAuto/ActiveX installed in your computer ?
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Fri Aug 01, 2008 1:16 pm

Antonio,
it's difficult fo me to obtain documentation.
In the documentation of these voip products there are some files suche as

http://wiki.innovaphone.com/images/0/04/Client.zip

or this other

http://wiki.innovaphone.com/index.php?t ... e:SOAP_API

Some technicians told me that is very easy to connect my applications to these products, on the contrary is very very difficult.
Any ideas?
Thanks in advance
User avatar
MarcoBoschi
 
Posts: 1066
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Fri Aug 01, 2008 4:57 pm

Marco,

Please try this:

MsgInfo( IsActiveX( "com.innovaphone.www.pbx" ) )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Mon Aug 04, 2008 7:45 am

Antonio,
the result of

#include "fivewin.ch"
FUNCTION MAIN()
MsgInfo( IsActiveX( "com.innovaphone.www.pbx" ) )
RETURN NIL

IS .F.


not installed?


Which kind of file I have to search to install "com.innovaphone.www.pbx"?
I apologize for this OT but someone put under stress me
User avatar
MarcoBoschi
 
Posts: 1066
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Mon Aug 04, 2008 10:28 am

Marco,

Please ask that product tech support how it should be installed.

Or if they provide a demo, just run the demo setup and test it. It should register the required components on your computer.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Tue Aug 05, 2008 8:09 am

Thanks a lot for your fast response.
I've found poor documentation and samples does not work.
In other circumstances I've found always the classical samples that works!
This time no.
Soap, activex

Antonio this is a dir /S /P of client.zip found on innovaphone site
N:\INNO\soap\AssemblyInfo.cs
N:\INNO\soap\call.cs
N:\INNO\soap\client
N:\INNO\soap\client.cs
N:\INNO\soap\client.sln
N:\INNO\soap\client.vssscc
N:\INNO\soap\ConfigForm.cs
N:\INNO\soap\ConfigForm.resx
N:\INNO\soap\elenco.txt
N:\INNO\soap\error.log
N:\INNO\soap\esempioxh.EXE
N:\INNO\soap\esempioxh.obj
N:\INNO\soap\esempioxh.prg
N:\INNO\soap\innovaphone.client.csproj
N:\INNO\soap\innovaphone.client.csproj.user
N:\INNO\soap\innovaphone.client.csproj.vspscc
N:\INNO\soap\innovaphone.client.exe
N:\INNO\soap\innovaphone.client.exe.incr
N:\INNO\soap\innovaphone.client.pdb
N:\INNO\soap\innovaphone.ConfigForm.resources
N:\INNO\soap\innovaphone.MainForm.resources
N:\INNO\soap\innovaphone.MonitorControl.resources
N:\INNO\soap\innovaphone.pbx.csproj
N:\INNO\soap\innovaphone.pbx.csproj.vspscc
N:\INNO\soap\innovaphone.Search.resources
N:\INNO\soap\licenses.licx
N:\INNO\soap\MainForm.cs
N:\INNO\soap\MainForm.resx
N:\INNO\soap\MonitorControl.cs
N:\INNO\soap\MonitorControl.resx
N:\INNO\soap\mssccprj.scc
N:\INNO\soap\pbx.cs
N:\INNO\soap\pbx.wsdl
N:\INNO\soap\prova.EXE
N:\INNO\soap\prova.obj
N:\INNO\soap\prova.prg
N:\INNO\soap\Reference.cs
N:\INNO\soap\Reference.map
N:\INNO\soap\Search.cs
N:\INNO\soap\Search.resx
N:\INNO\soap\testcall.EXE
N:\INNO\soap\testcall.obj
N:\INNO\soap\testcall.prg
N:\INNO\soap\user.cs
N:\INNO\soap\vssver.scc
N:\INNO\soap\Web References.com.innovaphone.www.Reference.cs.dll
N:\INNO\soap\client\client.sln
N:\INNO\soap\client\client.vssscc
N:\INNO\soap\client\innovaphone.client
N:\INNO\soap\client\innovaphone.pbx
N:\INNO\soap\client\mssccprj.scc
N:\INNO\soap\client\vssver.scc
N:\INNO\soap\client\innovaphone.client\AssemblyInfo.cs
N:\INNO\soap\client\innovaphone.client\bin
N:\INNO\soap\client\innovaphone.client\call.cs
N:\INNO\soap\client\innovaphone.client\client.cs
N:\INNO\soap\client\innovaphone.client\ConfigForm.cs
N:\INNO\soap\client\innovaphone.client\ConfigForm.resx
N:\INNO\soap\client\innovaphone.client\innovaphone.client.csproj
N:\INNO\soap\client\innovaphone.client\innovaphone.client.csproj.user
N:\INNO\soap\client\innovaphone.client\innovaphone.client.csproj.vspscc
N:\INNO\soap\client\innovaphone.client\licenses.licx
N:\INNO\soap\client\innovaphone.client\MainForm.cs
N:\INNO\soap\client\innovaphone.client\MainForm.resx
N:\INNO\soap\client\innovaphone.client\MonitorControl.cs
N:\INNO\soap\client\innovaphone.client\MonitorControl.resx
N:\INNO\soap\client\innovaphone.client\mssccprj.scc
N:\INNO\soap\client\innovaphone.client\obj
N:\INNO\soap\client\innovaphone.client\Search.cs
N:\INNO\soap\client\innovaphone.client\Search.resx
N:\INNO\soap\client\innovaphone.client\user.cs
N:\INNO\soap\client\innovaphone.client\vssver.scc
N:\INNO\soap\client\innovaphone.client\Web References
N:\INNO\soap\client\innovaphone.client\bin\Debug
N:\INNO\soap\client\innovaphone.client\bin\Debug\innovaphone.client.exe
N:\INNO\soap\client\innovaphone.client\bin\Debug\innovaphone.client.pdb
N:\INNO\soap\client\innovaphone.client\obj\Debug
N:\INNO\soap\client\innovaphone.client\obj\Debug\innovaphone.client.exe
N:\INNO\soap\client\innovaphone.client\obj\Debug\innovaphone.client.exe.incr
N:\INNO\soap\client\innovaphone.client\obj\Debug\innovaphone.client.pdb
N:\INNO\soap\client\innovaphone.client\obj\Debug\innovaphone.ConfigForm.resources
N:\INNO\soap\client\innovaphone.client\obj\Debug\innovaphone.MainForm.resources
N:\INNO\soap\client\innovaphone.client\obj\Debug\innovaphone.MonitorControl.resources
N:\INNO\soap\client\innovaphone.client\obj\Debug\innovaphone.Search.resources
N:\INNO\soap\client\innovaphone.client\obj\Debug\temp
N:\INNO\soap\client\innovaphone.client\obj\Debug\TempPE
N:\INNO\soap\client\innovaphone.client\obj\Debug\TempPE\Web References.com.innovaphone.www.Reference.cs.dll
N:\INNO\soap\client\innovaphone.client\Web References\com.innovaphone.www
N:\INNO\soap\client\innovaphone.client\Web References\com.innovaphone.www\pbx.wsdl
N:\INNO\soap\client\innovaphone.client\Web References\com.innovaphone.www\Reference.cs
N:\INNO\soap\client\innovaphone.client\Web References\com.innovaphone.www\Reference.map
N:\INNO\soap\client\innovaphone.client\Web References\com.innovaphone.www\vssver.scc
N:\INNO\soap\client\innovaphone.pbx\AssemblyInfo.cs
N:\INNO\soap\client\innovaphone.pbx\innovaphone.pbx.csproj
N:\INNO\soap\client\innovaphone.pbx\innovaphone.pbx.csproj.vspscc
N:\INNO\soap\client\innovaphone.pbx\mssccprj.scc
N:\INNO\soap\client\innovaphone.pbx\pbx.cs
N:\INNO\soap\client\innovaphone.pbx\vssver.scc

Do you find some useful file?
User avatar
MarcoBoschi
 
Posts: 1066
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Tue Aug 05, 2008 8:21 am

The examples seem to be developed using C# (C sharp) that uses .NET from Microsoft.

Anyhow, there are several EXEs there. Please try to run them and check if some of them do what you want. In such case, we could review what external references they use (I see there are several DLLs, but some other external references could be used too).
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Tue Aug 05, 2008 8:46 am

Antonio,
unfortunately these demo programs run not at all expecially in xp.
in w2k start but it does not produce anything.

Mission impossible?
User avatar
MarcoBoschi
 
Posts: 1066
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Tue Aug 05, 2008 9:30 am

If their own examples don't work, my suggestion is that you contact their tech support service
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Tue Aug 05, 2008 12:36 pm

Antonio,
It's a frustration especially becasue this products:
gateway, phone etc. etc. are spectacular.
There are some customer's requests resolvable with little applications...
Thanks again Antonio :D
User avatar
MarcoBoschi
 
Posts: 1066
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy

Postby Antonio Linares » Tue Aug 05, 2008 12:44 pm

Marco,

Anyhow, you could review the contents of those .cs files to see if you get an idea about how they work
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42125
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby MarcoBoschi » Tue Aug 05, 2008 1:37 pm

It's a fact that this samples works.

#include "fivewin.ch"

FUNCTION MAIN()

LOCAL oSoapClient := CREATEOBJECT( "MSSOAP.SoapClient" )

oSoapClient:msSoapInit("http://www.dataaccess.com/webservicesserver/textcasing.wso?WSDL" )

? oSoapClient:InvertStringCase( "lower UPPER" )

RETURN NIL

And this one does not work "at the first statement" ***
FUNCTION MAIN()

LOCAL oPbx := CREATEOBJECT( "MSSOAP.SoapClient30" )

LOCAL hSession, hUser

oPbx:msSoapInit( "http://172.28.2.135/innovaphone/pbx501.wsdl" )

***
oPbx:Location = "http://172.28.2.240/PBX0/user.soap"
User avatar
MarcoBoschi
 
Posts: 1066
Joined: Thu Nov 17, 2005 11:08 am
Location: Padova - Italy


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 39 guests