These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Problems calling an JAVA2EE web service using JavaScript

Barthuin
Registered: Apr 24 2008
Posts: 45

Hi everybody

i'm trying to use a WebService in my xdp but I have found some problems with that. I have to try two ways.

first of them works fine. I have created a data connection and if I draw and drop the parameters and the button, it works fine. But I don't want to do it in this way.

In the another way I have done, i have created two fields, one of them with this code in exit event

var myProxy = SOAP.connect("http://host/AxisWSTest/services/Converter?wsdl");

var result = myProxy.prueba("test message");

xfa.host.messageBox("" + result);
subformulario.CampoTexto2.rawValue = result;

Prueba method should to send this message "Ha enviado el texto test message" but it sends "null" instead of "test message"

With the first way, it works fine and I receive the right message "Ha enviado el texto test message"

What do I do wrong? any idea for that? Any suggestion is very appreciatted

Thanks in advance.

Dani

Barthuin
Registered: Apr 24 2008
Posts: 45
I have tried with this code

var valor = this.rawValue;

var echoStringRequest = {
prueba:{value:valor}
};
var mySOAPAction = "http://host/AxisWSTest/services/Converter?wsdl";

var response = SOAP.request ({
cURL: "http://host/AxisWSTest/services/Converter?wsdl",
oRequest: echoStringRequest,
cAction: mySOAPAction
});

And the WS receive the value correctly. Would it be the right way? Is there another better solution?

With that new code, i have a new problem. How can I get the response?

I have tried with this

var responseString = "http://host/AxisWSTest/services/Converter?wsdl:prueba";
var result = response[responseString]["return"];

subformulario.CampoTexto2.rawValue = result;

but I have this error

TypeError: response[responseString] has no properties
28:XFA:Formulario1[0]:subformulario[0]:CampoTexto1[0]:exit

Any idea?
Barthuin
Registered: Apr 24 2008
Posts: 45
I have tried to find some solution for this but i couldn't resolve it. Please, someone can help? Thanks in advance.

Dani
Barthuin
Registered: Apr 24 2008
Posts: 45
I have done SOAP.wireDump = true; and this is the code

<?xml version="1.0"?>
bla<?xml version="1.0" encoding="UTF-8"?>Ha enviado el texto blaand then, i have tried using

var result = response[0].soapValue[0].soapValue;

but I had this error

TypeError: response[0] has no properties

someone could help, please?
Barthuin
Registered: Apr 24 2008
Posts: 45
I have been trying this

var result = response["http://host:8081/AxisWSTest/services/Converter:pruebaResponse"]["pruebaReturn"];

but when I do xfa.host.messageBox(""+result); I receive "undefined"

It seems like I can get the response but it's empty. Why if in the xml response is the right value?