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 Index » WebSphere Message Broker (ACE) Support » HTTPRequest Node & HTTP POST

Post new topic  Reply to topic
 HTTPRequest Node & HTTP POST « View previous topic :: View next topic » 
Author Message
Qadeer_824
PostPosted: Sat May 03, 2008 6:06 am    Post subject: HTTPRequest Node & HTTP POST Reply with quote

Acolyte

Joined: 04 Oct 2007
Posts: 59

Hello,
I am doing some hands-on using the webservice functionality in WMB V6.0. The scenario is as given below:

MQInput Node ==> CreateWSRequest ==> HTTPRequest Node ==> ReformatWSResponse ==> MQOutput Node

1. MQInput node receives an xml as input
Code:

<?xml version="1.0" encoding="UTF-8"?>
<UserInput>
 <WSDLOperation>ConversionRate</WSDLOperation>
 <WSDLSourceCurrency>USD</WSDLSourceCurrency>
 <WSDLTargetCurrency>INR</WSDLTargetCurrency>
</UserInput>


2. CreateWSRequest node creates the HTTP Request Header uisng esql below:
Code:

DECLARE tmp_HTTPPostString CHARACTER;
SET tmp_HTTPPostString = 'FromCurrency=' || InputRoot.XML.UserInput.WSDLSourceCurrency || '&ToCurrency=' || InputRoot.XML.UserInput.WSDLTargetCurrency;
SET Environment.MQMD = InputRoot.MQMD;
SET OutputRoot.HTTPRequestHeader.POST = 'CurrencyConvertor.asmx/ConversionRate';
SET OutputRoot.HTTPRequestHeader.Host = '209.162.186.60';
SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/x-www-form-urlencoded';
SET OutputRoot.BLOB.BLOB = CAST(tmp_HTTPPostString AS BLOB CCSID InputRoot.MQMD.CodedCharSetId);


3. HTTP Request node has all default options set

The webservice is a public service available on internet at http://www.webservicex.net/CurrencyConvertor.asmx

As per the webservice details given, the expected format for POST message is:
Code:

POST /CurrencyConvertor.asmx/ConversionRate HTTP/1.1
Host: www.webservicex.net
Content-Type: application/x-www-form-urlencoded
Content-Length: length

FromCurrency=string&ToCurrency=string


Following is the trace after HTTPRequest Node:
Code:

###### 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 '2008-05-03 12:12:35.822'
    (0x03000000):ExpirationTime  = -1
    (0x03000000):Priority        = 0
    (0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
    (0x03000000):ReplyProtocol   = 'MQ'
    (0x03000000):Topic           = NULL
    (0x03000000):ContentType     = 'text/xml; charset=utf-8'
  )
  (0x01000000):HTTPRequestHeader  = (
    (0x03000000):POST           = 'CurrencyConvertor.asmx/ConversionRate'
    (0x03000000):Host           = '209.162.186.60'
    (0x03000000):Content-Type   = 'application/x-www-form-urlencoded'
    (0x03000000):Content-Length = '31'
  )
  (0x01000000):HTTPResponseHeader = (
    (0x03000000):X-Original-HTTP-Status-Line = 'HTTP/1.1 500 Internal Server Error.'
    (0x03000000):X-Original-HTTP-Status-Code = 500
    (0x03000000):Connection                  = 'close'
    (0x03000000):Date                        = 'Sat, 03 May 2008 12:12:58 GMT'
    (0x03000000):Server                      = 'Microsoft-IIS/6.0'
    (0x03000000):X-Powered-By                = 'ASP.NET'
    (0x03000000):X-AspNet-Version            = '1.1.4322'
    (0x03000000):Cache-Control               = 'private'
    (0x03000000):Content-Type                = 'text/xml; charset=utf-8'
    (0x03000000):Content-Length              = '848'
  )
  (0x01000000):BLOB               = (
    (0x03000000):UnknownParserName = ''
    (0x03000000):BLOB              = X'3c3f786d6c2076657273696f6e3d22312e302220656e636f64696e673d227574662d38223f3e0d0a3c736f61703a456e76656c6f706520786d6c6e733a736f61703d22687474703a2f2f736368656d61732e786d6c736f61702e6f72672f736f61702f656e76656c6f70652f2220786d6c6e733a7873693d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d612d696e7374616e63652220786d6c6e733a7873643d22687474703a2f2f7777772e77332e6f72672f323030312f584d4c536368656d61223e0d0a20203c736f61703a426f64793e0d0a202020203c736f61703a4661756c743e0d0a2020202020203c6661756c74636f64653e736f61703a436c69656e743c2f6661756c74636f64653e0d0a2020202020203c6661756c74737472696e673e53797374656d2e5765622e53657276696365732e50726f746f636f6c732e536f6170457863657074696f6e3a20556e61626c6520746f2068616e646c65207265717565737420776974686f757420612076616c696420616374696f6e20706172616d657465722e20506c6561736520737570706c7920612076616c696420736f617020616374696f6e2e0d0a20202061742053797374656d2e5765622e53657276696365732e50726f746f636f6c732e536f6170313153657276657250726f746f636f6c48656c7065722e526f7574655265717565737428290d0a20202061742053797374656d2e5765622e53657276696365732e50726f746f636f6c732e536f617053657276657250726f746f636f6c2e496e697469616c697a6528290d0a20202061742053797374656d2e5765622e53657276696365732e50726f746f636f6c732e53657276657250726f746f636f6c466163746f72792e437265617465285479706520747970652c2048747470436f6e7465787420636f6e746578742c20487474705265717565737420726571756573742c2048747470526573706f6e736520726573706f6e73652c20426f6f6c65616e26616d703b2061626f727450726f63657373696e67293c2f6661756c74737472696e673e0d0a2020202020203c64657461696c202f3e0d0a202020203c2f736f61703a4661756c743e0d0a20203c2f736f61703a426f64793e0d0a3c2f736f61703a456e76656c6f70653e'
  )
)


The Response from webservice when converted from BLOB to Char string is :
Code:

<?xml version="1.0" encoding="utf-8"?>..<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <soap:Body>
    <soap:Fault>
      <faultcode>soap:Client</faultcode>
      <faultstring>System.Web.Services.Protocols.SoapException: Server did not recognize the value of HTTP Header SOAPAction: ...   at System.Web.Services.Protocols.Soap11ServerProtocolHelper.RouteRequest()
   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing)</faultstring>
      <detail />
    </soap:Fault>
  </soap:Body>
</soap:Envelope>


My question is why is it expecting a SOAPAction when i am requesting for a HTTP-POST request? Is this something related to the web server and not an issue with my code?
Are you aware of any public webservice where i can test my flow using HTTP-POST instead of soap message?

Please let me know..

Thanks
Qadeer
Back to top
View user's profile Send private message Yahoo Messenger
ashoon
PostPosted: Sun May 04, 2008 11:23 am    Post subject: SOAPAction Reply with quote

Master

Joined: 26 Oct 2004
Posts: 235

Not sure why you think the SOAPAction HTTP header is not needed... try using SOAPUI/tcpmon against that service and you will see the full input/output requirements including the HTTP Headers...
_________________
IBM Certified - SOA Solution Designer & WebSphere Datapower SOA Appliances
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » HTTPRequest Node & HTTP POST
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.