Generate XML -- client-side or server-side?
-
How would the server know? It's probably more annoyed that you're doing HTTP over 8080
This. From the URL, the domain name part goes into the Host: header, the path goes into the request line. The port number and protocol are not sent as part of the HTTP envelope at all, except in proxy requests.
-
Well, it was just a WAG, and it didn't work anyway, heh.
Tomcat defaults to running on 8080. I could put it on 80 but I would have to read the documentation. The error I got isn't immediately helpful. (I mean, it should have inferred (in this case) http from context.)
IETF says you're probably sending bad XML
EDIT: screw you discourse for bitching that I've posted too much
-
Well, changing Tomcat to listen on port 80 didn't work either, but I have another, more scientific guess, that I didn't send some settings. The XML that I pulled out of their documentation PDF ("if you send this XML, you'll get this response XML") put an empty settings block.
[pause]
Yep, that was it. I added the additional settings XML and got back a "successfully parsed what you sent me".
Thanks, everyone. Now I just have to turn this into something functional, heh.
-
IETF says you're probably sending bad XML
Not bad per se, but not what the receiver was looking for. I blame their documentation for providing inadequate samples.
-
Not bad per se, but not what the receiver was looking for. I blame their documentation for providing inadequate samples.
Correct; 422 is an alias for TDEMSYR
-
-
I provided at least half the data it wanted!
Nobody said it was your fault for not making sense .... Think of it like Server Responses, Linus Torvalds style
-
The good news is the proof of concept portion now works: I get a 200 back instead of a 422, I can extract a URL from the XML I get back, and navigate to that URL in the iframe. COR didn't seem to be an issue in IE, but I had problems in Chrome, but I think they're caching-related. The next step is to generate the XML on the server instead of asking for static stuff, and with that, of course, I can send "don't cache" headers.
Again, thanks, guys.
-
This may be a problem for me a step or three down the road.
By far the easiest way to deal with CORS that I've found is to put a little proxy inside the webapp so that I can make the other sites that I need apparently within. It's definitely not a perfect approach, but it works and doesn't require getting too deep into the mire of Doing It Properly.
PM me if you want me to dig out the code. It's somewhere on my github β though integrated into a larger piece of software β and I've got some notes for setting it up in tomcat tooβ¦
-
PM me if you want me to dig out the code.
If I do, I'll be sure to. I'll be able to test tomorrow if it might be one or not, as I have multiple web servers available, but I didn't want to mess around with this yet until I had minimally-working code.