Re: tclsoap array-based queries
- From: "Gerald W. Lester" <Gerald.Lester@xxxxxxx>
- Date: Sun, 10 Aug 2008 18:42:16 -0500
Kevin,
If this is a Server that has a WSDL, you may want to try the Web Services for Tcl package that I wrote -- it handles arrays.
jkj wrote:
I'm having trouble submitting an array as part of a query to a SOAP
server. The same problems occur when switching to a Perl
implementation (which is not what I want to use anyway). Following is
the code, the XML sent as the query, and the server's error reply. My
hunch is that the 1999 and 2001 references are "red-herrings" and that
this query should work, given some better sense of how to generate the
array information - all of my [non-array] string queries to this
server are working just fine.
Any feedback would be appreciated. I am using tclsoap-1.6.7 on Linux
[Fedora-7]. I have been stepping through the code with RamDebugger
6.2, but it seems as if every part of the code I step through has to
be part of a monolithic file, as breakpoints I set in other files are
ignored. Anyway, I'll continue to poke through the code, but knowing
for certain what XML needs to be produced for this server would help
me know how to either modify my invocation or write a separate routine
(passed as -wrapProc) to generate the query.
Thanks,
-Kevin
The following code:
**************************************************************************************
package require tcldom
package require SOAP
# Provides the names of all the instrument types available for the
specified view[s].
proc call_getInstruments {mission instrList} {
upvar $mission missionList $instrList instruments
set params [ list "arrayOfString_1" "string()" ]
foreach src $missionList {
if {[catch {SOAP::create getInstruments \
-uri "http://cdaweb.gsfc.nasa.gov/WS/CDASWS" \
-proxy "http://cdaweb.gsfc.nasa.gov/WS/jaxrpc" \
-params $params} err_msg]} {
puts stderr "call_getInstruments Create error: $err_msg"
} else {
if {[catch {set instrGroup_list [getInstruments $src]} err_msg]}
{
puts stderr "call_getInstruments Invocation error: $err_msg"
} else {
set typesList($view) $instrGroup_list
}
}
}
} ;# call_getInstruments
set sat "ace"
call_getInstruments sat instr_array
**************************************************************************************
generates the following XML:
**************************************************************************************
<?xml version='1.0'?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/
envelope/'
xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/
encoding/'
SOAP-ENV:encodingStyle='http://schemas.xmlsoap.org/
soap/encoding/'
xmlns:xsd='http://www.w3.org/1999/XMLSchema'
xmlns:xsi='http://www.w3.org/1999/XMLSchema-
instance'>
<SOAP-ENV:Body>
<ns:getInstruments xmlns:ns='http://cdaweb.gsfc.nasa.gov/WS/
CDASWS'>
<arrayOfString_1 xmlns:SOAP-ENC='http://schemas.xmlsoap.org/soap/
encoding/'
xsi:type='SOAP-ENC:Array'
SOAP-ENC:offset='[0]'
SOAP-ENC:arrayType='xsd:string[1]'>
<item xsi:type='xsd:string'>ace
</item>
</arrayOfString_1>
</ns:getInstruments>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
**************************************************************************************
and the server gives the following error:
Invocation error: env:Client
{JAXRPCTIE01: caught exception while handling request:
unexpected array element type:
expected={http://www.w3.org/2001/XMLSchema}string,
actual={http://www.w3.org/1999/XMLSchema}string}
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
.
- Follow-Ups:
- Re: tclsoap array-based queries
- From: jkj
- Re: tclsoap array-based queries
- References:
- tclsoap array-based queries
- From: jkj
- tclsoap array-based queries
- Prev by Date: tclsoap array-based queries
- Next by Date: Re: Want to know when a batch file is done
- Previous by thread: tclsoap array-based queries
- Next by thread: Re: tclsoap array-based queries
- Index(es):
Relevant Pages
|