Author |
Message
|
Orette |
Posted: Mon Jan 27, 2020 1:58 pm Post subject: Receiving BLOB.BLOB from FileInput Node |
|
|
Newbie
Joined: 22 Mar 2017 Posts: 8
|
I am making an application that has a FileInput node that is pulling in a file from a directory to start with. I am calling a web service that requires a SOAP input as well as an attachment. After I have input the file, I set up the namespaces, headers, and request fields necessary to call the web service. I do not believe there are any problems here.
Next, I set up the file to be sent to the web service as an attachment. From the FileInput node, the file exists in the flow as a BLOB right now at InputRoot.BLOB.BLOB. I have seen that in order to send a file as an attachment in a request, I should to do the following (I have hardcoded some values for the sake of this explanation):
Code: |
SET OutputRoot.SOAP.Attachment.{fileName}.MIME_Headers."Content-Type" = 'application/pdf;';
SET OutputRoot.SOAP.Attachment.{fileName}.MIME_Headers."Content-Transfer-Encoding" = 'binary';
SET OutputRoot.SOAP.Attachment.{fileName}.MIME_Headers."Content-Id" = 'Here is the name of a file.pdf';
SET OutputRoot.SOAP.Attachment.{fileName}.BLOB.BLOB = InputRoot.BLOB.BLOB; |
When I try to call the web service, I am receiving the following error:
"invalid data for SOAP.Attachment.<Content-Id>.BLOB"
I figured that the BLOB that is in the InputRoot would be sufficient to pass into web service, but it doesn't seem to be so. Am I missing something? Please let me know if I didn't explain this well enough as well and I can try to elaborate. |
|
Back to top |
|
 |
timber |
Posted: Mon Jan 27, 2020 4:07 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Good problem description, but please quote the entire error message, accurately and in full. Include the id of the error message ('BIP' + 4 digits).
Also, the title of your post could be a lot better. You are asking about SOAP with attachments, not the FileInput node (the BLOB in your SOAP message tree could have come from anywhere, and you would still have the same problem)
Also, you have not mentioned whether you want to use MTOM. That could be very relevant. |
|
Back to top |
|
 |
Orette |
Posted: Mon Jan 27, 2020 11:27 pm Post subject: |
|
|
Newbie
Joined: 22 Mar 2017 Posts: 8
|
Understood; I will work to better my replies in the future using your points as a guideline.
I think for my purposes, I should be using SwA rather than MTOM.
Here is the error, with the web service name removed:
Code: |
ExceptionList
RecoverableException
File:CHARACTER:F:\build\slot2\S1000_P\src\DataFlowEngine\MessageServices\ImbDataFlowNode.cpp
Line:INTEGER:1251
Function:CHARACTER:ImbDataFlowNode::createExceptionList
Type:CHARACTER:ComIbmSOAPRequestNode
Name:CHARACTER:(WebServiceOperationName)
Label:CHARACTER:(WebServiceOperationName)
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:2230
Text:CHARACTER:Node throwing exception
Insert
Type:INTEGER:14
Text:CHARACTER:(WebServiceOperationName)
RecoverableException
File:CHARACTER:F:\build\slot2\S1000_P\src\WebServices\WSLibrary\ImbSOAPRequestNode.cpp
Line:INTEGER:841
Function:CHARACTER:ImbSOAPRequestNode::requestData
Type:CHARACTER:ComIbmSOAPRequestNode
Name:CHARACTER:(WebServiceOperationName)
Label:CHARACTER:(WebServiceOperationName)
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:3754
Text:CHARACTER:Error occurred in ImbSOAPRequestHelper::makeSOAPRequest()
Insert
Type:INTEGER:14
Text:CHARACTER:(WebServiceOperationName)
ParserException
File:CHARACTER:F:\build\slot2\S1000_P\src\WebServices\WSLibrary\ImbSOAPParser.cpp
Line:INTEGER:1439
Function:CHARACTER:ImbSOAPParser::refreshBitStreamFromElementsInner
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:3605
Text:CHARACTER:SOAP tree cannot be serialized
ParserException
File:CHARACTER:F:\build\slot2\S1000_P\src\WebServices\WSLibrary\ImbSOAPParser.cpp
Line:INTEGER:1356
Function:CHARACTER:ImbSOAPParser::refreshBitStreamFromElementsInner
Type:CHARACTER:
Name:CHARACTER:
Label:CHARACTER:
Catalog:CHARACTER:BIPmsgs
Severity:INTEGER:3
Number:INTEGER:3608
Text:CHARACTER:invalid data for SOAP.Attachment.<Content-Id>.BLOB
Insert
Type:INTEGER:5
Text:CHARACTER:BLOB |
|
|
Back to top |
|
 |
timber |
Posted: Tue Jan 28, 2020 1:40 am Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
The error number is BIP3608. The full text of that error is available here: https://www.ibm.com/support/knowledgecenter/en/SSMKHH_10.0.0/com.ibm.etools.mft.bipmsgs.doc/ay_bip3.htm
It says:
Quote: |
BIP3608
The logical tree includes an incorrectly formatted Attachment <insert_1>.
Severity
20 : Error
Explanation
The SOAP logical tree has an Attachment subtree with children corresponding to any attachments in a SOAP with Attachments document. Each child is named after the Content-Id of the corresponding MIME part and must have a child called BLOB as generated by the BLOB parser with a child also called BLOB and containing valid bytearray data.
Response
Check the logical tree and ensure the Attachment data is represented correctly. |
Your ESQL looks correct to me, but I may be missing something. My next step would be to check the structure of the message tree that is being passed to the SOAPRequest node. Attach the debugger or (better) insert a Trace node and set its Pattern property to ${Root}. Check the tree structure against the structure specified in the Knowledge Center. |
|
Back to top |
|
 |
Orette |
Posted: Tue Jan 28, 2020 7:37 am Post subject: |
|
|
Newbie
Joined: 22 Mar 2017 Posts: 8
|
Here is the Trace that I am looking at. I removed a lot of the BLOB text. It looks to match up with the tree structure of that of the Knowledge Center.
Code: |
( ['GENERICROOT' : 0x157e602ad00]
(0x01000000:Name ):Properties = ( ['MQPROPERTYPARSER' : 0x157e68647f0]
(0x03000000:NameValue):MessageSet = NULL
(0x03000000:NameValue):MessageType = NULL
(0x03000000:NameValue):MessageFormat = NULL
(0x03000000:NameValue):Encoding = NULL
(0x03000000:NameValue):CodedCharSetId = NULL
(0x03000000:NameValue):Transactional = NULL
(0x03000000:NameValue):Persistence = NULL
(0x03000000:NameValue):CreationTime = NULL
(0x03000000:NameValue):ExpirationTime = NULL
(0x03000000:NameValue):Priority = NULL
(0x03000000:NameValue):ReplyIdentifier = NULL
(0x03000000:NameValue):ReplyProtocol = 'FILE' (CHARACTER)
(0x03000000:NameValue):Topic = NULL
(0x03000000:NameValue):ContentType = NULL
(0x03000000:NameValue):IdentitySourceType = NULL
(0x03000000:NameValue):IdentitySourceToken = NULL
(0x03000000:NameValue):IdentitySourcePassword = NULL
(0x03000000:NameValue):IdentitySourceIssuedBy = NULL
(0x03000000:NameValue):IdentityMappedType = NULL
(0x03000000:NameValue):IdentityMappedToken = NULL
(0x03000000:NameValue):IdentityMappedPassword = NULL
(0x03000000:NameValue):IdentityMappedIssuedBy = NULL
)
(0x01000000:Folder):SOAP = ( ['SOAP' : 0x157df8e5810]
(0x01000000:Folder):Context = (
(0x01000000:Folder):Namespace = (
(0x03000102:NamespaceDecl)xmlns:doc = 'http://serviceURL' (CHARACTER)
(0x03000102:NamespaceDecl)xmlns:ns = 'http://serviceURL' (CHARACTER)
(0x03000102:NamespaceDecl)xmlns:wsse = 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd' (CHARACTER)
)
)
(0x01000000:Folder):Header = (
(0x01000000:Folder)http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Security = (
(0x01000000:Folder)http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:UsernameToken = (
(0x03000000:PCDataField)http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Username = 'Username' (CHARACTER)
(0x03000000:PCDataField)http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd:Password = 'Password' (CHARACTER)
)
)
)
(0x01000000:Folder):Body = (
(0x01000000:Folder)http://serviceURL = (
(0x01000000:Folder)http://serviceURL = (
(0x01000000:Folder)http://serviceURL = (
(0x03000000:PCDataField):Code = 'AAABBB' (CHARACTER)
(0x03000000:PCDataField):fileName = 'Document Name Here' (CHARACTER)
(0x03000000:PCDataField):CreatedTimestamp = TIMESTAMP '2020-01-28 10:29:54.792191' (TIMESTAMP)
)
(0x01000000:Folder)serviceURL = (
(0x03000000:PCDataField):Code = '121212' (CHARACTER)
)
)
)
)
(0x01000000:Folder):Attachment = (
(0x01000000:Folder):Document Name Here = (
(0x01000000:Folder):MIME_Headers = (
(0x03000000:PCDataField):Content-Id = 'Document Name Here' (CHARACTER)
)
(0x01000000:Folder):BLOB = (
(0x03000000:PCDataField):BLOB = X'255044462d312e370a25e4e3cfd20a31312030206f626a0a3c3c2f537562747970652f496d6167652f5769647468203
138382f486569676874203130382f42697473506572436f6d706f6e656e7420382f436f6c6f7253706163652f4465766963655247422f46696c7465722f4443544465
636f64652f4c656e677468203132203020523e3e0a73747265616d0affd8ffe000104a46494600010101006000600000ffdb00430002010102010102020202020202
02030503030303030604040305070607070706070708090b0908080a0807070a0d0a0a0b0c0c0c0c07090e0f0d0c0e0b0c0c0c' (BLOB)
)
)
)
)
)
|
It is important to note that I also tried commenting out the ESQL that attaches the attachment for just a moment to test the integrity of the SOAP structure.
I got an error response from the web service at least, so this attachment is definitely the problem. |
|
Back to top |
|
 |
timber |
Posted: Tue Jan 28, 2020 12:43 pm Post subject: |
|
|
 Grand Master
Joined: 25 Aug 2015 Posts: 1292
|
Yes, I agree that the structure looks correct.
Not sure whether the value 'Document Name Here' is just to maintain confidentiality. I would try using an id without spaces, if you haven't tried that already. |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jan 29, 2020 8:48 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Could it be as easy as adding in the content-type of the attachment: application/binary ?? The error seems to point that way...  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|