on 02-12-2008 9:20 PM
Hi Guys,
I am trying to post a string to a servlet using HTTP Post. The servlet excepts a Parameter with name b2mml. I am trying to send the Post String in the HTTP Post actions as a name value pair b2mml=xmlencode("my xml here"). Is this the way that I am supposed to send the HTTP Post. In Java, I url encode the key and value and send it to the servlet in a Post.
What should be my post string in this case? does a simple name value pair suffice, which I think is not working in the test. I put the debugger on the servlet and I have seen that no data is coming in the request.
Thanks,
Ravi.
Ravi,
There's no need to encode your parameter, the POST action does this automatically. This is probably what's causing your issue.
Sam
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks Sam. But that doesnot seem to solve the problem.
The transaction has the input 'b2mml' with is a xml. In the http post action, I configured the 'PostData' property using the link editor as
"b2mml="&Transaction.b2mml
The servlet is trying to read parameter b2mml but it is not there in the request object.
Ravi.
Hi Sam,
I have the visibility of the request as I put the servlet in Debug mode. I can see that nothing is coming as a Parameter. Only the request is coming but without the parameter of type b2mml. I see a null if I do a request.getParameter("b2mml") and I dont get the b2mml as a param name itself when I check request.getParameterNames()
Ravi.
Ravi,
My assumption here is that you've already verified that if you set the following in the URL:
b2mml=abc123
that you see abc123 in the servlet code. As a result I suggest creating a local property of type String and setting the XML to this string property first and then adding it to the POST URL parameter.
Sam
User | Count |
---|---|
11 | |
6 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.