Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [vtp-dev] VTP 3.0 with WebService

Marcus,

If you want to use the built-in "Webservice" module, drag-and-drop your
WSDL file for the web service to that folder to create the necessary
objects.

You can also perform web service calls from JavaScript.  Drag the
following Axis2 JARs to your project's Dependencies folder:

axiom-api
axiom-impl
axis2-kernel
backport-util-concurrent
commons-codec
commons-httpclient
commons-logging
neethi
wsdl4j
XmlSchema

Then modify the attached JavaScript file to comply with your WSDL
descriptor and put it into a Script block on your Call Flow canvas (suit
getPayLoad() to match your web service call, etc.).

The attached script was used for when a client of ours needed to fill
the openVXML run-time variable "page_to_fax" with base64-encoded PDF
data from a web service to be passed on to a custom faxing module I
wrote.

Use the "Variables.*" namespace in JavaScript to fill or query variables
created by the openVXML run-time.  Variables in this namespace can be
referenced later in your Call Flow with assignment, comparison, or
prompt blocks (in openVXML variable names are not prefixed by
"Variable.", only in JavaScript).

This is also a good example for advanced uses of JavaScript in openVXML!

Hope this helps,

Derek P. Moore
OpenMethods
Software Developer


-----Original Message-----
From: vtp-dev-bounces@xxxxxxxxxxx [mailto:vtp-dev-bounces@xxxxxxxxxxx]
On Behalf Of Marcus
Sent: Monday, September 01, 2008 5:34 PM
To: vtp-dev@xxxxxxxxxxx
Subject: [vtp-dev] VTP 3.0 with WebService

Hi,

I tried to created a application using VTP 3.0 with Webservice but when
i was
configured the webservice clicking with button right above the folder
Webservice didn't appeared the option create Webservice.
Anyone can help me?

Regards
--
).:M@(r)(c)U$:.(




_______________________________________________
vtp-dev mailing list
vtp-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/vtp-dev
var client = new Packages.org.apache.axis2.client.ServiceClient(null,
                 new java.net.URL("https://testdocumentservice.com/DocumentService/DocumentService.asmx?wsdl";),
                 new Packages.javax.xml.namespace.QName("http://tempuri.org/";, "DocumentService"),
                 "DocumentServiceSoap");

function getPayLoad()
{
	var fac = Packages.org.apache.axiom.om.OMAbstractFactory.getOMFactory();
	var omNs = fac.createOMNamespace("http://tempuri.org/";, "");
	var method = fac.createOMElement("GetDeclaration", omNs);
	var policy = fac.createOMElement("policynumber", omNs);
	policy.setText("0101010101");
	method.addChild(policy);
	var token = fac.createOMElement("Token", omNs);
	token.setText("DocumentService@ACME");
	method.addChild(token);
	java.lang.System.out.println(method.toString());
	return method;
}

var ret = client.sendReceive(new Packages.javax.xml.namespace.QName("GetDeclaration"), getPayLoad());
var data = ret.getFirstElement();
Variables.page_to_fax = data.getText();

java.lang.System.out.println(Variables.page_to_fax);

Back to the top