Author |
Message
|
drcas |
Posted: Thu Dec 01, 2005 6:45 am Post subject: Soap with Attachment over HTTP |
|
|
 Apprentice
Joined: 03 May 2002 Posts: 26
|
I am trying to send a SwA message over HTTP to be parsed by the new MB 6.-0 MIME parse. I am using sun's SAAJ libraries to generate and send the SwA message. When the messsage is received I am receiving the exception "Empty or invalid header found at position: &1"; however the Content-Type is being populated in the HTTP header! If I save the message off to a file and then remove the first "POST..." line and put the message to a queue where it is sent to a flow, the message is parsed by the MIME parser without any exceptions. (Note this is the first time I have used the HTTP input node)
Below is the first part of the message with the first boundary being sent over HTTP:
POST http://localhost:7080/WBIMB/HTTP_WS HTTP/1.1
Content-Type: multipart/related; type="text/xml"; boundary="----=_Part_0_15655788.1133448443421"
Content-Length: 140990
SOAPAction: ""
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.5.0_05
Host: localhost:7080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
------=_Part_0_15655788.1133448443421
And this is from a trace node after the HTTP input node:
(0x01000000):MIME = (
(0x01000000):Properties = (
(0x03000000):MessageSet = ''
(0x03000000):MessageType = ''
(0x03000000):MessageFormat = ''
(0x03000000):Encoding = 546
(0x03000000):CodedCharSetId = 1208
(0x03000000):Transactional = FALSE
(0x03000000):Persistence = FALSE
(0x03000000):CreationTime = GMTTIMESTAMP '2005-12-01 15:01:59.288'
(0x03000000):ExpirationTime = -1
(0x03000000):Priority = 0
(0x03000000):ReplyIdentifier = X'000000000000000000000000000000000000000000000000'
(0x03000000):ReplyProtocol = 'SOAP-HTTP'
(0x03000000):Topic = NULL
(0x03000000):ContentType = 'text/xml; charset=utf-8'
)
(0x01000000):HTTPInputHeader = (
(0x03000000):X-Original-HTTP-Command = 'POST http://localhost:7080/WBIMB/HTTP_WS HTTP/1.1'
(0x03000000):Content-Type = 'multipart/related; type="text/xml"; boundary="----=_Part_0_15655788.1133449695171"'
(0x03000000):Content-Length = '140990'
(0x03000000):SOAPAction = '""'
(0x03000000):Cache-Control = 'no-cache'
(0x03000000):Pragma = 'no-cache'
(0x03000000):User-Agent = 'Java/1.5.0_05'
(0x03000000):Host = 'localhost:7080'
(0x03000000):Accept = 'text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2'
(0x03000000):Connection = 'keep-alive'
)
(0x01000000):MIME =
and this is the exception being raised:
(
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S000_P\src\WebServices\WSLibrary\ImbWSReplyNode.cpp'
(0x03000000):Line = 763
(0x03000000):Function = 'ImbWSReplyNode::evaluate'
(0x03000000):Type = 'ComIbmWSReplyNode'
(0x03000000):Name = 'HTTP_WS#FCMComposite_1_2'
(0x03000000):Label = 'HTTP_WS.HTTP Reply'
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 2230
(0x03000000):Text = 'Caught exception and rethrowing'
(0x01000000):RecoverableException = (
(0x03000000):File = 'F:\build\S000_P\src\WebServices\WSLibrary\ImbWSRFC822HeaderParser.cpp'
(0x03000000):Line = 401
(0x03000000):Function = 'ImbRFC822HeaderParser::parseLine'
(0x03000000):Type = ''
(0x03000000):Name = ''
(0x03000000):Label = ''
(0x03000000):Catalog = 'BIPv600'
(0x03000000):Severity = 3
(0x03000000):Number = 3156
(0x03000000):Text = 'Empty or invalid header found at position: &1.'
(0x01000000):Insert = (
(0x03000000):Type = 2
(0x03000000):Text = '0'
)
(0x01000000):Insert = (
(0x03000000):Type = 14
(0x03000000):Text = 'MIME'
)
)
)
)
and finally this is from a user trace:
2005-12-01 09:08:15.399943 5984 UserTrace BIP3122I: Message received and propagated to 'out' terminal of HTTP input node 'HTTP_WS.HTTP Input'.
2005-12-01 09:08:15.400501 5984 UserTrace BIP6060I: Parser type ''Properties'' created on behalf of node 'HTTP_WS.HTTP Input' to handle portion of incoming message of length 364 bytes beginning at offset '0'.
2005-12-01 09:08:15.400915 5984 UserTrace BIP6061I: Parser type ''HTTPInputHeader'' created on behalf of node 'HTTP_WS.HTTP Input' to handle portion of incoming message of length '369' bytes beginning at offset '364'. Parser type selected based on value ''WSINPHDR'' from previous parser.
2005-12-01 09:08:15.400998 5984 UserTrace BIP6061I: Parser type ''MIME'' created on behalf of node 'HTTP_WS.HTTP Input' to handle portion of incoming message of length '140990' bytes beginning at offset '733'. Parser type selected based on value ''MIME'' from previous parser.
2005-12-01 09:08:15.401042 5984 UserTrace BIP2539I: Node 'HTTP_WS.Trace1': Evaluating expression ''Root'' at ('', '1.3'). This resolved to ''Root''. The result was ''ROW... Root Element Type=16777216 NameSpace='' Name='Root' Value=NULL''.
2005-12-01 09:08:15.401713 5984 Error BIP2230E: Error detected whilst processing a message in node 'HTTP_WS.Trace1'.
The message broker detected an error whilst processing a message in node 'HTTP_WS.Trace1'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error.
2005-12-01 09:08:15.401759 5984 RecoverableException BIP3156S: An error was found whilst parsing 'MIME' header data. A 'MIME' header name is empty or contains invalid characters at position: 0.
A 'MIME' header name cannot be empty or contain invalid characters.
2005-12-01 09:08:15.401812 5984 UserTrace BIP4067I: Message propagated to output terminal for trace node 'HTTP_WS.Trace1'.
The trace node 'HTTP_WS.Trace1' has received a message and is propagating it to any nodes connected to its output terminal.
No user action required.
2005-12-01 09:08:15.402638 5984 UserTrace BIP3146E: Error detected whilst processing a message 'HTTP_WS.HTTP Input'.
The message broker detected an error whilst processing a message in node 'HTTP_WS.HTTP Input'. The message has been augmented with an exception list and has been propagated to the node's catch terminal for further processing.
See the following messages for details of the error.
2005-12-01 09:08:15.402659 5984 RecoverableException BIP2230E: Error detected whilst processing a message in node 'HTTP_WS.HTTP Reply'.
The message broker detected an error whilst processing a message in node 'HTTP_WS.HTTP Reply'. An exception has been thrown to cut short the processing of the message.
See the following messages for details of the error.
2005-12-01 09:08:15.402672 5984 RecoverableException BIP3156S: An error was found whilst parsing 'MIME' header data. A 'MIME' header name is empty or contains invalid characters at position: 0.
A 'MIME' header name cannot be empty or contain invalid characters.
2005-12-01 09:08:15.402721 5984 UserTrace BIP2539I: Node 'HTTP_WS.Trace': Evaluating expression ''ExceptionList'' at ('', '1.3'). This resolved to ''ExceptionList''. The result was ''ROW... Root Element Type=16777216 NameSpace='' Name='Root' Value=NULL''.
2005-12-01 09:08:15.403132 5984 UserTrace BIP4067I: Message propagated to output terminal for trace node 'HTTP_WS.Trace'.
The trace node 'HTTP_WS.Trace' has received a message and is propagating it to any nodes connected to its output terminal.
No user action required.
2005-12-01 09:08:15.404369 5984 UserTrace BIP2638I: The MQ output node 'HTTP_WS.MQOutput' attempted to write a message to queue ''EXCEPTION.LO'' connected to queue manager ''''. The MQCC was '0' and the MQRC was '0'.
2005-12-01 09:08:15.404392 5984 UserTrace BIP2622I: Message successfully output by output node 'HTTP_WS.MQOutput' to queue ''EXCEPTION.LO'' on queue manager ''''. |
|
Back to top |
|
 |
wooda |
Posted: Fri Dec 02, 2005 2:51 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Quote: |
the Content-Type is being populated in the HTTP header! |
This is ok. If you have a HTTP header then the Content-Type will always appear here but will still be used by the MIME parser.
I can't see anything likely to cause the error in the snippet of the MIME message you posted. The problem could be in the header of the first part. Could you post a bit more of the message. |
|
Back to top |
|
 |
drcas |
Posted: Mon Dec 05, 2005 7:46 am Post subject: |
|
|
 Apprentice
Joined: 03 May 2002 Posts: 26
|
Yes the Content-Type should be in the HTTP header and used by the MIME parser. Initially I thought the problem might be that the MIME parser was starting with the first line in the message i.e.
"POST http://localhost:7080/WBIMB/HTTP_WS HTTP/1.1"
So I brought the message in as a BLOB and the substring'ed past what I thought was the "POST..." line. What I discovered was that the BLOB started with the first boundary line "------=_Part_0_15655788.1133448443421" and not at the "Content-Type..." line as I would expect. Here is more of the message:
POST http://localhost:7080/WBIMB/HTTP_WS HTTP/1.1
Content-Type: multipart/related; type="text/xml"; boundary="----=_Part_0_15655788.1133448443421"
Content-Length: 140990
SOAPAction: ""
Cache-Control: no-cache
Pragma: no-cache
User-Agent: Java/1.5.0_05
Host: localhost:7080
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Connection: keep-alive
------=_Part_0_15655788.1133448443421
Content-Type: text/xml; charset=utf-8
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ztrade:GetLastTradePrice xmlns:ztrade="http://wombat.ztrade.com"><ztrade:symbol>SUNW</ztrade:symbol></ztrade:GetLastTradePrice></SOAP-ENV:Body></SOAP-ENV:Envelope>
------=_Part_0_15655788.1133448443421
Content-Type: image/jpeg |
|
Back to top |
|
 |
wooda |
Posted: Tue Dec 06, 2005 2:40 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Even if you bring the message in as a BLOB the HTTP headers have been parsed off it. So I would expect that th BLOB would contain everything after the first header block (eg. the first boundary). And you would have the HTTP headers in your tree.
Other observations are that you don't have a MIME-Version header - however the broker does not enforce that this is present. So should not be the issue.
So there doesn't appear to be a lot to point to the cause of the issue.
Here's a few other possible causes of 3156 you should check:
1.) Check all your newline sequences are ascii <CRLF>.
2.) Check there are no invisable characters on the empty lines.
3.) I can't see from the snippet but check you have a correct terminating boundary ending with --<CRLF>
Failing that you could try and simplify your message to try and find the cause of the problem.
Failing that I'm afraid it is probably time to raise a PMR. |
|
Back to top |
|
 |
msukup |
Posted: Fri Jul 14, 2006 12:40 pm Post subject: Any solution to SwA, no MIME header with HTTP POST? |
|
|
Acolyte
Joined: 11 Feb 2002 Posts: 56
|
i am having a similar problem described in this post -- I am trying to send a SOAP message with attachment: a simple post of MIME message with two parts (xml + html) to HTTP input node using multipart MIME; the message was sent with modified client generated in WSAD 5.1 (IBM/Apache SOAP). In message broker, the result is an exception stating that the MIME header could not be found. When I save the POST as an MQ message and view it, it looks fine, follows all MIME rules. Did you have any resolution to your problem?
Here is the HTTPInputHeader:
(0x01000000):HTTPInputHeader = (
(0x03000000):X-Original-HTTP-Command = 'POST http://mqhd1:7080/demosoapattac
h HTTP/1.0'
(0x03000000):Host = 'mqhd1:7080'
(0x03000000):Content-Type = 'multipart/related; boundary="----=_P
art_59_1841022140.1152908502383"; type="text/xml"; start="1851851964.11529085023
83.apache-soap.pa103163"'
(0x03000000):Content-Length = '822'
(0x03000000):SOAPAction = '""'
)
Here is the saved message:
------=_Part_55_927532220.1152908141764
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-ID: <916915388.1152908141764.apache-soap.pa103163>
Content-Length: 455
<?xml version='1.0' encoding='UTF-8'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<Q1:PROVROOTREQUEST xmlns:Q1="http://tempuri.org/PRVROTSG"><PROV_RT_ID><PROV_RT_ID_NBR></PROV_RT_ID_NBR><PROV_RT_ID_FILLER></PROV_RT_ID_FILLER></PROV_RT_ID></Q1:PROVROOTREQUEST>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------=_Part_55_927532220.1152908141764
Content-Type: text/html
Content-Transfer-Encoding: 7bit
<HTML>HELLO!</HTML>
------=_Part_55_927532220.1152908141764-- |
|
Back to top |
|
 |
prasadpav |
Posted: Sun Oct 01, 2006 2:25 pm Post subject: |
|
|
 Centurion
Joined: 03 Oct 2004 Posts: 142
|
Hi,
I'm getting the same error. Did anyone of you managed to find a solution for this problem?
Thanks,
Prasad |
|
Back to top |
|
 |
rsandoz |
Posted: Fri Jun 22, 2007 5:17 am Post subject: |
|
|
Novice
Joined: 12 Oct 2006 Posts: 17
|
I was having the same problem (Fixpack 6.0.0.3):
(0x03000000):Number = 3156
(0x03000000):Text = 'Empty or invalid header found at position: &1.'
and I was using a stand-alone java app using
import javax.xml.soap.AttachmentPart;
import javax.xml.soap.SOAPMessage;
I searched and found fixpack 6.0.0.4 had a fix addressing newline issues in the MIME Parser.
After I ugraded, now I get one of two errors:
(0x03000000):Number = 2114
(0x03000000):Text = 'Invalid index'
or
(0x03000000):Number = 2135
(0x03000000):Text = 'Unconvertable character' |
|
Back to top |
|
 |
|