Re: [flexcoders] HTTPService POST with request parameters
Jeff Thanks for the reminder about the additional ATG methods to the query parameters (getURLParameter()). However, that didn't help in this case. Turns out I had to append my query parameters to the URL of the HTTPService in ActionScript (i.e. getSponsor.url += ?o=sponsora=put) to get Flex to send them. Todd On 12/5/06, Jeff Vroom [EMAIL PROTECTED] wrote: Possibly the issue is due to the fact that you have both query string parameters and POST data parameters in the same request. I think that ATG used to have a bug where the query parameters are not returned by the getParameter method if the request has method=POST. They expose another method on the DynamoHttpServletRequest called getQueryParameter which will always return the query parameters. I vaguely recall that bug got fixed at some point but it has been a long time since I worked for ATG. One nice thing about ATG is that if you do a toString on the request object, it dumps out all of the state of the request. That might be a way to ensure that the query parameters are at least making it to the server in the URL. Jeff -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Todd Breiholz *Sent:* Tuesday, December 05, 2006 2:57 PM *To:* flexcoders@yahoogroups.com *Subject:* Re: [flexcoders] HTTPService POST with request parameters Tracy Correct, the model data is getting there, but not the querystring parameters. I also noticed about the mx:objects in the post. It was an error and I was getting really screwy data on the server. I've since changed the bindings to point to the text property of the objects and the post body is being sent correctly (I also had to add contentType=application/xml to my HTTPService. After making those changes, I am still seeing the same behavior as before (with a valid post body, now). The server platform is ATG (Java servlet based). When I try to extract the 2 request parameters, I get null for both of them. Thanks! Todd On 12/5/06, *Tracy Spratt* [EMAIL PROTECTED] wrote: So the model data is getting into the server, but the url querystring parameters are not? Also, you are passing an mx:Object in the post body to the server. Is that working? What does it look like on the server? What is the server platform? Tracy -- *From:* [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] *On Behalf Of *Todd Breiholz *Sent:* Tuesday, December 05, 2006 3:43 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] HTTPService POST with request parameters I am trying to post an XML payload to an HTTPService that has additional request parameters (e.g. http://www.mysite.com/get?o=sponsora=save). I created my HTTPService as such: mx:HTTPService id=getSponsor method=POST resultFormat=e4x result=getResultOK(event) fault=getResultFault(event) url=http://www.mysite.com/get mx:request osponsor/o aput/a /mx:request /mx:HTTPService And call it like this: private function addSponsor():void { getSponsor.send(sponsorModel); } With sponsorModel: mx:Model id=sponsorModel sponsor id{txtId}/id name{tiName}/name imageUrl{tiImageUrl}/imageUrl linkUrl{tiLinkUrl}/linkUrl /sponsor /mx:Model It looks like the request parameters are not being sent (I am not seeing them on the server). Is this supported in Flex 2? Thanks Todd
[flexcoders] HTTPService POST with request parameters
I am trying to post an XML payload to an HTTPService that has additional request parameters (e.g. http://www.mysite.com/get?o=sponsora=save). I created my HTTPService as such: mx:HTTPService id=getSponsor method=POST resultFormat=e4x result=getResultOK(event) fault=getResultFault(event) url=http://www.mysite.com/get mx:request osponsor/o aput/a /mx:request /mx:HTTPService And call it like this: private function addSponsor():void { getSponsor.send(sponsorModel); } With sponsorModel: mx:Model id=sponsorModel sponsor id{txtId}/id name{tiName}/name imageUrl{tiImageUrl}/imageUrl linkUrl{tiLinkUrl}/linkUrl /sponsor /mx:Model It looks like the request parameters are not being sent (I am not seeing them on the server). Is this supported in Flex 2? Thanks Todd
RE: [flexcoders] HTTPService POST with request parameters
So the model data is getting into the server, but the url querystring parameters are not? Also, you are passing an mx:Object in the post body to the server. Is that working? What does it look like on the server? What is the server platform? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Todd Breiholz Sent: Tuesday, December 05, 2006 3:43 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService POST with request parameters I am trying to post an XML payload to an HTTPService that has additional request parameters (e.g. http://www.mysite.com/get?o=sponsora=save http://www.mysite.com/get?o=sponsora=save ). I created my HTTPService as such: mx:HTTPService id=getSponsor method=POST resultFormat=e4x result=getResultOK(event) fault=getResultFault(event) url=http://www.mysite.com/get http://www.mysite.com/get mx:request osponsor/o aput/a /mx:request /mx:HTTPService And call it like this: private function addSponsor():void { getSponsor.send(sponsorModel); } With sponsorModel: mx:Model id=sponsorModel sponsor id{txtId}/id name{tiName}/name imageUrl{tiImageUrl}/imageUrl linkUrl{tiLinkUrl}/linkUrl /sponsor /mx:Model It looks like the request parameters are not being sent (I am not seeing them on the server). Is this supported in Flex 2? Thanks Todd
Re: [flexcoders] HTTPService POST with request parameters
Tracy Correct, the model data is getting there, but not the querystring parameters. I also noticed about the mx:objects in the post. It was an error and I was getting really screwy data on the server. I've since changed the bindings to point to the text property of the objects and the post body is being sent correctly (I also had to add contentType=application/xml to my HTTPService. After making those changes, I am still seeing the same behavior as before (with a valid post body, now). The server platform is ATG (Java servlet based). When I try to extract the 2 request parameters, I get null for both of them. Thanks! Todd On 12/5/06, Tracy Spratt [EMAIL PROTECTED] wrote: So the model data is getting into the server, but the url querystring parameters are not? Also, you are passing an mx:Object in the post body to the server. Is that working? What does it look like on the server? What is the server platform? Tracy -- *From:* flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] *On Behalf Of *Todd Breiholz *Sent:* Tuesday, December 05, 2006 3:43 PM *To:* flexcoders@yahoogroups.com *Subject:* [flexcoders] HTTPService POST with request parameters I am trying to post an XML payload to an HTTPService that has additional request parameters (e.g. http://www.mysite.com/get?o=sponsora=save). I created my HTTPService as such: mx:HTTPService id=getSponsor method=POST resultFormat=e4x result=getResultOK(event) fault=getResultFault(event) url=http://www.mysite.com/get mx:request osponsor/o aput/a /mx:request /mx:HTTPService And call it like this: private function addSponsor():void { getSponsor.send(sponsorModel); } With sponsorModel: mx:Model id=sponsorModel sponsor id{txtId}/id name{tiName}/name imageUrl{tiImageUrl}/imageUrl linkUrl{tiLinkUrl}/linkUrl /sponsor /mx:Model It looks like the request parameters are not being sent (I am not seeing them on the server). Is this supported in Flex 2? Thanks Todd
RE: [flexcoders] HTTPService POST with request parameters
Then this syntax: mx:request osponsor/o aput/a /mx:request Attempts to put those two name-value parameters in the request object, which is now application/xml, which, well, isn't what you want. Instead, try concatenating the querystring directly on the url before you send(). Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Todd Breiholz Sent: Tuesday, December 05, 2006 5:57 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] HTTPService POST with request parameters Tracy Correct, the model data is getting there, but not the querystring parameters. I also noticed about the mx:objects in the post. It was an error and I was getting really screwy data on the server. I've since changed the bindings to point to the text property of the objects and the post body is being sent correctly (I also had to add contentType=application/xml to my HTTPService. After making those changes, I am still seeing the same behavior as before (with a valid post body, now). The server platform is ATG (Java servlet based). When I try to extract the 2 request parameters, I get null for both of them. Thanks! Todd On 12/5/06, Tracy Spratt [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: So the model data is getting into the server, but the url querystring parameters are not? Also, you are passing an mx:Object in the post body to the server. Is that working? What does it look like on the server? What is the server platform? Tracy From: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com http://ups.com ] On Behalf Of Todd Breiholz Sent: Tuesday, December 05, 2006 3:43 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService POST with request parameters I am trying to post an XML payload to an HTTPService that has additional request parameters (e.g. http://www.mysite.com/get?o=sponsora=save http://www.mysite.com/get?o=sponsora=save ). I created my HTTPService as such: mx:HTTPService id=getSponsor method=POST resultFormat=e4x result=getResultOK(event) fault=getResultFault(event) url=http://www.mysite.com/get http://www.mysite.com/get mx:request osponsor/o aput/a /mx:request /mx:HTTPService And call it like this: private function addSponsor():void { getSponsor.send(sponsorModel); } With sponsorModel: mx:Model id=sponsorModel sponsor id{txtId}/id name{tiName}/name imageUrl{tiImageUrl}/imageUrl linkUrl{tiLinkUrl}/linkUrl /sponsor /mx:Model It looks like the request parameters are not being sent (I am not seeing them on the server). Is this supported in Flex 2? Thanks Todd
RE: [flexcoders] HTTPService POST with request parameters
Possibly the issue is due to the fact that you have both query string parameters and POST data parameters in the same request. I think that ATG used to have a bug where the query parameters are not returned by the getParameter method if the request has method=POST. They expose another method on the DynamoHttpServletRequest called getQueryParameter which will always return the query parameters. I vaguely recall that bug got fixed at some point but it has been a long time since I worked for ATG. One nice thing about ATG is that if you do a toString on the request object, it dumps out all of the state of the request. That might be a way to ensure that the query parameters are at least making it to the server in the URL. Jeff From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Todd Breiholz Sent: Tuesday, December 05, 2006 2:57 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] HTTPService POST with request parameters Tracy Correct, the model data is getting there, but not the querystring parameters. I also noticed about the mx:objects in the post. It was an error and I was getting really screwy data on the server. I've since changed the bindings to point to the text property of the objects and the post body is being sent correctly (I also had to add contentType=application/xml to my HTTPService. After making those changes, I am still seeing the same behavior as before (with a valid post body, now). The server platform is ATG (Java servlet based). When I try to extract the 2 request parameters, I get null for both of them. Thanks! Todd On 12/5/06, Tracy Spratt [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: So the model data is getting into the server, but the url querystring parameters are not? Also, you are passing an mx:Object in the post body to the server. Is that working? What does it look like on the server? What is the server platform? Tracy From: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com http://ups.com ] On Behalf Of Todd Breiholz Sent: Tuesday, December 05, 2006 3:43 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] HTTPService POST with request parameters I am trying to post an XML payload to an HTTPService that has additional request parameters (e.g. http://www.mysite.com/get?o=sponsora=save http://www.mysite.com/get?o=sponsora=save ). I created my HTTPService as such: mx:HTTPService id=getSponsor method=POST resultFormat=e4x result=getResultOK(event) fault=getResultFault(event) url=http://www.mysite.com/get http://www.mysite.com/get mx:request osponsor/o aput/a /mx:request /mx:HTTPService And call it like this: private function addSponsor():void { getSponsor.send(sponsorModel); } With sponsorModel: mx:Model id=sponsorModel sponsor id{txtId}/id name{tiName}/name imageUrl{tiImageUrl}/imageUrl linkUrl{tiLinkUrl}/linkUrl /sponsor /mx:Model It looks like the request parameters are not being sent (I am not seeing them on the server). Is this supported in Flex 2? Thanks Todd