3

I'm new to internet programming and got a problem when sending a post request to a server (I received an unspecific error message). The server I want to connect is Microsoft HealthVault PreProductionEnvironment. The Specification say the this: "HealthVault Service communications occur via schematized XML in the body of an HTTP request over a TLS Connection [RFC2818]. The HTTP requests MUST be submitted using the POST HTTP verb."

I tried to check the post request by sending it to "http://posttestserver.com/post.php?dir=ms_hv" (result displayed on "http://posttestserver.com/data/2011/12/05/ms_hv/"). This is the data I got:


Time: Mon, 05 Dec 11 05:26:53 -0800
Source ip: xxx.xxx.xxx.xxx

Headers (Some may be inserted by server)
UNIQUE_ID = TtzGna3sqvkAABZHetMAAAAH
CONTENT_LENGTH = 1157
HTTP_CONNECTION = close
HTTP_ACCEPT_ENCODING = gzip
HTTP_ACCEPT_LANGUAGE = en-US,*
HTTP_USER_AGENT = Mozilla/5.0
HTTP_HOST = posttestserver.com
CONTENT_TYPE = application/x-www-form-urlencoded
REMOTE_ADDR = 188.98.76.99
REMOTE_PORT = 21675
GATEWAY_INTERFACE = CGI/1.1
REQUEST_METHOD = POST
QUERY_STRING = dir=ms_hv
REQUEST_URI = /post.php?dir=ms_hv
REQUEST_TIME = 1323091613

Post Params:
key: '<?xml_version' value: '"1.0" encoding="utf-8"?><wc-request:request xmlns:wc-request="urn:com.microsoft.wc.request"><header><method>CreateAuthenticatedSessionToken</method><method-version>2</method-version><app-id>bc1fdbef-f814-4ee3-b414-1e9f6956c7ab</app-id><language>de</language><country>DE</country><msg-time>2011-12-05T14:26:51.31Z</msg-time><msg-ttl>1800</msg-ttl><version>2.0.0.0</version></header><info><auth-info><app-id>05a059c9-c309-46af-9b86-b06d42510550</app-id><credential><appserver2><sig digestMethod="SHA1" sigMethod="RSA-SHA1" thumbprint="50054D4FAEE16F69AAF66B7596ED30F9922B949E">fZaPzgI3x2ngzKnI2AU0leWgR7ycj7GcABPxktIKRd/u5eWk4dMGLiHv7x9oLKDAGC9BtAOGqe1YX80OpRFQC3VCioc9SGyAtBf0dTiM2tNcDTIboNqq0 m/d8FaI/MjIt8SlvXbV/LmCnEnjToPaiYnXqesJLflNUBRgotH2MK6YljcdB3G2JxghBlaqAYXKfx7c 8WQ9hA nnw75kTaJWXdgTAtdb0yUT5poYvm/ahG1PEl9BQCrR CmdYGECet4nlT1pFozYizI1lpZ4DQEv5eDz9YHGsqGO59oSOTX3iamRK wsaVvhKUBqS6 g7Q34wRa pv9mTocenMmCFOQ==</sig><content><app-id>bc1fdbef-f814-4ee3-b414-1e9f6956c7ab</app-id><hmac>HMACSHA256</hmac><signing-time>2011-12-05T14:26:51.3193190Z</signing-time></content></appserver2></credential></auth-info></info></wc-request:request>'

== Begin post body ==

== End post body ==

The issue I don't understand is the post body beeing empty. All the post-data is shown in "Post Params". Is this correct? Could this be the fault?

Please tell me if you need more detailed description.

Solution (probably): The post body is empty but in the specification it says "XML in the body of an HTTP request", this probably means "in the POST body" (but mine is empty). I'll check out this posibility.

Semjon Mössinger
  • 1,798
  • 3
  • 22
  • 32

1 Answers1

1

By using a "?" in your URL, you use the HTTP GET method. You can mix GET and POST in one request (which can lead to some obscure problems, especially when register_globals is switched on in your php-installation), but you shouldn't:

As I interpret your error-message, your server does not accept submitting the informations via HTTP GET. Instead you have to use the HTTP POST method. An example for a HTTP POST using QT you can find here.

Community
  • 1
  • 1
Erik
  • 3,777
  • 21
  • 27