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

TclSOAP and SOAP headers

58 views
Skip to first unread message

David Easton

unread,
Aug 1, 2006, 6:26:19 AM8/1/06
to
Hi,

I've just started trying TclSOAP to demonstrate Tcl can be used as a
web service client.

I haven't found anything on comp.lang.tcl, the wiki or help files that
describes how to set anything in the SOAP headers.

Our webservices require the username and password to be supplied as
part of the SOAP headers as follows:

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Credentials xmlns="http://OurURL.WebServices">
<Username>username</Username>
<Password>password</Password>
</Credentials>
</soap:Header>
<soap:Body>
<DisableService xmlns="http://OurURL.WebServices">
<macAddress>string</macAddress>
</DisableService>
</soap:Body>
</soap:Envelope>

I can generate the following very easily using TclSOAP
<?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:DisableService xmlns:ns="OurURL.WebServices">
<macAddress xsi:type="xsd:string">00:A0:BD:00:00:0A</macAddress>
</ns:DisableService>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

Is there an easy (or even a hard) way to add the soap header? Do I
need to define a -wrapProc and do this manually?

Any help or pointers would be appreciated.

Thanks,
David.

Gerald W. Lester

unread,
Aug 1, 2006, 3:19:28 PM8/1/06
to
David Easton wrote:
> Hi,
>
> I've just started trying TclSOAP to demonstrate Tcl can be used as a
> web service client.
>
> I haven't found anything on comp.lang.tcl, the wiki or help files that
> describes how to set anything in the SOAP headers.
>
> Our webservices require the username and password to be supplied as
> part of the SOAP headers as follows:

I *think* you have more problems then just adding the soap:Header. Your
sample looks like it is a document/literal request. TclSoap only handles
rpc/encoded request.


--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+

Gerald W. Lester

unread,
Aug 1, 2006, 3:22:41 PM8/1/06
to
Dave,

I'm working on a new Web Services package that will handle document/literal
server and client side as well as rpc/encoded client side. For server side,
it automatically generates the WSDL. For client side it parses the WSDL.

I had not seen the soap:Header yet, so it does not handle it -- yet.

Do you want me to send you what I have -- you can modify it to add the
soap:Header or wait until I have a chance to do so.

Also can you send me a WSDL for your services?

davidh...@simplifiedlogic.com

unread,
Aug 1, 2006, 9:08:30 PM8/1/06
to
Gerald,

When do you think this will be done - this sounds very interesting...

Dave

Gerald W. Lester

unread,
Aug 1, 2006, 10:32:30 PM8/1/06
to
davidh...@simplifiedlogic.com wrote:
> Gerald,
>
> When do you think this will be done - this sounds very interesting...

At the moment I'm feature complete and looking to document it.

It should be all ready by the conference -- and for any brave souls right now.

One of my test cases involves two oracle queries (a master - detail type
thing). With one thread on a 2Ghz box with 2GB of memory I get about 75
request/second serviced. Adding some threads in I can get that up to about
150 request/second.

David Easton

unread,
Aug 2, 2006, 4:39:55 AM8/2/06
to
I don't really know the difference between the rpc/encoded request and
the document/literal request. I assume that I am trying to do
rpc/encoded requests.

What I'm trying to do is connect to a web service that uses Microsoft
.NET. This web service is designed as a machine interface to carry out
actions for which a user would usually use a web interface.

The sample SOAP envelope was the one shown in Internet Explorer when
the URL of the web service was entered.

I'd be very interested in trying your new web services package, Gerald.
I'll send you an email separately with the WSDL and my email address.

Thanks,
David.

Gerald W. Lester

unread,
Aug 2, 2006, 11:31:07 AM8/2/06
to
David Easton wrote:
> I don't really know the difference between the rpc/encoded request and
> the document/literal request. I assume that I am trying to do
> rpc/encoded requests.

Nope, .net wants document/literal.

Look in the WSDL for entries with style and use attributes. Style ==
document, use == literal.

> What I'm trying to do is connect to a web service that uses Microsoft
> .NET. This web service is designed as a machine interface to carry out
> actions for which a user would usually use a web interface.

0 new messages