Author |
Message
|
kevin0304 |
Posted: Thu Feb 28, 2013 8:37 am Post subject: SOAP Request to REST GET URI conversion |
|
|
Newbie
Joined: 28 Feb 2013 Posts: 3
|
Hi,
I'm having consumer sending SOAP request and Provider supporting REST API and SOAP interfaces as well.
The REST API that has been implemented by provider requires less calls from message broker when compared to SOAP interface(as no wrapper Interface exist to call internal calls within the provider system) for a service request.
I want to validate the requests from consumer using SOAP WSDL and transform into REST GET URI (for my 'getinformation' interface) to call my provider. [requirement is to expect SOAP request from consumer]
- My understanding is that constructing an REST GET URI from SOAP request message in message broker could be very complex. URI to be constructed based on the few parameters in request and these parameters could be a long list. eg: get me a record with modified date on '28-02-2012' and with author 'kevin' of version 3.
1) Can I convert the SOAP request from consumer after validation into JSON format and send to my provider as REST GET with JSON payload.
I'm not sure on this. Looking into few documentation my understanding is we can not do a REST GET with payload ???
2) could above implementation be done with REST POST with JSON payload ???
I read while googling that when parameter list is quite big, the best option is to use REST POST with payload even though it has to be GET. Please advice if this is true. If I'm posting, I'm not deleting the rest of the informaiton that is not there in my request ???
Your ideas are much appreciated.
Thanks
Kevin |
|
Back to top |
|
 |
lancelotlinc |
Posted: Thu Feb 28, 2013 8:44 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
|
Back to top |
|
 |
mqjeff |
Posted: Thu Feb 28, 2013 8:45 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You need to send the message as required by the provider.
That may seem obvious, but it's really what you're asking about.
There's no specific reason that I'm aware of that you can't construct an arbitrarily long URL for an HTTP GET request that you send to the HTTPRequest node. |
|
Back to top |
|
 |
kevin0304 |
Posted: Thu Feb 28, 2013 5:50 pm Post subject: |
|
|
Newbie
Joined: 28 Feb 2013 Posts: 3
|
Thanks for your responses.
The JSON sample someway similar to what I'm trying to do except I do not want to use the parameters appended in URI.
-with all parameters in URI as below
Code: |
HTTP GET
http://{hostname}:{port}/objectname/?text="record123"&pagesize=10&metadata="date updated" is "today"&metadata="owner" is "kevin"&metadata="version" is "3"...... |
rather than having as above, Is it possible to have something as below and still supported by REST API !!
Code: |
HTTP GET
http://{hostname}:{port}/objectname
{
"text": record123
"pagezige": 10
"metadata": [
"owner" : "kevin"
"Version" : 3
.................
]
} |
Thanks
Kevin |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Feb 28, 2013 7:59 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
mqjeff wrote: |
You need to send the message as required by the provider.
That may seem obvious, but it's really what you're asking about.
There's no specific reason that I'm aware of that you can't construct an arbitrarily long URL for an HTTP GET request that you send to the HTTPRequest node. |
I believe HTTP Get has a certain length limit. An HTTP POST if accepted by the provider will not be submitted to the same length constraints.
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kevin0304 |
Posted: Thu Feb 28, 2013 10:00 pm Post subject: |
|
|
Newbie
Joined: 28 Feb 2013 Posts: 3
|
I think Http GET with payload is not possible. I was trying with google REST API with Chrome REST console and it seems that the payload is just getting ignored when doing REST get operation.
We can add the parameters in name value pairs which is working that this would be part of query.
something like below, which is working fine
Quote: |
Request Url: https://www.google.com.au/search
Request Method: GET
Status Code: 200
Params: {
"q": "SOUTH AFRICA",
"num": "50",
"cr": "countryAU",
"as_filetype": "pdf",
"safe": "images"
} |
I wondering how I can add complex parameter structure.
Any ideas!!!
Thanks |
|
Back to top |
|
 |
fjb_saper |
Posted: Fri Mar 01, 2013 9:30 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Have you looked into the http query string?  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|