Problem in creation of webservices

Xavi_qsoft

New Member
Good Morning.

I was trying to create a webservice and consume it from progress but I'm having a problem when consuming it, and not where the problem comes.

I'm working with version Progress 10.2a (license OE Workgroup RDBMS and OE Studio).
And install webserver Apache with Tomcat.

And copy de directory <progress install>servlets\wsa to <dir install Tomcat>webapps\

So far so good, when i call to url http://localhost:8080/wsa/wsa1 in the IE give a positive response:
WSA Web Services
Status:wsa1:OK:111

In the Progress Explorer Tool I hace created and running the services AppServer (asbroker1), NameServer (NS1) and WSA Webservices adapter (WSA1).
In Wsa1 i have the webservices "TestCIAL" created with Proxygen Generator, all i think is correct, when i push Status in WSA1 tell me:
Web Services Adapter wsa1 is running
WSA Administration: Enabled
Web Services: Enabled
WSDL Retrieval: Enabled
And when i push "Status" in "TestCIAL" show me:
TestCIAL
Target NameSpace: urn:tempuri-org
Status : ENABLED
AppServerInfo : Appserver://localhost:5162/asbroker1
Session Model : Free
Style/Use : Document/Literal
Application properties:
appServerKeepalive : denyClientASK,denyServerASK
appServiceHost : localhost
appServiceName : asbroker1
appServicePort : 5162
appServiceProtocol : Appserver
....
Everythink seems ok.

But when i tried to consume this webservices gives a error:
The code to consume is:
DEFINE VARIABLE hWSDL AS HANDLE.
DEFINE VARIABLE HCIALObj AS HANDLE.
DEFINE VARIABLE RESPUESTA1 AS CHARACTER NO-UNDO.
DEFINE VARIABLE CLIENTEID AS CHARACTER NO-UNDO INITIAL 1.

CREATE SERVER hWSDL.
hWSDL:CONNECT ("-WSDL 'c:\SERVIDORWEB\Tomcat\webapps\wsa\wsa1\TestCIAL.wsdl'").
RUN TestCIALObj SET HCIALObj ON SERVER hWSDL.

RUN FORClientes IN HCIALObj(INPUT CLIENTEID, OUTPUT RESPUESTA2).
MESSAGE RESPUESTA1 VIEW-AS ALERT-BOX.

DELETE PROCEDURE HCIALObj.
hWSDL:DISCONNECT().
DELETE OBJECT hWSDL.

When executed then run FORClientes... generates the following error:
Operacion Web services FORClientes generó un SOAP Fault. SOAP faultstring es: Se detecto un error durante la ejecucion de la peticacion web Service (10893) (11506).
And in the log wsa1.wsa.log:
[10/03/18@11:11:27.390+0100] P-005748 T-http-8080-1 2 MaestroCIAL 4GL-Provider Error en petición de ejecución de SOAP: Connect Failure: Timeout or Interrupt occurred while attempting to communicate with NameServer. (8231) (10926)

Any idea? Problem with configuration of Explorer Tool? the configuration of Tomcat?
Or the creation os wsdl with proxy generator and this procedure?
For more information the code os procedure:

DEFINE INPUT PARAMETER CustomerNumber AS INTEGER.
DEFINE OUTPUT PARAMETER CustomerName AS CHARACTER.

IF CustomerNumber = 1 THEN ASSIGN CustomerName = "TESTE CLIENTE 1".
ELSE ASSIGN CustomerName = "TESTE CLIENTE ".
 

rstanciu

Member
The encoding type is: Document/Literal , and in this case you have a new parameter to add: 4GL RETURN-VALUE
try:
DEF VAR result AS CHAR.
RUN FORClientes IN HCIALObj(INPUT CLIENTEID, OUTPUT result, OUTPUT RESPUESTA2).
 

Xavi_qsoft

New Member
Thanks but had already seen it, I tried typed document / literal and RPC / Literal and gives the same error.

I'm thinking it must be a configuration error, the java jdk, the tomcat or progress.
The license necessary is OE Studio? or necessary any more?

Thanks
 

Xavi_qsoft

New Member
Good Morning.

Well, I reinstall Progress and Tomcat and now the webservices is working correctaly.
But I have another question, i consume the webservices perfectly from Progress and also from Flex.
But when the result of .r of webservices is greater than 32k the progress tell me a error: XML string is out of range for 4GL type character (11852). From Flex are not giving this error.
How to do this in progress for when is greater tan 32k? Using MEMPTR when consume de webservices in progress?

Thanks
 

rstanciu

Member
You can use a LONGCHAR on OUTPUT, a MEMPTR, TEMP-TABLE, DATASET but the XML format is very verbose.

XML is dead (2001), use JSON instead (on OE v.10.2B) ... is the better ideea, you can win 50% of network traffic.


Code:
ASSIGN
  cTargetType     = "FILE"
  cFile           = "ttCust.json"
  lFormatted      = TRUE
  cEncoding       = ?.

lReturnValue = httCust:WRITE-JSON(cTargetType, cFile, lFormatted, cEncoding).

Code:
{"ttCust": [
  {
    "CustNum": 1,
    "Country": "USA",
    "Name": "Lift Tours",
    "Address": "276 North Drive",
    "Address2": "",
    "City": "Burlington",
    "State": "MA",
    "PostalCode": "01730",
    "Contact": "Gloria Shepley",
    "Phone": "(617) 450-0086",
    "SalesRep": "HXM",
    "CreditLimit": 66700.00,
    "Balance": 903.64,
    "Terms": "Net30",
    "Discount": 35,
    "Comments": "This customer is on credit hold.",
    "Fax": "",
    "EmailAddress": ""
  },
  {
    "CustNum": 2,
    "Country": "Finland",
    "Name": "Urpon Frisbee",
    "Address": "Rattipolku 3",
    "Address2": "",
    "City": "Oslo",
    "State": "Uusima",
    "PostalCode": "45321",
    "Contact": "Urpo Leppakoski",
    "Phone": "(603) 532 5471",
    "SalesRep": "DKP",
    "CreditLimit": 27600.00,
    "Balance": 437.63,
    "Terms": "Net30",
    "Discount": 35,
    "Comments": "Ship all products 2nd Day Air.",
    "Fax": "",
    "EmailAddress": ""
  },
  {
    "CustNum": 3,
    "Country": "USA",
    "Name": "Hoops ",
    "Address": "Suite 415",
    "Address2": "40 Grove St.",
    "City": "Atlanta",
    "State": "GA",
    "PostalCode": "02112",
    "Contact": "Michael Traitser",
    "Phone": "(617) 355-1557",
    "SalesRep": "HXM",
    "CreditLimit": 75000.00,
    "Balance": 1199.95,
    "Terms": "Net30",
    "Discount": 10,
    "Comments": "This customer is now OFF credit hold.",
    "Fax": "",
    "EmailAddress": ""
  }
]}
 

RealHeavyDude

Well-Known Member
The OE Studio license contains server products - but you can only connect to them from the localhost. They are there just for testing/development purposes. If you want to run a OpenEdge WebService to which you can connect from another machine you need the AppSever license which contains all OpenEdge products you need. The OE Studio license, though, contains the ProxyGen tool which you need to generate the .wsm file for deploying the WebService.

Regards, RealHeavyDude.
 

Xavi_qsoft

New Member
Thanks RsTanciu.

Really did not know the concept of JSON, but I read a little about JSON and I see it is better than xml, It is very interesting.
But JSON is only available in OpenEdge 10.2B? Actyally I have 10.2A, I will think to update to 10.2B.
 
Top