cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a Post String in HTTP Post Action - 11.5 SR3

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Ravi,

There's no need to encode your parameter, the POST action does this automatically. This is probably what's causing your issue.

Sam

Former Member
0 Kudos

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.

0 Kudos

What actually shows up for the parameter? Do you have visibility into what you are recieving?

Sam

Former Member
0 Kudos

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.

0 Kudos

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