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 » Required Httprequestheader parameters for RESTFUL Servicc

Post new topic  Reply to topic
 Required Httprequestheader parameters for RESTFUL Servicc « View previous topic :: View next topic » 
Author Message
kiranbj
PostPosted: Wed Jun 10, 2015 2:50 am    Post subject: Required Httprequestheader parameters for RESTFUL Servicc Reply with quote

Novice

Joined: 04 Jan 2015
Posts: 10

Hello, Am getting the below error while Calling the REST service using HttprequestNode

RESTAPI-INVALIDREQ: (err:FOER0000) Invalid request: reason: uri parameter not allowed for server-assigned document URIs</rapi:message></rapi:error>

Code Snippet
SET OutputRoot.HTTPRequestHeader."Content-Type" = 'application/xml';
SET OutputRoot.HTTPRequestHeader.Authorization = 'Basic alcnalvoav' ;
SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://www.abc.com:8109/v1/documents' ;
SET OutputLocalEnvironment.Destination.HTTP.RequestLine.RequestURI = '/abc/abcDoc_Id014.xml' ;
SET OutputLocalEnvironment.Destination.HTTP.RequestLine.Method = 'POST' ;
CREATE LASTCHILD OF OutputRoot DOMAIN 'XMLNSC' NAME 'XMLNSC' ;



Am I missing anything here, can you please help me overhere?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 10, 2015 4:31 am    Post subject: Re: Required Httprequestheader parameters for RESTFUL Servic Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

kiranbj wrote:
Am I missing anything here, can you please help me overhere?


Aside from the oddness of sending XML to a REST service rather than JSON, there's nothing intrinsically wrong with your code. Except that the receiving service doesn't like it.

Which implies it's not a REST service but an HTTP endpoint, which would explain the XML rather than JSON message format.

But we can't see any of that, so you'll need to investigate.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
inMo
PostPosted: Wed Jun 10, 2015 4:47 am    Post subject: Reply with quote

Master

Joined: 27 Jun 2009
Posts: 216
Location: NY

Quote:
Aside from the oddness of sending XML to a REST service rather than JSON


Why is that odd?
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 10, 2015 5:15 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

inMo wrote:
Quote:
Aside from the oddness of sending XML to a REST service rather than JSON


Why is that odd?


If you've got an endpoint that's connected to an XML parsing engine, typically the XML parser comes bundled inside tooling that handles SOAP because that's the typical pattern. If you're standing up a REST endpoint, the key driver is because you don't want or can't sustain the overhead that SOAP & XML imposes. That's why JSON (a very lightweight message format with a very lightweight parser) was developed. If you can handle XML, why would you not spend the extra 10c and wrap it in a SOAP Envelope?

I'm not saying wrong, I'm saying odd. I'm also saying it because (as I indicated above) one possible cause of the OP's problem is the "REST service" being invoked may not be REST is the technical sense but a more traditional HTTP endpoint that's been badged by management as "REST" because it's trendy and without any understanding of the technical difference.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mqjeff
PostPosted: Wed Jun 10, 2015 5:20 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

inMo wrote:
Quote:
Aside from the oddness of sending XML to a REST service rather than JSON
Why is that odd?



Vitor wrote:
Which implies it's not a REST service but an HTTP endpoint

they are the same thing. REST is just a fancy way of saying "we liked HTTP so we made it seem like it's a real thing!"

Quote:
: uri parameter not allowed for server-assigned document URI


There will be an HTTP Response code returned with this message. It will likely be a 40x message. There is possibly some additional information in the rest of the HTTP response that tells you more.
Back to top
View user's profile Send private message
stoney
PostPosted: Wed Jun 10, 2015 5:39 am    Post subject: Reply with quote

Centurion

Joined: 03 Apr 2013
Posts: 140

Code:

SET OutputLocalEnvironment.Destination.HTTP.RequestURL = 'http://www.abc.com:8109/v1/documents' ;   
SET OutputLocalEnvironment.Destination.HTTP.RequestLine.RequestURI = '/abc/abcDoc_Id014.xml' ;   


This may not be doing what you expect it to - I believe the RequestURI will replace the path component of the URL specified in RequestURL, not append to it.
This means that you may be making an HTTP request to http://www.abc.com:8109/abc/abcDoc_Id014.xml, instead of http://www.abc.com:8109/v1/documents/abc/abcDoc_Id014.xml, which is probably what you intended?
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 » Required Httprequestheader parameters for RESTFUL Servicc
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.