Re: tclsoap array-based queries



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|
+------------------------------------------------------------------------+
.



Relevant Pages

  • TSLSA-2007-0007 - multi
    ... Affected versions: Trustix Secure Linux 2.2 ... The mod_php module enables the Apache web server to ... The postgresql package includes the client programs and libraries ... SECURITY Fix: Fetchmail does not properly enforce TLS and may ...
    (Bugtraq)
  • Re: remotely call a DTS
    ... Allan Mitchell wrote: ... Denied on something inside the package. ... This worked when I was logged into the server and ran it from my ... but the DTS blows up. ...
    (microsoft.public.sqlserver.dts)
  • Re: sunmanagers Digest, Vol 34, Issue 14
    ... Christopher sent me a link to ftp.cs.tu-berlin.de that has all patches sun ... Subject: SUMMARY: Setting up mail on a Solaris Server ... however I seem to be having issues finding a binary package. ... Problems while installing 108528-29 for Sol8 machine ...
    (SunManagers)
  • Re: DTS Environment Control
    ... Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP) www.SQLDTS.com - The site for all your DTS needs. ... When run from the production environment, the production server is accessed and when run from the test environment, the test server is accessed. ... For simple packages it's not too big of deal - but for more complete ones - you can spend an hour carefully changing all your connections. ... I had one solution where we would add an ActiveX script task as the very first step, that would determine what SERVER the package was executing from - and based on that would dynamically change all the connections by looking up the package name and server from a DB. ...
    (microsoft.public.sqlserver.dts)
  • is yum working? unable to update a system
    ... # yum update ... Server: Dag RPM Repository for Fedora Core ... .Package mplayer-mencoder needs libxvidcore.so.2, this is not ...
    (Fedora)