ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportHTTPRequest POST Method

Post new topicReply to topic Goto page 1, 2  Next
HTTPRequest POST Method View previous topic :: View next topic
Author Message
JustFriend
PostPosted: Sun Aug 14, 2005 7:38 am Post subject: HTTPRequest POST Method Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

Please help:
I am asking you this help after going through many forums for the past 1 week. ….Please help:

The Case:
I have a web-service which takes one parameter (TEST) and returns back a string. I am trying to use POST method to get the info from web-service but unfortunately I am getting always error:

What I am looking for?
I need a sample ESQL code which can do the HTTP Post with one form name and value


The message structure

Code:
SOAP:
POST /BatWS/alsha_ws.asmx HTTP/1.1
Host: 195.23.23.50
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/BatWS/alsha_ws/HelloWorld"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body>
    <HelloWorld xmlns="http://tempuri.org/BatWS/alsha_ws">
      <TEST>string</TEST>
    </HelloWorld>
  </soap:Body>
</soap:Envelope>

POST:
POST /BatWS/alsha_ws.asmx/HelloWorld HTTP/1.1
Host: 195.23.23.50
Content-Type: application/x-www-form-urlencoded
Content-Length: length

TEST=string


FLOW:
MQInput >> Compute1 >> HTTPRequest >> Compute2 >> MQOutput

I am using the following ESQL in Compute1:
Code:

      SET OutputRoot.Properties.MessageDomain = 'XML';
      SET OutputRoot.Properties.MessageFormat = 'XML';
      SET OutputRoot.Properties.MessageSet = '';
      SET OutputRoot.Properties.MessageType = '';
      SET OutputRoot.Properties.MessageFormat = 'MQSTR';
      SET OutputRoot.Properties.Encoding = 546;
      SET OutputRoot.Properties.CodedCharSetId = 437;
      
      SET OutputRoot.XML.(XML.XmlDecl) = '';
      SET OutputRoot.XML.(XML.XmlDecl).(XML.Version) = '1.0';
      SET OutputRoot.XML.(XML.XmlDecl).(XML."Encoding") = 'UTF-8';

      SET OutputRoot.XML.(XML.Element)EMI.TEST = 'Hellooooooo';   
      SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://195.23.23.50/BatWS/alsha_ws.asmx/HelloWorld';


HTTPRequest Node Properties:Web Service URL: http://localhost/dummy
Request Timeout: 20
HTTP Proxy Location : <blank>
Follow HTTP redirection: <unchecked>

Advanced:
Use whole input message as request : <un-checked>
Request Message Location in Tree : InputRoot.XML.EMI
Replace input message with web-service response: <checked>
Generate default HTTP headers : <checked>

DEFAULT:
Message domain: XML
Rest all the fields are blank

VALIDATION: None


ERRORS:





############### START #################


ROOT:
====
(
(0x01000000):Properties = (
(0x03000000):MessageSet = ''
(0x03000000):MessageType = ''
(0x03000000):MessageFormat = 'MQSTR'
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Transactional = TRUE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2005-08-14 15:27:58.590'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'414d5120534242424b31514d202020203b5feb422001b201'
(0x03000000):ReplyProtocol = 'MQ'
(0x03000000):Topic = NULL
)
(0x01000000):HTTPResponseHeader = (
(0x03000000):X-Original-HTTP-Status-Line = 'HTTP/1.1 500 Internal Server Error.'
(0x03000000):X-Original-HTTP-Status-Code = 500
(0x03000000):Server = 'Microsoft-IIS/5.0'
(0x03000000):Date = 'Sun, 14 Aug 2005 15:28:05 GMT'
(0x03000000):X-Powered-By = 'ASP.NET'
(0x03000000):X-AspNet-Version = '1.1.4322'
(0x03000000):Cache-Control = 'private'
(0x03000000):Content-Type = 'text/plain; charset=utf-8'
(0x03000000):Content-Length = '53'
)
(0x01000000):MQMD = (
(0x03000000):SourceQueue = 'INT.TRA.REQ.IN'
(0x03000000):Transactional = TRUE
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 437
(0x03000000):Format = 'MQSTR '
(0x03000000):Version = 2
(0x03000000):Report = 0
(0x03000000):MsgType = 8
(0x03000000):Expiry = -1
(0x03000000):Feedback = 0
(0x03000000):Priority = 0
(0x03000000):Persistence = 0
(0x03000000):MsgId = X'414d5120534242424b31514d202020203b5feb422001b201'
(0x03000000):CorrelId = X'414d5120534242424b31514d202020203b5feb422001b201'
(0x03000000):BackoutCount = 0
(0x03000000):ReplyToQ = ' '
(0x03000000):ReplyToQMgr = 'SBBBK1QM '
(0x03000000):UserIdentifier = 'Administrato'
(0x03000000):AccountingToken = X'16010515000000112b48bee360754f355c8294f401000000000000000000000b'
(0x03000000):ApplIdentityData = ' '
(0x03000000):PutApplType = 11
(0x03000000):PutApplName = 'C:\WINDOWS\system32\mmc.exe '
(0x03000000):PutDate = DATE '2005-08-14'
(0x03000000):PutTime = GMTTIME '15:27:58.590'
(0x03000000):ApplOriginData = ' '
(0x03000000):GroupId = X'000000000000000000000000000000000000000000000000'
(0x03000000):MsgSeqNumber = 1
(0x03000000):Offset = 0
(0x03000000):MsgFlags = 0
(0x03000000):OriginalLength = -1
)
(0x01000010):XML = (
(0x01000000):UnknownParserName = (
(0x02000000): = ''
)
(0x01000000):BLOB = (
(0x02000000): = X'5265717565737420666f726d617420697320696e76616c69643a20746578742f786d6c3b20636861727365743d7574662d382e0d0a'
)
)
)


LOCAL ENVIRONMENT:
===============
(
(0x01000000):Destination = (
(0x01000000):HTTP = (
(0x03000000):RequestURL = 'http://195.23.23.50/BatWS/alsha_ws.asmx/HelloWorld'
)
)
)

EXCEPTION:
========


############### E N D ##################


EXCEPTION:
I am putting the following in the trace-node:
${Root}
${LocalEnvironment}
${ExceptionList}
But I am not getting any exception errors in the file (I don’t know why?)




PLEASE HELP:
I need the ESQL to send a HTTP post with one or more parameters…..
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
mgk
PostPosted: Sun Aug 14, 2005 10:49 am Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

You are using the XML domain, whihc means that the request you send will be an XML message. To do this you will have to use the BLOB domain, and construct the string to send as a CHAR string in ESQL the CAST it to a BLOB with a CCSID.


You are not getting anything in the ExceptionList because you are not getting an exception. You are getting an HTTP 500 status code back, which is an error (not an exception) therefore the message is being routed to the error terminal of the HTTPRequestNode, and there is no exception generated. This is as designed behaviour.

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
JustFriend
PostPosted: Sun Aug 14, 2005 9:26 pm Post subject: Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

Thanks Mgk for your immediate response. I think we are in different time-zones that's y my reply is delayed.

For me it is not a must to use the XML message format, but I thought the HTTP POST takes the parameters only if the message is in the XML format.

Actually, I need to send only ONE parameters in the HTTP POST.

For example, I am using the below HTTP-GET method for getting the result:
Code:
http://195.23.23.50/BatWS/alsha_ws.asmx/HelloWorld?TEST=mystring


Now, I am not able to send any parameters for the POST method and Response 500, I am getting due to that. I have gone through the web-log and I did not find any form name or value for the request which is the likely cause for the error.

HENCE,
I request you to provide me some sample ESQL codes to be used in the compute node and the properties to be set in the HTTPRequest node which takes the parameters and URL dynamically.

Please help…. I am really stuck.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
JustFriend
PostPosted: Mon Aug 15, 2005 4:46 am Post subject: Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

Hi...

I even tried the below ESQL... but it too failed giving Error 500.
Code:
SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://191.23.23.50/BatWS/alsha_ws.asmx/HelloWorld?TEST=MMM';


Please help....

I just need to send the Parameter-Name and Value from the Compute-Node....

I am really stuck...
_________________
Best Regards,
Just Friend.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
JustFriend
PostPosted: Mon Aug 15, 2005 10:53 pm Post subject: Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

Is there any way to do a HTTP POST (with Parameter and Value) and get back the response within a Message Flow ?
_________________
Best Regards,
Just Friend.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
mgk
PostPosted: Tue Aug 16, 2005 4:01 am Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

Yes you can do this, as I said above. I do not have time to write your esql for you. You have to read up on ESQL.

Basically the steps you need to follow are:

In a compute node before the request node create a string containing the 'name=value' string that you wish to send. This must contain exactly what you want to send.

Then CAST this string to a BLOB with a ccsid and store it into the output message as a BLOB, so your output message from the compute node is a BLOB containg exactly what you want to send to the web server

Then in the request node tell it to use the whole message as the request.

What will happen then is that the request node will send the contents of the BLOB to the remote web server (as that was the body of the message that arrived at the IN terminal of the request node.)

Or, you could model the message in the MRM, which can handle name value pairs as CWF for you I believe.


Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
JustFriend
PostPosted: Tue Aug 16, 2005 6:51 am Post subject: Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

Hi Mgk thanks for your reply and pl’se excuse me if I have troubled you.

However, your suggestion is not working. Or may be I am going in the wrong-track.

I am tried in the following way your procedure:

The Flow:

MQInput >> Compute1 >> HTTPRequest >> Compute2 >> MQOutput
MQInput Node Properties:
Default : Message Domain : BLOB

My Input Msg:
I have manually put the message through the MQ Explorer by right-clicking the queue and “Put Message Data”
The message that I put was: TEST=please

List of other options tried was:
TEST=please
?TEST=please
/TEST=please
TEST please


In Compute1, I have used your ESQL concept in the following way

Code:
-- This will have the output msg as BLOB (since my input-node is marked as BLOB) with necessary CCSID values)
CALL CopyMessageHeaders();
CALL CopyEntireMessage();

-- I have tried the following options also
-- DECLARE QRY CHAR;
-- SET QRY = ‘TEST=please’
-- SET OutputRoot.BLOB.BLOB = CAST (QRY AS BLOB CCSID 437);

-- Setting the Request URL
SET OutputLocalEnvironment.Destination.HTTP.RequestURL = ' 'http://195.23.23.50/BatWS/alsha_ws.asmx/HelloWorld';


In HTTPRequest Node, I have set the following properties:

Basic:
Web-Service URL* : http:// 'http://195.23.23.50/dummy
Request Timeout* : 120
HTTP Proxy Location : <blank>
Follow HTTP redirection : <unchecked>

Advanced:
Use whole input message as request : <checked>
Replace input message with web-service response : <checked>
Generate default HTTP headers from input : <checked>

Error:
Replace input with error : <checked>

Default:
Message Domain : BLOB
Message Set : <blank>
Message Type : <blank>
Message Format : <blank>

Validation:
Validate : none

Description:
Short Des… : <blank>
Long Des… : <blank>


But I am getting only Error-500
_________________
Best Regards,
Just Friend.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
jefflowrey
PostPosted: Tue Aug 16, 2005 6:55 am Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

NEVER call both CopyEntireMessage AND CopyMessageHeaders.

Post a trace of your message BEFORE the HTTPRequest node.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
JustFriend
PostPosted: Tue Aug 16, 2005 7:15 am Post subject: Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

That was typing error:
In actual code I am using the only
CALL CopyEntireMessage()
Actually the CopyMessageHeaders() was commented and when I copied from the code to here... I went wrong... just a copying mistake... sorry for that

The ESQL used in Compute1 Node is as below:
Code:

      SET Environment.TMP = CAST (InputRoot.BLOB.BLOB AS CHAR CCSID 437);
      CALL CopyEntireMessage();
      SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://195.23.23.50/BatWS/alsha_ws.asmx/HelloWorld';
      RETURN TRUE;



TRACE BEFORE HTTPRequest Node:
Code:


############### TRACE-START #################
ROOT TRACE:
(
  (0x01000000):Properties = (
    (0x03000000):MessageSet      = ''
    (0x03000000):MessageType     = ''
    (0x03000000):MessageFormat   = ''
    (0x03000000):Encoding        = 546
    (0x03000000):CodedCharSetId  = 437
    (0x03000000):Transactional   = TRUE
    (0x03000000):Persistence     = FALSE
    (0x03000000):CreationTime    = GMTTIMESTAMP '2005-08-16 15:04:07.870'
    (0x03000000):ExpirationTime  = -1
    (0x03000000):Priority        = 0
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x03000000):ReplyProtocol   = 'MQ'
    (0x03000000):Topic           = NULL
  )
  (0x01000000):MQMD       = (
    (0x03000000):SourceQueue      = 'TEST.IN'
    (0x03000000):Transactional    = TRUE
    (0x03000000):Encoding         = 546
    (0x03000000):CodedCharSetId   = 437
    (0x03000000):Format           = 'MQSTR   '
    (0x03000000):Version          = 2
    (0x03000000):Report           = 0
    (0x03000000):MsgType          = 8
    (0x03000000):Expiry           = -1
    (0x03000000):Feedback         = 0
    (0x03000000):Priority         = 0
    (0x03000000):Persistence      = 0
    (0x03000000):MsgId            = X'414d5120534242424b31514d202020203b5feb4220021705'
    (0x03000000):CorrelId         = X'000000000000000000000000000000000000000000000000'
    (0x03000000):BackoutCount     = 0
    (0x03000000):ReplyToQ         = '                                                '
    (0x03000000):ReplyToQMgr      = 'SBBBK1QM                                        '
    (0x03000000):UserIdentifier   = 'Administrato'
    (0x03000000):AccountingToken  = X'16010515000000112b48bee360754f355c8294f401000000000000000000000b'
    (0x03000000):ApplIdentityData = '                                '
    (0x03000000):PutApplType      = 11
    (0x03000000):PutApplName      = 'C:\WINDOWS\system32\mmc.exe '
    (0x03000000):PutDate          = DATE '2005-08-16'
    (0x03000000):PutTime          = GMTTIME '15:04:07.870'
    (0x03000000):ApplOriginData   = '    '
    (0x03000000):GroupId          = X'000000000000000000000000000000000000000000000000'
    (0x03000000):MsgSeqNumber     = 1
    (0x03000000):Offset           = 0
    (0x03000000):MsgFlags         = 0
    (0x03000000):OriginalLength   = -1
  )
  (0x01000000):BLOB       = (
    (0x03000000):UnknownParserName = 'MQSTR'
    (0x03000000):BLOB              = X'544553543d706c65617365'
  )
)

ENVIRONMENT TRACE:
(
  (0x03000000):TMP = 'TEST=please'
)

LOCAL ENVIRONMENT TRACE:
(
  (0x01000000):Destination = (
    (0x01000000):HTTP = (
      (0x03000000):RequestURL = 'http://195.23.23.50/BatWS/asha_ws.asmx/HelloWorld'
    )
  )
)

EXCEPTION TRACE:
 

############### TRACE-E N D ##################





TRACE AFTER HTTPRequest Node:
Code:


############### TRACE-START #################
ROOT TRACE:
(
  (0x01000000):Properties         = (
    (0x03000000):MessageSet      = ''
    (0x03000000):MessageType     = ''
    (0x03000000):MessageFormat   = ''
    (0x03000000):Encoding        = 546
    (0x03000000):CodedCharSetId  = 1208
    (0x03000000):Transactional   = FALSE
    (0x03000000):Persistence     = FALSE
    (0x03000000):CreationTime    = GMTTIMESTAMP '2005-08-16 15:03:48.065'
    (0x03000000):ExpirationTime  = -1
    (0x03000000):Priority        = 0
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x03000000):ReplyProtocol   = 'MQ'
    (0x03000000):Topic           = NULL
  )
  (0x01000000):HTTPResponseHeader = (
    (0x03000000):X-Original-HTTP-Status-Line = 'HTTP/1.1 500 Internal Server Error.'
    (0x03000000):X-Original-HTTP-Status-Code = 500
    (0x03000000):Server                      = 'Microsoft-IIS/5.0'
    (0x03000000):Date                        = 'Tue, 16 Aug 2005 15:04:25 GMT'
    (0x03000000):X-Powered-By                = 'ASP.NET'
    (0x03000000):X-AspNet-Version            = '1.1.4322'
    (0x03000000):Cache-Control               = 'private'
    (0x03000000):Content-Type                = 'text/plain; charset=utf-8'
    (0x03000000):Content-Length              = '53'
  )
  (0x01000000):BLOB               = (
    (0x03000000):UnknownParserName = ''
    (0x03000000):BLOB              = X'5265717565737420666f726d617420697320696e76616c69643a20746578742f786d6c3b20636861727365743d7574662d382e0d0a'
  )
)

ENVIRONMENT TRACE:
(
  (0x03000000):TMP = 'TEST=please'
)

LOCAL ENVIRONMENT TRACE:
(
  (0x01000000):Destination = (
    (0x01000000):HTTP = (
      (0x03000000):RequestURL = 'http://195.23.23.50/BatWS/asha_ws.asmx/HelloWorld'
    )
  )
)

EXCEPTION TRACE:
 

############### TRACE-E N D ##################



With lots of hopes I remain... and Thanks a lot for understanding my situation.
_________________
Best Regards,
Just Friend.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
mgk
PostPosted: Tue Aug 16, 2005 8:37 am Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

OK, if you look at the message that the server sends back to you, (cast from blob to char with ccsid) you will see that it says:

Code:
Request format is invalid: text/xml; charset=utf-8.


This means that you are not setting the content type correctly, and as you are using "Generate Default Headers" this is automatically being set for you as you are not overriding it. You say in your first post that you want to use a content type of
Code:
application/x-www-form-urlencoded


Therefore you need to overrise the default in a compute node before the request node with an ESQL statement like (not tested, this code is written from memory):

SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/x-www-form-urlencoded';

You may also need to set the SOAPAction, Host, and any other headers that you may need to be to values other than the defaults.

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
JustFriend
PostPosted: Tue Aug 16, 2005 9:18 pm Post subject: Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

In fact I tried that option too.

My code:
Code:

      CALL CopyEntireMessage();
      SET OutputRoot.HTTPRequestHeader.POST = '/BatWS/alsha_ws.asmx/HelloWorld';
      SET OutputRoot.HTTPRequestHeader.Host = '195.23.23.50';
      SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/x-www-form-urlencoded';
      SET OutputRoot.HTTPRequestHeader.SOAPAction = 'http://tempuri.org/BatWS/alsha_ws/HelloWorld';
      SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://195.23.23.50/BatWS/alsha_ws.asmx/HelloWorld';
      RETURN TRUE;

Response is again 500
_________________
Best Regards,
Just Friend.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
mgk
PostPosted: Wed Aug 17, 2005 12:56 am Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

Well BOTH the traces you posted above before and after the HTTPRequest Node show that you were NOT sending an HTTPRequestHeader at that time as there should be one showing in both traces (before and after) if that was the case.

Can you paste a trace showing a problem that includes the HTTRequestHeader you show below, as we do not know if the error returned from the WebServer is different (as I expect it will be) if there is an HTTPRequestHeader. This is because I need to see the BLOB that the web server returns when you get the error. Saying "Response is 500" does not help anyone to diagnose the problem as a response code of 500 covers hundreds of possible problems
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
JustFriend
PostPosted: Wed Aug 17, 2005 2:38 am Post subject: Reply with quote

Novice

Joined: 30 May 2005
Posts: 22

Yes you are right, the first trace is without Headers and this one is with Headers. I tried both the options...



TRACE with Headers Before HTTPRequest

Code:


############### TRACE-START #################
ROOT TRACE:
(
  (0x01000000):Properties        = (
    (0x03000000):MessageSet      = ''
    (0x03000000):MessageType     = ''
    (0x03000000):MessageFormat   = ''
    (0x03000000):Encoding        = 546
    (0x03000000):CodedCharSetId  = 437
    (0x03000000):Transactional   = TRUE
    (0x03000000):Persistence     = FALSE
    (0x03000000):CreationTime    = GMTTIMESTAMP '2005-08-17 05:13:13.950'
    (0x03000000):ExpirationTime  = -1
    (0x03000000):Priority        = 0
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x03000000):ReplyProtocol   = 'MQ'
    (0x03000000):Topic           = NULL
  )
  (0x01000000):MQMD              = (
    (0x03000000):SourceQueue      = 'TEST.IN'
    (0x03000000):Transactional    = TRUE
    (0x03000000):Encoding         = 546
    (0x03000000):CodedCharSetId   = 437
    (0x03000000):Format           = 'MQSTR   '
    (0x03000000):Version          = 2
    (0x03000000):Report           = 0
    (0x03000000):MsgType          = 8
    (0x03000000):Expiry           = -1
    (0x03000000):Feedback         = 0
    (0x03000000):Priority         = 0
    (0x03000000):Persistence      = 0
    (0x03000000):MsgId            = X'414d5120534242424b31514d202020203b5feb4220021311'
    (0x03000000):CorrelId         = X'000000000000000000000000000000000000000000000000'
    (0x03000000):BackoutCount     = 0
    (0x03000000):ReplyToQ         = '                                                '
    (0x03000000):ReplyToQMgr      = 'SBBBK1QM                                        '
    (0x03000000):UserIdentifier   = 'Administrato'
    (0x03000000):AccountingToken  = X'16010515000000112b48bee360754f355c8294f401000000000000000000000b'
    (0x03000000):ApplIdentityData = '                                '
    (0x03000000):PutApplType      = 11
    (0x03000000):PutApplName      = 'C:\WINDOWS\system32\mmc.exe '
    (0x03000000):PutDate          = DATE '2005-08-17'
    (0x03000000):PutTime          = GMTTIME '05:13:13.950'
    (0x03000000):ApplOriginData   = '    '
    (0x03000000):GroupId          = X'000000000000000000000000000000000000000000000000'
    (0x03000000):MsgSeqNumber     = 1
    (0x03000000):Offset           = 0
    (0x03000000):MsgFlags         = 0
    (0x03000000):OriginalLength   = -1
  )
  (0x01000000):BLOB              = (
    (0x03000000):UnknownParserName = 'MQSTR'
    (0x03000000):BLOB              = X'544553543d706c65617365'
  )
  (0x01000000):HTTPRequestHeader = (
    (0x03000000):POST         = '/BatWS/alsha_ws.asmx/HelloWorld'
    (0x03000000):Host         = '195.23.23.50'
    (0x03000000):Content-Type = 'application/x-www-form-urlencoded'
    (0x03000000):SOAPAction   = 'http://tempuri.org/BatWS/alsha_ws/HelloWorld'
  )
)

ENVIRONMENT TRACE:
(
  (0x03000000):TMP = 'TEST=please'
)

LOCAL ENVIRONMENT TRACE:
(
  (0x01000000):Destination = (
    (0x01000000):HTTP = (
      (0x03000000):RequestURL = 'http://195.23.23.50/BatWS/alsha_ws.asmx/HelloWorld'
    )
  )
)

EXCEPTION TRACE:
 

############### TRACE-E N D ##################





Trace with headers after HTTPRequest

Code:


############### TRACE-START #################
ROOT TRACE:
(
  (0x01000000):Properties         = (
    (0x03000000):MessageSet      = ''
    (0x03000000):MessageType     = ''
    (0x03000000):MessageFormat   = ''
    (0x03000000):Encoding        = 546
    (0x03000000):CodedCharSetId  = 1208
    (0x03000000):Transactional   = FALSE
    (0x03000000):Persistence     = FALSE
    (0x03000000):CreationTime    = GMTTIMESTAMP '2005-08-17 05:02:52.548'
    (0x03000000):ExpirationTime  = -1
    (0x03000000):Priority        = 0
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x03000000):ReplyProtocol   = 'MQ'
    (0x03000000):Topic           = NULL
  )
  (0x01000000):HTTPRequestHeader  = (
    (0x03000000):Content-Length = '181'
    (0x03000000):POST           = '/BatWS/alsha_ws.asmx/HelloWorld'
    (0x03000000):Host           = '195.23.23.50'
    (0x03000000):Content-Type   = 'application/x-www-form-urlencoded'
    (0x03000000):SOAPAction     = 'http://tempuri.org/BatWS/alsha_ws/HelloWorld'
  )
  (0x01000000):HTTPResponseHeader = (
    (0x03000000):X-Original-HTTP-Status-Line = 'HTTP/1.1 500 Internal Server Error.'
    (0x03000000):X-Original-HTTP-Status-Code = 500
    (0x03000000):Server                      = 'Microsoft-IIS/5.0'
    (0x03000000):Date                        = 'Wed, 17 Aug 2005 05:13:45 GMT'
    (0x03000000):X-Powered-By                = 'ASP.NET'
    (0x03000000):X-AspNet-Version            = '1.1.4322'
    (0x03000000):Cache-Control               = 'private'
    (0x03000000):Content-Type                = 'text/plain; charset=utf-8'
    (0x03000000):Content-Length              = '26'
  )
  (0x01000000):BLOB               = (
    (0x03000000):UnknownParserName = ''
    (0x03000000):BLOB              = X'4d697373696e6720706172616d657465723a20544553542e0d0a'
  )
)

ENVIRONMENT TRACE:
(
  (0x03000000):TMP = 'TEST=please'
)

LOCAL ENVIRONMENT TRACE:
(
  (0x01000000):Destination = (
    (0x01000000):HTTP = (
      (0x03000000):RequestURL = 'http://195.23.23.50/BatWS/alsha_ws.asmx/HelloWorld'
    )
  )
)

EXCEPTION TRACE:
 

############### TRACE-E N D ##################


_________________
Best Regards,
Just Friend.
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
mgk
PostPosted: Wed Aug 17, 2005 4:46 am Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1638

OK, this is much better now. The BLOB that is now being returned as an error from IIS is very different. Did you look at it? It says:
Quote:
Missing parameter: TEST.

This is completely different error to the first one you posted earlier about the content-type.

What you can see from the trace you sent before the HTTPrequest node is that you are creating the HTTPRequestheader AFTER the BLOB you want to send, rather that before. And if you have set the Request node to use "useWholeInputMsgAsRequest" then it is actually sending the HTTPRequestHeader as the body of the message to IIS. This is because the "body" of a message is defined to be the "last child of root". And in your case the last child is NOT the BLOB it is the HTTPRequestHeader. Also, you can see from the Content-Length header in the HTTPRequestHeader after the request node (which shows you exactly what was sent to the remote server) that is sent 181 bytes, which is far more that your BLOB size.

Therefore you have two choices. 1: Create the HTTPRequestHeader BEFORE the BLOB in your compute node (and this is the best option) or 2: you could try setting the requestMsgLocationInTree to be InputRoot.BLOB.BLOB which will find your BLOB message under the input message whether it is located before or after the HTTPRequestHeader.

Also I see that you are creating a POST header to send to the web server. Do you actually need to do this I do not think you do, and you can remove it as it may confuse people (certainly the HTTPRequestNode does not look at it to generate the POST request line in case you think it does).

When debuging HTTP is is often a good idea to use a proxy trace tool so you can see the actual data sent to and from the web server. This way it is much easier to debug.

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Wed Aug 17, 2005 4:49 am Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

mgk wrote:
When debuging HTTP is is often a good idea to use a proxy trace tool so you can see the actual data sent to and from the web server. This way it is much easier to debug.


Is there one that you like and use? Is it open source?
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Display posts from previous:
Post new topicReply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum IndexWebSphere Message Broker (ACE) SupportHTTPRequest POST Method
Jump to:



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP


Theme by Dustin Baccetti
Powered by phpBB 2001, 2002 phpBB Group

Copyright MQSeries.net. All rights reserved.