How would I do a http post with a xml file
How would I do a http post with a xml file.
I have a url called https://localhost:8443/wss/WSS and the XML file is sent as part of the HTTP POST body.
How would I send this XML file when posting?
most people just add feedback to the comments they've asked about already, rather than ignoring all the feedback and making a new post with the exact same information:
http://forum.java.sun.com/thread.jspa?threadID=5247331&messageID=10020973#10020973
If you want to add in an XML file to a POST command, you'd add it just like any other file you'd attach to a post request, especially (if you're request is the same as your last post) if you're just doing a jsp page. I'd do it something like this:
<form method=POST ENCTYPE="multipart/form-data" action="https://rcpdm.mnb.gd-ais.com/Windchill/servlet/IE/tasks/DJK/fcsAddContentComplete.xml">
<H3> File Name </H3>
<input type=file name=filename>
<input type=submit value="Do it!">
</form>Then again, this solution has literally nothing to do with java, and you still need to make sure that your servlet knows what to actually do with that information you're sending it.
Similar Messages
-
How would I do a http post of the below listed XML string within a JSP?
Hi,
How would I do a http post of the below listed XML string within a JSP?
<DoService xmlns="http://www.gdinrw.org/wss" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="WSS" version="1.0">
<ServiceRequest DCP="HTTP_POST" mimeType="text/xml" encoding="UTF-8"><![CDATA[REQUEST=GetCapabilities&SERVICE=WMS]]></ServiceRequest>
<AuthMethod>urn:opengeospatial:authNMethod:OWS:1.0:password</AuthMethod>
<Credentials>guest,guest</Credentials>
<FacadeUrl>https://bern:8443/wss_umn_wms/WSS</FacadeUrl>
</DoService>
Thanks,
JohnYes,
I need to set up data as POST format before I POST it.
To be more specific I know how to post within a JSP if an xml element is like:
<AuthMethod>urn:opengeospatial:authNMethod:OWS:1.0:password</AuthMethod>
where the field is AuthMethod and the value is urn:opengeospatial:authNMethod:OWS:1.0:password
but what I am not sure of is when the field has values embedded within it like:
<ServiceRequest DCP="HTTP_POST" mimeType="text/xml" encoding="UTF-8"><![CDATA[REQUEST=GetCapabilities&SERVICE=WMS]]></ServiceRequest>:
It has a field of ServiceRequest and a value of ![CDATA[REQUEST=GetCapabilities&SERVICE=WMS]]
but it also other value embedded with ServiceRequest like mimeType="text/xml" .
Thanks,
John -
How to generate reportdesign dynamically using java with out xml file
hi
how can i generate a reportdesign dynamically using java with out passing xml file to jasperDesign , i want to create my reportdesign with out xml file
how can i ,please help
thanksLiveCycle does provide a Java API to forms; LiveCycle is in fact a suite of programs, mostly enterprise level for running on server (next to which the cost of the master suite is a drop in the ocean). LiveCycle Designer is perhaps the only end user tool, and it is not for server use and doesn't have an API.
Are you looking for a server solution? If so, nothing in the master suite can help, it isn't for server use. -
Is it possible for ODi to do a "https post" of an xml file?
Hi,
We would like to use ODI to read from a VIEW and within ODI transform to a target using an XSD to generate an XML file and then do a HTTPS POST. Would be grateful for any pointers.
we also ran into issues while transforming using a target xsd. Listed below:
Use Case Context: In an ODI interface, Data from a database view is mapped to a target XSD schema. A package is then created, wherein, in the first step, this interface is executed. Then, in the second and final step, data transferred to the target XSD schema is saved as an XML file using OdiSqlUnload function.
Problems faced in the above mentioned use case:
When the data from the target XSD schema is saved as an XML file using OdiSqlUnload function, the XML does not match the XSD, which was initially imported into ODI.
Regards
ShemaAsk them! Product Feedback
This is a user to user forum. We are all end users like yourself. Know one here knows what Apple is going to do. -
Hi All,
We want to send an HTTP post with parameters, and we are not sure how to do that. We tried to do that like the code below,but we get the parameters in the body and not in the header ...
DATA lo_client TYPE REF TO if_http_client.
DATA lv_status_code TYPE i.
DATA lv_reason TYPE string.
CALL METHOD cl_http_client=>create_by_destination
EXPORTING
destination = 'ZRFC_TEST'
IMPORTING
client = lo_client.
lo_client->request->set_method( if_http_request=>co_request_method_post ).
cl_http_utility=>set_request_uri( request = lo_client->request
uri = '?param1=value1' ).
lo_client->send( ).
lo_client->receive( ).
lo_client->response->get_status( IMPORTING code = lv_status_code
reason = lv_reason ).
Thanks a lot,
Tuvia.Hi,
what do you mean by "parameters on the query". In any http request you can have two types of variables: POST or GET. The post variables are transferred in http header and you can add them using methods from my previous post. GET variables are transferred in URL. HTTP client has a method APPEND_FIELD_URL which can be used to add variable into URL string.
Cheers -
HTTPS post with certificate - certificate exception
Hi,
I am trying to create java program to do HTTPS post with certiticate.
I get certificate in *.P12 file. When I open HttpsURLConnection I have received exception : javax.net.ssl.SSLException: No certificate authorities are registered for this secure application
during startHandshake. I run java with properties
-Djavax.net.ssl.keyStore=value -Djavax.net.ssl.keyStorePassword=value -Djavax.net.ssl.keyStoreType=pkcs12
Shell I use JKS (trustStore properties) for server certificate ? Or I have to add some more code ?
Thanks in advance
MI am trying to create java program to do HTTPS post with certiticate.Do you mean that the server requires client authentication and the clients each have a keypair and signed certificate in their keystore?
Shell I use JKS (trustStore properties) for server certificate?Yes. But you need to find out whether the server's certificate is self-signed or signed by a CA. If it is self-signed you will have to get them to export it, and import it into the truststore of each client. NB not the keystore of each client.
Or I have to add some more code ?No. -
How can I do an email merge with a PDF file?
How do you do an email merge with a PDF file?
Read this:
http://forums.adobe.com/thread/1085319?tstart=0 -
How do I synchronise audio and video with an mpg file created in elements 11 ?
How do I synchronise audio and video with an mpg file created in Premier Elements 11 ?
The source files are VOB files, and there is no problem with those source files. But after creating the mpg file, the audio can be out of sync by 1 second or even 10 seconds, and sometimes zero seconds (ie perfectly OK). That varies. The variation might be linked to some of the VOB files. ie. some are OK, and some are not.
Can I fix this automatically in Elements 11, or am I doing something wrong ?Hartwood,
First, Premiere (both Pro and Elements) do not handle MPEG Audio perfectly - they like some files, but not all files with MPEG Audio. That makes a VOB a less-than-perfect source file. Still, with a bit of work, one should be able to edit it just fine. One of the factors is that there is a very slight block-size difference between the Encoded Video Stream and the Encode Audio Stream in a muxed MPEG-2 file. That often does not play into things, but can cause slight OOS (Out of Sync) issues. Also, both Premieres need to create all I-Frame files for the Video Stream, which is in GOP (Group of Pictures) structure, so what one sees on the Timeline is really a proxy of the MPEG-2 file's Video Stream. The Audio Stream must also be Conformed to PCM/WAV @ 48KHz 32-bit floating point, to be edited. That Conforming is perfect when one has PCM/WAV @ 48KHz 16-bit for the Audio Stream, but requires more work, when the Audio Stream is MPEG (one reason that some MP3's do not work well in Premiere). Several factors involved here, and a fair amount of work for the program. That is why DV-AVI Type II w/ 48KHz 16-bit PCM/WAV Audio works so perfectly.
Now, fixing OOS might be easy, or might require a bit more work. This article goes into some workflows, that might be helpful: http://forums.adobe.com/thread/436751?tstart=0
I can feel your pain, as I almost went crazy trying to fix OOS in a client's Project. They ONLY had the finished DVD, from which to work. The disc met the DVD-standards, so everything ripped/Imported fine, and when the simple edits were done (IIRC, there were four scenes, that had to be shortened, and then several Titles added), everything played fine in the Timeline. However, when I Transcoded that Timeline to be authored in Adobe Encore, two scenes went OOS. I went back to Premiere, and checked - all perfect there. I tried to judge the number of Frames that the Audio was out, in those scenes, and nudged them, tested, nudged, tested, and no matter what I did, I could never get the output files perfect, when Imported into Encore for authoring to DVD-Video. I tried DV-AVI, and letting Encore set the Transcoding automatically (usually a great way to work), I tried manually setting the Transcoding in Encore. I tried outputting to MPEG-2 from Premiere, and Importing that. No matter what I did, those two scenes were just OOS, and I could not even seem to improve them - it was like they were just locked OOS. I finally did some more editing, to break things up a bit, added a cut-away shot here, and there, and minimized the perceived OOS, but could never get it perfect. It was like trying to pick up quicksilver with a pair of tweezers!
Good luck,
Hunt -
Begging for help with podcast xml file
Hey All,
I have a podcast on iTunes. I am hosting the xml file and podcast mp3s on a friends server so Im not using any service. Everything is working and Ive sucessfully added 4 podcasts so far, and it shows up correctly in iTunes on my PC.
However my podcasts do not showup correct in the iTunes store website, or on idevices. Meaning, I number my shows 001_"NAME" 002_"NAME" etc. Yet in the iTunes store they show up out of order. So my last show is not at the top its at the bottom, and they are all mixed up (like 002, 001, 004, 003 instead of 4,3,2,1) Also the publish date is the same on two of them (and not what i have in the xml file) and doesnt show up at all on the other two. I assume this is a problem with the xml file, yet I dont see any problems with it. But it seems odd that it all works correctly in the actual iTunes program. Ive tried different code, but im very much a noob at it, and everything i find online is from 5 - 10 years ago or wants you to host your podcasts with their site and I dont need that.
Here is the link to the show on the iTunes website so you can see what i mean: http://itunes.apple.com/us/podcast/your-reality-recap/id501295325
If anybody can, would you mind checking out the code in my xml file and letting me know if you see anything thats causing this issue?
I zipped the xml file and put it here: http://www.ericcurto.com/podcast/YRR.zip
I would be truly greatfuly for any help with this. Ive been trying to fix this for days and dont know what else to do.
Thanks!
EricYour feed is at http://www.ericcurto.com/podcast/YourRealityRecap.xml (please always post the feed URL, not its contents or a copy).
I don't see the issues you mention. The order in the Store and when subscribing is what I would expect:
The order in the Store depends on clicking the header to the column: the default is the first one. Some of the dates are a day out - this is quite commmon and is probably a time zone issue (it may be different where you are - I'm in the UK). I don't know why you are seeing a garbled order unless you've clicked on one of the other columns in the Store. -
How can I delete only one part of my xml file?
Hello,
I stored more than 100 users in only one xmltype column. For instance
Create table agro(users XMLTYPE);
... and I inserted all users inside
INSERT INTO agro values(XMLTYPE
('<?xml version="1.0" encoding="ISO-8859-1"?>
<authentication><users><user>
<name>cocoon</name>
<password>cocoon</password>
<role>admin</role>
<title>Mr.</title>
<firstname>Walter</firstname>
<lastname>Cocoon</lastname>
<company />
<street />
<zipcode />
<city />
<country>DE</country>
<phone />
<fax />
<email />
<bankid />
<bankname />
<accountid />
</user>
... another user, etc.
</users></authentication>'));
Now I tried to delete only one part of this file. For example all persons with the name"cocoon".
I used for this target the following statement:
DELETE FROM agro agro
WHERE agro.users.extract('authentication/users/user/text()').getStringVal()= 'cocoon';
When I execute this statement, Oracle DB delete all users and not only with the name "Cocoon".
How can I delete only one part of my xml file?
Kind Regards
M RThis the expected behavoir. You uploaded a document containing multiple users and then asked XML DB to delete any documnet that contained a user with the name in question. The problem here is that you are creating a mega document that contains an aggregation of user documents but then trying to work with individual user documents. This is a bad idea.
In general XML does not understand the concept of a collection of documents. It can only operate on one document at a time. Hence the tendancy to aggregate individual documents into a single larger document. Once you have an XML database, you can perform operations on collections of document, as easily as you can perform operations on individual documents, so the need to aggregate the individual documents together disappears.
If you store each user document as a seperate document then your delete will work as expected. -
Build a web gallery with amazing flash slideshows with dynamic XML files
Build a web gallery with amazing flash slideshows with dynamic XML files
Screenshot:
Features
Features
Transitions, zooming and panning effect You can choose from Random, Wipe from Left, Fade to White, Cross Expansion and other 60-plus transition effects. Zooming and panning effect is optional for advanced flash templates.
XML-driven This flash slideshow are XML-driven. The XML document allows more personalized controls over the flash.
Auto-playback and repeat mode The flash slideshow will play automatically after preloading, and it can repeat playback.
Dynamic customization Besides XML control, the advanced templates provide many more custom options, so that you can create slideshow that fits into your existing web design: width , height, border color, background color, thumbnail size, etc. More about dynamic customization
Usage and demo visit: http://webdesigndevelopment.blog.com...swf-xml-files/Please excuse the bump...
Anyone with a LR flash gallery that starts with slideshow in play mode?
Can it even be set to do this?
The only code in the style.xml that looks like it might be realted is line 12 <playOptions playMode="pause"/>, changing that to "play" does nothing.
Thanks,
Donnie -
Revision: 3638
Author: [email protected]
Date: 2008-10-14 16:49:56 -0700 (Tue, 14 Oct 2008)
Log Message:
Changing the build order of swc file update with dita xml files.
By default this would now happen during the checkintests target - so "ant clean main" shouldn't get affected.
To opt out use -Dno.doc=true
QA: No
Doc: No
Tests: checkintests
Modified Paths:
flex/sdk/trunk/build.xml
flex/sdk/trunk/frameworks/build.xml
flex/sdk/trunk/frameworks/projects/airframework/build.xml
flex/sdk/trunk/frameworks/projects/flash-integration/build.xml
flex/sdk/trunk/frameworks/projects/flex/build.xml
flex/sdk/trunk/frameworks/projects/flex4/build.xml
flex/sdk/trunk/frameworks/projects/framework/build.xml
flex/sdk/trunk/frameworks/projects/haloclassic/build.xml
flex/sdk/trunk/frameworks/projects/rpc/build.xml
flex/sdk/trunk/frameworks/projects/utilities/build.xmlRevision: 3638
Author: [email protected]
Date: 2008-10-14 16:49:56 -0700 (Tue, 14 Oct 2008)
Log Message:
Changing the build order of swc file update with dita xml files.
By default this would now happen during the checkintests target - so "ant clean main" shouldn't get affected.
To opt out use -Dno.doc=true
QA: No
Doc: No
Tests: checkintests
Modified Paths:
flex/sdk/trunk/build.xml
flex/sdk/trunk/frameworks/build.xml
flex/sdk/trunk/frameworks/projects/airframework/build.xml
flex/sdk/trunk/frameworks/projects/flash-integration/build.xml
flex/sdk/trunk/frameworks/projects/flex/build.xml
flex/sdk/trunk/frameworks/projects/flex4/build.xml
flex/sdk/trunk/frameworks/projects/framework/build.xml
flex/sdk/trunk/frameworks/projects/haloclassic/build.xml
flex/sdk/trunk/frameworks/projects/rpc/build.xml
flex/sdk/trunk/frameworks/projects/utilities/build.xml -
Problems with reading XML files with ISO-8859-1 encoding
Hi!
I try to read a RSS file. The script below works with XML files with UTF-8 encoding but not ISO-8859-1. How to fix so it work with booth?
Here's the code:
import java.io.File;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import java.net.*;
* @author gustav
public class RSSDocument {
/** Creates a new instance of RSSDocument */
public RSSDocument(String inurl) {
String url = new String(inurl);
try{
DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
Document doc = builder.parse(url);
NodeList nodes = doc.getElementsByTagName("item");
for (int i = 0; i < nodes.getLength(); i++) {
Element element = (Element) nodes.item(i);
NodeList title = element.getElementsByTagName("title");
Element line = (Element) title.item(0);
System.out.println("Title: " + getCharacterDataFromElement(line));
NodeList des = element.getElementsByTagName("description");
line = (Element) des.item(0);
System.out.println("Des: " + getCharacterDataFromElement(line));
} catch (Exception e) {
e.printStackTrace();
public String getCharacterDataFromElement(Element e) {
Node child = e.getFirstChild();
if (child instanceof CharacterData) {
CharacterData cd = (CharacterData) child;
return cd.getData();
return "?";
}And here's the error message:
org.xml.sax.SAXParseException: Teckenkonverteringsfel: "Malformed UTF-8 char -- is an XML encoding declaration missing?" (radnumret kan vara f�r l�gt).
at org.apache.crimson.parser.InputEntity.fatal(InputEntity.java:1100)
at org.apache.crimson.parser.InputEntity.fillbuf(InputEntity.java:1072)
at org.apache.crimson.parser.InputEntity.isXmlDeclOrTextDeclPrefix(InputEntity.java:914)
at org.apache.crimson.parser.Parser2.maybeXmlDecl(Parser2.java:1183)
at org.apache.crimson.parser.Parser2.parseInternal(Parser2.java:653)
at org.apache.crimson.parser.Parser2.parse(Parser2.java:337)
at org.apache.crimson.parser.XMLReaderImpl.parse(XMLReaderImpl.java:448)
at org.apache.crimson.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:185)
at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:124)
at getrss.RSSDocument.<init>(RSSDocument.java:25)
at getrss.Main.main(Main.java:25)I read files from the web, but there is a XML tag
with the encoding attribute in the RSS file.If you are quite sure that you have an encoding attribute set to ISO-8859-1 then I expect that your RSS file has non-ISO-8859-1 character though I thought all bytes -128 to 127 were valid ISO-8859-1 characters!
Many years ago I had a problem with an XML file with invalid characters. I wrote a simple filter (using FilterInputStream) that made sure that all the byes it processed were ASCII. My problem turned out to be characters with value zero which the Microsoft XML parser failed to process. It put the parser in an infinite loop!
In the filter, as each byte is read you could write out the Hex value. That way you should be able to find the offending character(s). -
Printing invoice with only XML file
Hi all,
I have a problem. When the invoice print with XMLP 5.6.2 is OK, but users want the possibility to reprint the same invoice with the same informations when they want (same if the bill's addresse has changed, for example). Is it possible to reprint the invoice with the XML file generated at the first time and how?
ThanksYou can do this by running XML Report Publisher and selecting the original request that was run. This will pick up the original XML and apply it to the specified template to recreate the original invoice(s).
Cheers,
Dave -
How to get nodes and its attributes of an XML file usiong DOM parsing?
how to get nodes and its attributes of an XML file usiong DOM parsing?
i am new to XML parsing.......
Thanking you........import org.w3c.dom.Document;
import org.w3c.dom.*;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.DocumentBuilder;
import org.xml.sax.SAXException;
import org.xml.sax.SAXParseException; ...
//Setup the document
DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();
Document doc = docBuilder.parse (new File("MY_XML_FILE.xml"));
//get elemets by name
String elementValue = doc.getElementsByTagName("MY_ELEMENT").item(0).getTextContent();
//This method can return multiple nodes, in this instance I get item(0) , first nodeRead the api for other methods of getting data.
Maybe you are looking for
-
How to get schedule line date copied to "First date" in sales order
Dear forum I am creating a sales order as normal and put in a Requested Delivery Date (KETDAT) for the order. This requested delivery date is then copied to the "First date" (ETDAT). Now, the ATP is checked for each line item in the order and a Sched
-
Java.io.Reader - java.io.InputStream
Hi! Is there a way to wrap a java.io.Reader into an java.io.InputStream (like java.io.InputStreamReader does but in the other direction)? I found now class doing this job (deduced from java.io.InputStream, taking an java.io.Reader as Constructor Para
-
Can anyone plz give me sample code to handle pageup, nextpage, previouspage, lastpage options for a table in screen in Dialog Program. Thanks.
-
I have multiple podcasts that seem to have become their own animal. For example, I have two podcasts with the name "Focus on the Family". One, correctly updates and has podcasts in it from September 1, 2006. The other, also named "Focus on the Family
-
Adobe Captivate Help | Text captions
This question was posted in response to the following article: http://helpx.adobe.com/captivate/using/text-captions.html