Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem using WS::Client package with a Web Service

84 views
Skip to first unread message

Torsten Berg

unread,
Jul 3, 2009, 10:36:53 AM7/3/09
to
Hi,

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

Gerald W. Lester

unread,
Jul 3, 2009, 11:12:15 AM7/3/09
to
Berg,

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

George Petasis

unread,
Jul 3, 2009, 3:11:38 PM7/3/09
to Gerald...@cox.net
Dear Gerald,

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 έγραψε:

Torsten Berg

unread,
Jul 3, 2009, 4:56:51 PM7/3/09
to
Hi,


> 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

Torsten Berg

unread,
Jul 3, 2009, 5:11:19 PM7/3/09
to
Hi George,

> 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


Gerald W. Lester

unread,
Jul 3, 2009, 6:13:43 PM7/3/09
to

Yes you should.

George Petasis

unread,
Jul 4, 2009, 2:35:39 PM7/4/09
to Torsten Berg
O/H Torsten Berg έγραψε:

> Hi George,
>
>> 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.
Yes, it does:

(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

tom.rmadilo

unread,
Jul 4, 2009, 11:49:07 PM7/4/09
to
On Jul 3, 8:12 am, "Gerald W. Lester" <Gerald.Les...@cox.net> wrote:
> Berg,
>
> 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.

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.

dkf

unread,
Jul 5, 2009, 6:58:02 AM7/5/09
to
On 5 July, 04:49, "tom.rmadilo" <tom.rmad...@gmail.com> wrote:
> 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.

Gerald W. Lester

unread,
Jul 5, 2009, 1:05:56 PM7/5/09
to

It works with document/literal and rpc/encoded.

The WSDL, IMHO, is ill formed.

tom.rmadilo

unread,
Jul 5, 2009, 1:55:00 PM7/5/09
to

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.

Torsten Berg

unread,
Jul 23, 2009, 6:22:07 AM7/23/09
to
Hi again,

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

Georgios Petasis

unread,
Jul 23, 2009, 10:08:53 AM7/23/09
to Torsten Berg
O/H Torsten Berg έγραψε:

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

Torsten Berg

unread,
Jul 23, 2009, 4:40:26 PM7/23/09
to
Hi 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

0 new messages