You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hello,
I would like to be able to generate a XML message like the one below
dynamically, i,e from variables/list params. I briefly looked at
tclsoap and the basic example didn't work and still researching tclws.
The latter requires wsdl file parsing and the WSDL files I have are
quite complex and nested.
So, I was wondering about tdom, but the examples seem to be more DTD
oriented.
Any pointers appreciated! Thanks.
Here is a sample XML request that I need to be able generate from
variables.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
When I see XML used this way, I am suddenly nostalgic of ASN.1...
(I know it is not your fault, and I have a precise idea of where the
dim-witted designers of SOAP belong ;-)
-Alex
anj patnaik
unread,
Feb 6, 2012, 3:26:30 PM2/6/12
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
You want the output and input, right?
Ok, I have attached the output when the input above has a
requestedBatchSize of 3.
Note that I am only interested in building input from vars/list. The
output will be probably be a dump of what's fetched from http::data.
Aric Bills
unread,
Feb 6, 2012, 5:44:34 PM2/6/12
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Sorry if I wasn't clear enough before. In your original post, you
showed us an example of the XML file you wanted to generate. You said
you want to generate this from a set of variables or list of
parameters. Can you give us the variables or parameters that are
supposed to produce the XML file in your original post?
anj patnaik
unread,
Feb 6, 2012, 7:07:59 PM2/6/12
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
I'd probably use a list or list of lists to denote the data to be set.
Something like this for the header:
set header { communicationStyle RPC activityName getActiveAlarms
msgType REQUEST ...}
set body {filter {perceivedSeverityList {CLEARED}}}
Note that since SOAP body params are many levels deep I probably need
a list of lists or something.
I am using Tcl 8.4.
THANKS.
Aric Bills
unread,
Feb 7, 2012, 12:45:09 AM2/7/12
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
OK, thanks for clarifying.
tdom does provide functionality for building a DOM tree from a list,
using [$doc appendFromList $list] or [$node appendFromList $list].
appendFromList expects a list with two or three items. If the first
list item is "#text", tdom creates a text node whose contents are the
second item in the list. Otherwise, the first item names the node to
be created, the second item is a list of attribute-value pairs, and
the third item is a list of children; each child should also be a two-
or three-item list. Here's a trivial example:
package require tdom
set booklist {
{book {type fiction} {{#text {Gulliver's Travels}}}}
{book {type nonfiction} {{#text {Tcl and the Tk Toolkit}}}}
}
set bookDocAsList [list books [list] $booklist]
dom createDocumentNode bookdoc
$bookdoc appendFromList $bookDocAsList
This will create a DOM tree corresponding to the following document:
<books>
<book type="fiction">Gulliver's Travels</book>
<book type="nonfiction">Tcl and the Tk Toolkit</book>
</books>
By the way, you can produce the corresponding XML document using
$bookdoc asXML
In the case of your XML document from your original post, you could
create it like this (you'll have to remove the extra newlines inserted
by Google Groups):
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
On 2/6/12 12:45 PM, anj patnaik wrote:
> Hello,
>
> I would like to be able to generate a XML message like the one below
> dynamically, i,e from variables/list params. I briefly looked at
> tclsoap and the basic example didn't work and still researching tclws.
> The latter requires wsdl file parsing and the WSDL files I have are
> quite complex and nested.
>
> So, I was wondering about tdom, but the examples seem to be more DTD
> oriented.
>
> Any pointers appreciated! Thanks.
>
> Here is a sample XML request that I need to be able generate from
> variables.
Anj,
tclws uses tdom to build an parse the XML.
You have the following options:
1) Take your several partial WSDLs and make them one full WSDL and use tclws
-- this requires that you be able to read and understand your WSDLs.
2) Generate/parse the the XML using a package such as tdom -- this requires
that you be able to read and understand your WSDLs.
3) Generate/parse the the XML by hand (using format, string functions and
commands) -- this requires that you be able to read and understand your WSDLs.
Note -- there is a common step that you can not skip.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to anj patnaik
On 2/7/12 10:42 AM, anj patnaik wrote:
> Hi Gerald,
>
> I already tried #1 and sent you several emails as tclws errored out
> when parsing the combined wsdl file.
Anj,
You sent me two (2) emails after combining the WSDLs.
The first one you discovered your error (you were passing a file name to
::WS::ParseWsdl instead of the actual XML).
The second error was after you were passing the XML and the message
indicates it could not find a type -- not likely either it is missing or
there is an XML namespace/alias conflict from when you made the single WSDL.
I said I would look at it but it would take a couple of days to get to it.
The problem here is that the WS you want to use is being presented in a
**VERY** non-standard way *AND* you do not understand the format and content
of a WSDL enough to correct the presentation.
Early on you stated that this was from a "standard body" -- but you have
never said which one or given any relevant URLs.
In short, you are looking for a silver bullet of a particular caliber.
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to anj patnaik
On 2/7/12 3:15 PM, Gerald W. Lester wrote:
> On 2/7/12 10:42 AM, anj patnaik wrote:
>> Hi Gerald,
>>
>> I already tried #1 and sent you several emails as tclws errored out
>> when parsing the combined wsdl file.
>
> Anj,
>
> You sent me two (2) emails after combining the WSDLs.
>
> The first one you discovered your error (you were passing a file name to
> ::WS::ParseWsdl instead of the actual XML).
>
> The second error was after you were passing the XML and the message
> indicates it could not find a type -- not likely either it is missing or
> there is an XML namespace/alias conflict from when you made the single WSDL.
> I said I would look at it but it would take a couple of days to get to it.
>
> The problem here is that the WS you want to use is being presented in a
> **VERY** non-standard way *AND* you do not understand the format and content
> of a WSDL enough to correct the presentation.
>
> Early on you stated that this was from a "standard body" -- but you have
> never said which one or given any relevant URLs.
>
> In short, you are looking for a silver bullet of a particular caliber.
Anj,
Went in looked at the combined WSDL you sent and the "associated" XSDs.
Your WSDL you have several lines that read:
<wsdl:part name="mtopHeader" element="hdr:header"/>
However, you do not have hdr defined as a namespace alias in the WSDL. You
do have hdr defined as a namespace alias in MessageDefinitions.xsd.
Also I noticed that you are doing imports of XSDs you did not send me, such
as LayerRates.xsd.
Lastly a lot of your XSD imports have relative paths such as:
../../../NetworkResourceAssurance/IIS/xsd/CommonTypes.xsd
This means that you really be having a base WSDL at a server with the tree
layout expected. Luckly, TclWs can get around this via the use of:
::WS::Utils::SetOption includeDirectory $xdDirectory
All that being said, IMHO from the things you keep missing you are in over
your head. You may want to bring in a consultant to help you get your job done.