Custom Processor; Make xml "instance" Like an .xml File???
Posted by
Randy Smith-9 on
Jan 08, 2010; 9:48pm
URL: https://discuss.orbeon.com/Custom-Processor-Make-xml-instance-Like-an-xml-File-tp1010018.html
All,
Hope I can make this make sense if no one else has had to do this :-) !
I need to pass an Orbeon XForms xml "instance" to a custom processor
and then have the custom processor call my java classes to convert
the xml "instance" to a file (because it currently expects an xml
file as input) then do something like:
RequestEntity re = new InputStreamRequestEntity(new FileInputStream(file));
PutMethod method = new PutMethod(request);
method.addRequest Header ("Content-Type", "application/octet-stream");
method.setRequestEntity(re)
int statusCode = client.executeMethod(method);
if (statusCode != HttpStatus.SC_OK) {
System.out.println("method failed: " + method.getStaturLine());
}
to build an HttpClient call to a REST web service then get
a response back from the REST webservice.
Questions:
1. How to convert the Orbeon XForms xml "instance" to a file and use the
current code OR pass the Orbeon XForms xml "instance" directly (somehow)
to a set of code that builds the REST web service call. In short, it needs
to achieve the same thing as the streaming "application/octet-stream"
in the code above which uses:
RequestEntity re = new InputStreamRequestEntity(new FileInputStream(file));
2. So, again, in summary:
a. I have an Orbeon XForms xml instance that needs to be passed to a
custom processor that then calls the Java classes that builds the REST HttpClient web service
call (see java code above) which then returns a string.
b. What is the best approach to achieve the same thing as using the code above?
Thanks for any help,
Randy
Also,
I sent this question earlier (which is related to the above one) but for some reason I was deleted from the
ops mailing list and did not get a response.
Hopefully I'm back on now.
If someone answered the following question maybe it could be forwarded to me. ;-)
Thanks,
I'm trying to develop a custom processor that will call a suite of web
services. I have the Java code used in another app and want to have an
XForms app send an instance to the processor which in turn will pass the
instance to the Java classes and then on to the proper web service.
For the environment I have an Orbeon nightly build .war running under
Tomcat. I say that because I'm not sure I have everything I need to get
the Java code compiled.
I read the documentation on the Java Processors but I have the following
questions:
1. Do I have to have a /java directory somewhere (i.e. sourcepath=
oxf./java) in the "resources" for the Java code to be compiled?
2. I have the files in a directory with the "apps" under the
"resources" directory but it is not called /java. I cannot tell if the
Java code is being compiled when I refresh the browser that executes my
XForm.
Thanks,
Randy
--
You receive this message as a subscriber of the
[hidden email] mailing list.
To unsubscribe: mailto:
[hidden email]
For general help: mailto:
[hidden email]?subject=help
OW2 mailing lists service home page:
http://www.ow2.org/wws