Author |
Message
|
tillchad |
Posted: Mon Apr 08, 2013 4:55 am Post subject: Help with parsing SOAP input |
|
|
Newbie
Joined: 17 Dec 2010 Posts: 4
|
I'm having trouble coming up with the namespace declarations and parse syntax to get at the ChannelCode.
Code: |
<m:calculate xmlns:m="http://soap.sforce.com/schemas/class/Service">
<ServiceInput>
<ChannelCode>10</ChannelCode>
</ServiceInput>
</m:calculate>
|
I'm not sure what that "m:" is in front of the calculate or howto reference it.
If they don't send me the m: that below works, but with that m: it does not.
Code: |
DECLARE ns1 NAMESPACE 'http://soap.sforce.com/schemas/class/Service';
set Environment.channel_code = InputRoot.XMLNSC.ns1:calculate.ns1:ServiceInput.ns1:ChannelCode;
|
|
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Apr 08, 2013 4:57 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Insert a Trace node after your SOAPInput, and copy that namespace letter-for-letter from the Trace output.
Also remove ns1 from ServiceInput and ChannelCode.
Name your variables with meaningful names, ns1 means very little.
Your lead should be InputRoot. SOAP.Body. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
tillchad |
Posted: Mon Apr 08, 2013 5:24 am Post subject: |
|
|
Newbie
Joined: 17 Dec 2010 Posts: 4
|
Thanks so much for the quick reply.
This is a flow deep after the SOAP node. It takes the soap payload and puts
to a queue. We then pull from that queue and parse as XMLNSC.
Here's the trace. Not sure what to do with that ":m"
Code: |
(0x01000000:Folder)http://soap.sforce.com/schemas/class/Service:calculate = (
(0x03000102:NamespaceDecl)http://www.w3.org/2000/xmlns/:m = 'http://soap.sforce.com/schemas/class/Service' (CHARACTER)
(0x01000000:Folder ):ServiceInput = (
(0x03000000:PCDataField):ChannelCode = '10' (CHARACTER)
|
|
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Apr 08, 2013 5:30 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
Within the XML doc, m is shorthand for 'http://soap.sforce.com/schemas/class/Service'. You may disregard it, since you want to reference the namespace in its long form.
Have you attended the training? Would be good for you to go, to get interactive conversation with other students and the instructor.
There are 9 days of training on the developer roadmap. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
tillchad |
Posted: Mon Apr 08, 2013 6:47 am Post subject: |
|
|
Newbie
Joined: 17 Dec 2010 Posts: 4
|
No training yet.......
So the below should work then? It's not.
Code: |
DECLARE ns1 NAMESPACE 'http://soap.sforce.com/schemas/class/Service';
set Environment.channel_code = InputRoot.XMLNSC.ns1:calculate.ServiceInput.ChannelCode;
|
|
|
Back to top |
|
 |
kimbert |
Posted: Mon Apr 08, 2013 6:53 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
The m: is an XML namespace prefix.
If you do not know what a namespace prefix is, can I politely suggest that you find out, and do it quickly. The W3Schools XML tutorial is quite good. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Apr 08, 2013 6:56 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
tillchad wrote: |
No training yet.......
So the below should work then? It's not.
Code: |
DECLARE ns1 NAMESPACE 'http://soap.sforce.com/schemas/class/Service';
set Environment.channel_code = InputRoot.XMLNSC.ns1:calculate.ServiceInput.ChannelCode;
|
|
Your training would teach you how to solve this problem. Reading the InfoCentre would also help you. Trying out several of the samples provided with the toolkit would help as well.
If you post ${Root} from your Trace node, we could see the whole payload and tell you what you need to do.
The current post shows this:
ns1:calculate.ServiceInput.ChannelCode;
It does not show what comes prior to that. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Apr 08, 2013 7:01 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
lancelotlinc wrote: |
There are 9 days of training on the developer roadmap. |
Sigh,
Please remember that not all NINE days of training are scheduled everywhere in the world. In some places the second part is merely a wish list on the schedule. There are parts of the world where things are very different to that in the USA.
I'm off to Chennai (again) in a few hours and I know that the skill levels of the local devs is pretty limited. There are NO funds available for training. Please suggest how these people can meet your lofty requirements other than sometimes asking some pretty dumb questions. (at least the lot I'm going to see ask questions and don't just say, 'I have this requirement') _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Apr 08, 2013 7:07 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
smdavies99 wrote: |
lancelotlinc wrote: |
There are 9 days of training on the developer roadmap. |
Sigh,
Please remember that not all NINE days of training are scheduled everywhere in the world. In some places the second part is merely a wish list on the schedule. There are parts of the world where things are very different to that in the USA.
I'm off to Chennai (again) in a few hours and I know that the skill levels of the local devs is pretty limited. There are NO funds available for training. Please suggest how these people can meet your lofty requirements other than sometimes asking some pretty dumb questions. (at least the lot I'm going to see ask questions and don't just say, 'I have this requirement') |
There are options for all peoples, and if one has an internet connection, one need not travel.
The 9-day developer roadmap is not owned by me. It's not my requirement, and certainly not limited to USA students. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
smdavies99 |
Posted: Mon Apr 08, 2013 7:51 am Post subject: |
|
|
 Jedi Council
Joined: 10 Feb 2003 Posts: 6076 Location: Somewhere over the Rainbow this side of Never-never land.
|
and if there is no money for training?
What then?
This is more common that you might like to think especially at IBM US $$$$$$ rates _________________ WMQ User since 1999
MQSI/WBI/WMB/'Thingy' User since 2002
Linux user since 1995
Every time you reinvent the wheel the more square it gets (anon). If in doubt think and investigate before you ask silly questions. |
|
Back to top |
|
 |
lancelotlinc |
Posted: Mon Apr 08, 2013 7:58 am Post subject: |
|
|
 Jedi Knight
Joined: 22 Mar 2010 Posts: 4941 Location: Bloomington, IL USA
|
smdavies99 wrote: |
and if there is no money for training?
What then?
This is more common that you might like to think especially at IBM US $$$$$$ rates |
Coaching, mentoring, compiling/deploying the included sample programs, and reading the InfoCentre are all good 'no-cost' options.
I've seen objections to posts occur when none of the above are pursued and the poster expects to be hand-fed by the people who have invested (effort and finances) in their own destiny. _________________ http://leanpub.com/IIB_Tips_and_Tricks
Save $20: Coupon Code: MQSERIES_READER |
|
Back to top |
|
 |
Vitor |
Posted: Mon Apr 08, 2013 9:08 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
lancelotlinc wrote: |
I've seen objections to posts occur when none of the above are pursued and the poster expects to be hand-fed by the people who have invested (effort and finances) in their own destiny. |
True, and this is the flip side of the coin to where a link to training is given as the answer to every question. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|