I am trying to use Gerald Lester's WS::Client package, thus:
package require Tcl 8.5
package require http
package require WS::Client
WS::Client::GetAndParseWsdl http://www.marinespecies.org/aphia.php?p=soap&wsdl=1
{} aphia
The package seems to be unable to parse the WSDL, since I get the
following error:
invalid command name "domNode0x833c0 domNode0x83444 domNode0x834c8
domNode0x83acc domNode0x83b50"
while executing
"$childNode setAttribute name $typeName"
(procedure "parseElementalType" line 78)
invoked from within
"parseElementalType $mode serviceInfo $serviceName $element $tns"
(procedure "parseScheme" line 29)
invoked from within
"parseScheme $mode $baseUrl $schema $serviceName serviceInfo tnsCount"
(procedure "ProcessImportXml" line 17)
invoked from within
"ProcessImportXml $mode $baseUrl $xml $serviceName $serviceInfoVar
$tnsCountVar"
(procedure "processImport" line 42)
invoked from within
"processImport $mode $baseUrl $element $serviceName serviceInfo
tnsCount"
(procedure "::WS::Utils::parseScheme" line 23)
invoked from within
"::WS::Utils::parseScheme Client $baseUrl $schemaNode $serviceName
serviceInfo tnsCount"
... ... ....
It is somehow as if only one node was expected here but $childNode is
more than one node. Any hints as to how I ca handle this?
Thanks, Torsten
The package will not handle this.
Normally the SOAP encodings and WSDL definition schema are not imported but
rather referenced.
I'd copy the WSDL down to a local file, change the imports to references
(with the correct namespace aliases) and start from there.
--
+------------------------------------------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
I am using 1.0.8, and I don't get an error with this example.
In fact, I get a result which seems valid. Although I haven't tried to
call anything from the service.
I am using 1.0.8 with 1-2 minor tweaks (that I don't remeber the exact
details).
What is the current version of the package?
Best regards,
George
O/H Gerald W. Lester έγραψε:
> The package will not handle this.
>
> Normally the SOAP encodings and WSDL definition schema are not imported but
> rather referenced.
Wow. That was a quick answer. Thanks a lot, Gerald.
> I'd copy the WSDL down to a local file, change the imports to references
> (with the correct namespace aliases) and start from there.
OK. I did that and removed the two import lines as a first approach.
Now it parses. Fine. I now get an error when doing DoCall, but I need
to look at that one a bit closer. Peraps I should really change the
import to reference. but I don't know how. Let me see ...
Thanks again, Torsten
> I am using 1.0.8, and I don't get an error with this example.
Oh, that is cool.
> In fact, I get a result which seems valid. Although I haven't tried to
> call anything from the service.
Perhaps you can try the following:
WS::Client::GetAndParseWsdl http://www.marinespecies.org/aphia.php?p=soap$wsdl=1
{} aphia
set results [::WS::Client::DoCall aphia getAphiaID [list
scientificname "Hydrobia ulvae"]]
puts $results
The resulting ID should be 140126.
> I am using 1.0.8 with 1-2 minor tweaks (that I don't remeber the exact
> details).
> What is the current version of the package?
I am using the current download from Gerald's site.
Regards, Torsten
Yes you should.
(Ellogon) 2 % package require Tcl 8.5
8.5.4
(Ellogon) 3 % package require http
2.7.1
(Ellogon) 4 % package require WS::Client
1.0.8
(Ellogon) 5 % WS::Client::GetAndParseWsdl
http://www.marinespecies.org/aphia.php?p=soap&wsdl=1 {} aphia
service {name aphia location
http://www.marinespecies.org/aphia.php?p=soap} targetNamespace {{tns1
http://aphia/v1.0} ... [rest removed]
(Ellogon) 6 % set results [::WS::Client::DoCall aphia getAphiaID [list
scientificname "Hydrobia ulvae"]]
return 140126
>
>> I am using 1.0.8 with 1-2 minor tweaks (that I don't remeber the exact
>> details).
>> What is the current version of the package?
>
> I am using the current download from Gerald's site.
>
> Regards, Torsten
>
>
Unfortunately I don't. I started using it at some point and I needed to
do some minor changes due to some issues I had with a C# server. Now
that the project ended, I should catch up with latest code from Gerald,
and see if my changes are still needed...
George
WS::Client works great, but I didn't know that it worked with old
style "rpc/encoded" services. Usually interoperability with anything
other than a WS-I Basic Profile conforming service is based upon
chance or luck.
I'd expect "document/literal" to work as well (and in the Java world
at least, it's recommended for complex work anyway) though in that
case it is up to your to form the query and parse the result. Not that
I've had a chance to test it yet. :-)
Donal.
It works with document/literal and rpc/encoded.
The WSDL, IMHO, is ill formed.
Yes, it works great with "document/literal", I didn't expect it to
work with encoded. I've tested WS::Client with all of my test web
services, which includes many structural forms for input and output
documents. Although I think it failed to work with operations which
returned an empty document (just the empty return message element in
the SOAP-Body).
The subject WSDL doesn't seem useful for automatic stubs generation,
and it doesn't describe a service which conforms to the WS-I Basic
Profile, so the issue isn't WS::Client.
sorry for the delay, I was busy ...
> >> I am using 1.0.8 with 1-2 minor tweaks (that I don't remeber the exact
> >> details).
> >> What is the current version of the package?
>
> > I am using the current download from Gerald's site.
>
> > Regards, Torsten
>
> Unfortunately I don't. I started using it at some point and I needed to
> do some minor changes due to some issues I had with a C# server. Now
> that the project ended, I should catch up with latest code from Gerald,
> and see if my changes are still needed...
Would it be possible for you to send the changed sources of the
WS::Client package to me or are the changes made under some contract
and may not be given away? I could then compare to the current
version, submit a patch to Gerald and benefit from the package working
for my special case.
Thanks again, Torsten
Of course I can send you my changes. You can find them here:
http://www.ellogon.org/~petasis/tcl/WebServices1.0.8.zip
I don't recall the changes to be that many towards the official version
I used as a basis, just 1-2 changes to enhance compatibility with a C#
client/server (and 1-2 that relate to using variables not defined in log
messages). But it would be nice to compare these sources with the latest
version and port the changes there :-)
George
>
> Of course I can send you my changes. You can find them here:
>
> http://www.ellogon.org/~petasis/tcl/WebServices1.0.8.zip
Thank you very much! I tried the script with your patched version and
it works great. I could also use other DoCall methods. Wonderful.
>
> I don't recall the changes to be that many towards the official version
> I used as a basis, just 1-2 changes to enhance compatibility with a C#
> client/server (and 1-2 that relate to using variables not defined in log
> messages). But it would be nice to compare these sources with the latest
> version and port the changes there :-)
I had a look at the sources and it seems that you made most changes to
the Utilities.tcl file and only a minor change to ClientSide.tcl. I
will have a closer look during the next days and then hopefully
understand what is going on here.
Torsten