webservice return xml

Startbeitrag von Miguel C. am 09.11.2014 23:01

Hi all,
I'm creating a webservice that will receive xml file and return other xml file with, among other informations, a base64 pdf file.

In the Test Page everything works fine, but when creating a simple page to consume that webservice, the system hangs.
I've found that it depends on the content of the output xml file.

I created a very simple webservice and webservice call just to explain the problem.


WEBSERVICE:

PROCEDURE fTeste(sParam is string):string
//sParam: not used
sXml is string= fLoadText("C:\OUT.XML")
sXml=XMLExtractString(sXml,"Document")
RESULT sXml


WEBSERVICE CALL:

pIn is TO fTeste
pOut is TO fTesteResponse

pIn.sParam=""
pOut=fTeste(pIn)

Info(pOut.fTesteResult)


Even removing the attribute contentType="application/pdf", the system hangs.

OUT.XML (the original file has 262KB). I removed part of the file content.


09-11-2014 19:34:43
C:\Docs\20141109193442828.xml
JVBERi0xLjMNCiX/////MTI0MA0KMSAwIG9iag0KPDwNCi9UeXBlIC9DYXRhbG9nDQovUGFnZXMg
NCAwIFINCi9PdXRsaW5lcyAyIDAgUg0KPj4NCmVuZG9iag0KMiAwIG9iag0KPDwNCi9UeXBlIC9P
dXRsaW5lcw0KL0NvdW50IDANCj4+DQplbmRvYmoNCjMgMCBvYmoNClsvUERGIC9UZXh0IC9JbWFn
ZUNdDQplbmRvYmoNCjQgMCBvYmoNCjw8DQovVHlwZSAvUGFnZXMNCi9Db3VudCAxDQovS2lkcyBb
NDEgMCBSXQ0KPj4NCmVuZG9iag0KNSAwIG9iag0KPDwNCi9UeXBlIC9Gb250DQovU3VidHlwZSAv
VHlwZTANCi9OYW1lIC9GMQ0KL0Jhc2VGb250IC9mb24wDQovRW5jb2RpbmcgL0lkZW50aXR5LUgN
FFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFABRRRQB//9kNCmVuZHN0cmVh
bQ0KZW5kb2JqDQp4cmVmDQowIDQ1DQowMDAwMDAwMDAwIDY1NTM1IGYNCjAwMDAwMDAwMjEgMDAw
MDAgbg0KMDAwMDAwMDA5MyAwMDAwMCBuDQow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MDAwMCBuDQowMDAwMDk0MDgxIDAwMDAwIG4NCjAwMDAwOTc2OTQgMDAwMDAgbg0KMDAwMDE3Nzg0
OSAwMDAwMCBuDQp0cmFpbGVyDQo8PA0KL1NpemUgNDUNCi9Sb290IDEgMCBSDQovSURbDQooKSgp
XQ0KPj4NCnN0YXJ0eHJlZg0KMTk3MDYwDQolJUVPRg0KAA==


Thanks in advance
MC

Antworten:

Hi,

I Work with webservices in Windev/Webdev and result string should just give you a string.

1. Is there a limit on the string size you can send via WebService (I think it is set somwhere in ISS)
2. Why the XMLExtractString command why not send everything and do the XMLExtractString when file is receivied.
3. Perhaps unicodetoansi / UTF8ToAnsi needs to be executed agains the string ? (Or xmltotext)

Cheers
Tor-Bjarne

von Tor-Bjarne - am 11.11.2014 10:19
Hi,

1. The files are small.
2. Because, the original file as the declaration on top
And because the http response already has the declaration, I must include only the "data" from the file.
3. I've tried some options, but my development machine hangs on each try... 10 minutes to reboot an load all development tools again... and again... and again...

I've installed SOAP Gui and finally I can call the webservice both locally and remotly.

von Miguel C. - am 11.11.2014 23:20
Hi,

Well I tried this, since it`s only a 5 min test.

Webservice code:

PROCEDURE GetXMLFile()
s is string
HExportXML(CallDate,DWDIR+"\test.xml") //Export the calldate table to XML
s = fLoadText(DWDIR+"\test.xml")
RESULT s //Send to client


Client Code on a button:

s is string = GetXMLFile()
Info(s)
fSaveText(fExeDir()+"\test.xml",s)
ShellExecute(fExeDir()+"\test.xml")


If you like you can try it yourself, the description file is at:
http://46.165.204.155/WS18_WEB/awws/WS18.awws?wsdl

Image from the info(s) statement:


von Tor-Bjarne - am 12.11.2014 09:25
Tor-Bjarne,

Didn't tested yet, but the problem may be in the encoding.
When not mentioned "string" is "unicode string" and the OUT.XML file is in UTF-8 (thank you Fabrice...).

As I said, not testes yet, but I will...

von Miguel C. - am 14.11.2014 13:23
Zur Information:
MySnip.de hat keinen Einfluss auf die Inhalte der Beiträge. Bitte kontaktieren Sie den Administrator des Forums bei Problemen oder Löschforderungen über die Kontaktseite.
Falls die Kontaktaufnahme mit dem Administrator des Forums fehlschlägt, kontaktieren Sie uns bitte über die in unserem Impressum angegebenen Daten.