Author |
Message
|
devamar28 |
Posted: Wed Jan 04, 2017 10:15 am Post subject: Soap With Attachment |
|
|
Novice
Joined: 04 Jan 2017 Posts: 10
|
Hello I'm trying to create a Soap Request in compute node and sending that to the soap request node. While creating the request there are two parameters I need to match
1. In the request I should be attaching a file(this if I use soap ui I can use attachment tab and attach it) Im unable to understand how to attach a file in the request which is created using compute node.
2. I need to set the property MTOM = True
Below is the request I'm trying to create using compute node
<soap:Envelope xmlns:soap="">
<soap:Header>
<ns3:CallOptions xmlns:ns3="" xmlns:ns2="" xmlns:ns4="">
<ns3:useSingleTransaction>false</ns3:useSingleTransaction>
</ns3:CallOptions>
<ns3:SessionHeader xmlns:ns3="" xmlns:ns2="" xmlns:ns4="">
<ns3:session>******</ns3:session>
</ns3:SessionHeader>
</soap:Header>
<soap:Body>
<ns2:create xmlns:ns2="" xmlns:ns3="" xmlns:ns4="">
<ns2:zObjects xmlns:xsi="" xsi:type="ns4:Import">
<ns4:FileContent>cid:Genco_Sample_Usage.csv</ns4:FileContent>
<ns4:ImportType>Usage</ns4:ImportType>
[b]<ns4:Name>text/plain;name=Sample_Usage.csv</ns4:Name>[/b]
</ns2:zObjects>
</ns2:create>
</soap:Body>
</soap:Envelope>
Can some one please help me and let me know on how to attach a file when I use compute node to create a soap request
My flow is
DB---->Compute(creating soap request with attachment of file)----->SOAPREQUEST |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 04, 2017 10:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Do you really want an MTOM message or do you want an SwA message (which is more what your posted XML looks like)?
Which part of this isn't working for you? What exactly is going wrong?
Why are you trying to create the entire message in the Compute node? If you try and add a SOAP Envelope to the request message and then pass that to the SOAPRequest node I'm not surprised you're having problems. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
devamar28 |
Posted: Wed Jan 04, 2017 10:48 am Post subject: |
|
|
Novice
Joined: 04 Jan 2017 Posts: 10
|
Hello Vitor, sorry if I was not clear. I'm trying to pull something from a database convert that to a base64encode and store it in a file(any format). This file I need to attach in the request and send it.
So in a compute node I'm connecting to db pulling the data, mapping then transforming(base64encode) the data and storing it in a file. How do I attach this file to the soap request above? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 04, 2017 11:24 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
You don't attach a file. You add data to the logical message tree. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 04, 2017 12:07 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
You don't attach a file. You add data to the logical message tree. |
You're also talking about 2 conflicting requirements. You're either attaching a file as an attachment to the XML or you're including a base64 encoded string in the XML.
Which is it? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
devamar28 |
Posted: Wed Jan 04, 2017 12:21 pm Post subject: |
|
|
Novice
Joined: 04 Jan 2017 Posts: 10
|
The first one Vitor, I'm trying to attach a file to the XML as an attachment |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 04, 2017 12:40 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
devamar28 wrote: |
The first one Vitor, I'm trying to attach a file to the XML as an attachment |
So why are you base64 encoding it? Isn't that just going to annoy whoever's receiving it?
Once you've created it, where to you plan to store it prior to attachment?
How will you prevent wherever you're storing it from filling?
And as I asked before and you didn't answer:
Do you want MTOM or SwA?
What goes wrong when you follow the instructions in the InfoCenter? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
devamar28 |
Posted: Wed Jan 04, 2017 12:59 pm Post subject: |
|
|
Novice
Joined: 04 Jan 2017 Posts: 10
|
1. The receiver wants the file to be sent Via SOAPRequest(In the form of actual file not just the content).
2. The receiver wants the file content to be BASE64ENCODED
Right now I'm storing the output file in a queue(A file which contains data pulled from DB mapped and converted to BASE64). From this queue I'm unable to understand how to send this output file through a SOAPRequest.
I will be needing MTOM. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Jan 04, 2017 1:09 pm Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
SOAP goes over HTTP.
SOAP messages only have data in them, not files.
It doesn't make sense to say " the file to be sent Via SOAPRequest(In the form of actual file not just the content"
The contents of the file are the file, except that the contents will be put in a certain kind of container and marked with certain attributes when put to a file system - to be a "file" rather than a set of data.
Again, you don't store "a file" in a queue. You store a message, which has the contents of data.
You currently have created some MQ message with a set of data in it that represents the contents of some file but encoded as base64.
You can attach the contents of this message by inserting it into the right place in the logical message tree that will go to the SOAPRequest node.
The only place you would be working with a file here is however you add the contents of a file into an MQ message. _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 04, 2017 1:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
mqjeff wrote: |
SOAP goes over HTTP.
SOAP messages only have data in them, not files.
It doesn't make sense to say " the file to be sent Via SOAPRequest(In the form of actual file not just the content"
The contents of the file are the file, except that the contents will be put in a certain kind of container and marked with certain attributes when put to a file system - to be a "file" rather than a set of data.
Again, you don't store "a file" in a queue. You store a message, which has the contents of data.
You currently have created some MQ message with a set of data in it that represents the contents of some file but encoded as base64.
You can attach the contents of this message by inserting it into the right place in the logical message tree that will go to the SOAPRequest node.
The only place you would be working with a file here is however you add the contents of a file into an MQ message. |
Especially with my most worthy associate here:
Quote: |
It doesn't make sense to say " the file to be sent Via SOAPRequest(In the form of actual file not just the content" |
If you don't agree, say so; don't just avoid the comment by double posting the original question again. Your requirement makes no sense; what you're doing in SoapUI (which you claim works) is fundamentally different in concept to what you've explained the requirement to be and is not what you think SoapUI is doing.
I for one am sorry we've disappointed you with our answers. Perhaps you'll have better luck with the listserver. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
devamar28 |
Posted: Thu Jan 05, 2017 7:54 am Post subject: |
|
|
Novice
Joined: 04 Jan 2017 Posts: 10
|
I for one am pretty new to web services and WMB, hence the amature questioning or usage of words sorry about that.
While sending a soap request using a soap UI if we want to send a file we go to the attachment section and attach a file to the request and send it right?
This exact same thing I'm trying to do using WMB so I'm confused on how to get there
 |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jan 05, 2017 8:22 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
devamar28 wrote: |
I for one am pretty new to web services and WMB, hence the amature questioning or usage of words sorry about that.
While sending a soap request using a soap UI if we want to send a file we go to the attachment section and attach a file to the request and send it right?
This exact same thing I'm trying to do using WMB so I'm confused on how to get there
 |
So have you read and tried what is explained here:
http://www.ibm.com/support/knowledgecenter/search/Soap%20with%20attachments?scope=SSMKHH_10.0.0
 _________________ MQ & Broker admin |
|
Back to top |
|
 |
devamar28 |
Posted: Fri Jan 06, 2017 10:22 am Post subject: |
|
|
Novice
Joined: 04 Jan 2017 Posts: 10
|
Thanks everyone for all your help!!  |
|
Back to top |
|
 |
|