|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
HTTPRequest Basic authentication failed |
« View previous topic :: View next topic » |
Author |
Message
|
mehdiK |
Posted: Mon Apr 01, 2013 3:47 am Post subject: |
|
|
Acolyte
Joined: 07 Mar 2013 Posts: 53
|
Or do I have to use a MIME parser in addition to the XMLNSC parser ?
When I use only the MIME parser for the HTTPRequest and the HTTPInput node of the external service it gives me a 401 Error.
Thank you. |
|
Back to top |
|
 |
marko.pitkanen |
Posted: Mon Apr 01, 2013 7:13 am Post subject: |
|
|
 Chevalier
Joined: 23 Jul 2008 Posts: 440 Location: Jamsa, Finland
|
Hi,
Try to set HTTPRequestHeader."Content-Type" to text/xml when you are using XMLNSC as domain for your content.
--
Marko |
|
Back to top |
|
 |
rekarm01 |
Posted: Mon Apr 01, 2013 9:04 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mehdiK wrote: |
Code: |
( ['WSRoot' : 0xb426470]
...
(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0x189b7a0]
(0x03000000:PCDataField):feed = NULL
(
(0x03000100:Attribute ):xmlns = 'http://www.w3.org/2005/Atom' (CHARACTER)
(0x03000000:PCDataField):entry = NULL
(
(0x03000000:PCDataField):title = 'F_Form1' (CHARACTER)
(
(0x03000100:Attribute):type = 'text' (CHARACTER)
)
(0x03000000:PCDataField):updated = '1970-01-01T00:00:00Z' (CHARACTER)
(0x03000000:PCDataField):content = NULL
(
(0x03000100:Attribute ):type = 'application/xml' (CHARACTER)
(0x03000000:PCDataField):F_Form1 = NULL
(
(0x03000100:Attribute ):xmlns = '' (CHARACTER)
(0x03000100:Attribute ):application_uid = '20864346-99e9-48e1-8023-3e5625323e7c' (CHARACTER)
(0x03000100:Attribute ):pressedButton = 'S_Submit' (CHARACTER)
(0x03000100:Attribute ):flowState = 'ST_Start' (CHARACTER)
(0x03000000:PCDataField):F_RegleA = 'TestA' (CHARACTER)
)
)
)
)
)
) |
|
The field types may not be correct for this XML message. Typically, most of those "PCDataField" types would be "Folder", and the xmlns "Attribute" types would be "NamespaceDecl" or similar type. What does the request look like when serialized?
mehdiK wrote: |
Code: |
No MessageBodyReader is Available for the class org.apache.abdera .model.Element and a media type of application/x-www-form-urlencoded |
|
This is normally used with HTTP GET method, where there is no request body. If that is the case, then both the HTTPRequest node and backend service would need to be configured for HTTP GET, rather than HTTP POST.
mehdiK wrote: |
Do I have to use multipart/form-data instead of application/x-www-form-urlencoded ? |
That mostly depends on what the backend service is expecting. |
|
Back to top |
|
 |
mehdiK |
Posted: Tue Apr 02, 2013 6:57 am Post subject: |
|
|
Acolyte
Joined: 07 Mar 2013 Posts: 53
|
Thank you rekarm.
Yes, I notice that the input and output message are formatted differently. Here's the InputMessage :
Code: |
(0x01000000:Folder):XMLNSC = ( ['xmlnsc' : 0x6f04e30]
(0x01000400:NamespaceDecl):XmlDeclaration = (
(0x03000100:Attribute):Version = '1.0' (CHARACTER)
(0x03000100:Attribute):Encoding = 'UTF-8' (CHARACTER)
)
(0x01000000:Folder )http://www.w3.org/2005/Atom:feed = (
(0x03000102:NamespaceDecl):xmlns = 'http://www.w3.org/2005/Atom' (CHARACTER)
(0x01000000:Folder )http://www.w3.org/2005/Atom:entry = (
(0x03000000:PCDataField)http://www.w3.org/2005/Atom:title = 'F_Form1' (CHARACTER)
(
(0x03000100:Attribute):type = 'text' (CHARACTER)
)
(0x03000000:PCDataField)http://www.w3.org/2005/Atom:updated = '1970-01-01T00:00:00Z' (CHARACTER)
(0x01000000:Folder )http://www.w3.org/2005/Atom:content = (
(0x03000100:Attribute):type = 'application/xml' (CHARACTER)
(0x01000000:Folder ):F_Form1 = (
(0x03000102:NamespaceDecl):xmlns = '' (CHARACTER)
(0x03000100:Attribute ):application_uid = '20864346-99e9-48e1-8023-3e5625323e7c' (CHARACTER)
(0x03000100:Attribute ):pressedButton = 'S_Submit' (CHARACTER)
(0x03000100:Attribute ):flowState = 'ST_Start' (CHARACTER)
(0x03000000:PCDataField ):F_RegleA = 'TestA' (CHARACTER)
)
)
)
)
)
|
So I have to build the message differently.. But how can I create this namespace :
and the feed element :
Code: |
(0x01000000:Folder )http://www.w3.org/2005/Atom:feed |
in java or esql (preferably in Java)
Quote: |
then both the HTTPRequest node and backend service would need to be configured for HTTP GET, rather than HTTP POST. |
I have to send via Post because the target can only receive data with POST method.
Thank you. |
|
Back to top |
|
 |
rekarm01 |
Posted: Wed Apr 03, 2013 12:17 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 1415
|
mehdiK wrote: |
Yes, I notice that the input and output message are formatted differently. |
It looks like the input message body is supposed to be the same as the request message body. How is the JCN copying the message from node to node?
mehdiK wrote: |
So I have to build the message differently |
... or just copy it from the input message.
mehdiK wrote: |
But how can I create this namespace ... and the feed element ... in java or esql (preferably in Java) |
For Java, use either the MbMessageAssembly semi-copy constructor, the MbMessage copy constructor, or MbElement create or copy methods with the MbXMLNSC parser specific types.
mehdiK wrote: |
I have to send via Post because the target can only receive data with POST method. |
So ContentType='application/x-www-form-urlencoded' is probably not what the target expecting either. |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|