Re: SOAP via HTTP
- From: KevinO <kevino_2@xxxxxxxxx>
- Date: Fri, 27 Jun 2008 07:11:11 -0700 (PDT)
On Jun 26, 3:26 pm, "Gerald W. Lester" <Gerald.Les...@xxxxxxx> wrote:
KevinO wrote:
On Jun 26, 2:43 pm, "Gerald W. Lester" <Gerald.Les...@xxxxxxx> wrote:
Kevin,
Without more details about the errors, it is awful hard to help you.
Is this for a web service that has a WSDL?
If so you might want to have a look at Web Services for Tcl (the client
side), available athttp://code.google.com/p/tclws.
You may want to look at the details of what it does with the ::http::* calls
even if you don't use the package (because they successfully make SOAP calls).
KevinO wrote:
Hi--
I need to convert the following information to a Tcl/http POST:
POST /X/Y/Serial.asmx HTTP/1.1
Host: xyz.net
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://uri.org/getSerialNumber"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope Bla.../">
<soap:Body>
<getSerialNumber xmlns="http://uri.org/">
<serialNumber>int</serialNumber>
</getSerialNumber>
</soap:Body>
</soap:Envelope>
(Yes, it is SOAP, but I prefer to use http and not tclSOAP.)
Here is what I have done (unsuccessfully, of course):
set Form [ subst {<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope Bla.../">
<soap:Body>
<GetTicketStatus xmlns="http://tempuri.org/">
<ticketNumber>12345678</ticketNumber>
</GetTicketStatus>
</soap:Body>
</soap:Envelope>} ]
set formLen [ string length $Form ]
set token [ ::http::geturl $Proxy \
-headers [ list SOAPAction "http://tempuri.org/
GetTicketStatus" ] \
-headers [ list Content-Type {text/xml; charset=utf-8} ] \
-headers [ list Content-Length $formLen ]
-query $formData
I get a variety of error messages depending on the experiment I am
conducting...
If it is not clear already, I am a total novice in http, xml, soap.
Can someone please put me on the path to success here...?
Many thanks
KO
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
Gerald
I will look at the information in the site, thanks for that and for
replying.
My code, as provided above, produces this error message:
<h1>Bad Request (Invalid Header Name)</h1>
First off, you do not need to have the Content-Type or Content-Lenght
headers, try removing them -- but do put a " -type text/xml" on the geturl
call. If that does not work, then it most likely means that it did not like
the value of SOAPAction.
--
+--------------------------------+---------------------------------------+
| Gerald W. Lester |
|"The man who fights for his ideals is the man who is alive." - Cervantes|
+------------------------------------------------------------------------+
Gerald
I followed your advices and you were right !!!
For the record, and hopefully someone will find it useful, here is my
working SOAP http POST:
set Proxy http://x.y.net/a/b/Serial.asmx
set SOAPAction getSerialNumber
set TMOUT 10000
set token [ ::http::geturl $Proxy \
-type "text/xml" \
-headers [ list SOAPAction "http://uri.org/$SOAPAction" ]
\
-query $Form -timeout $TMOUT ]
Once again, a million thanks !!!
KO
.
- References:
- SOAP via HTTP
- From: KevinO
- Re: SOAP via HTTP
- From: Gerald W. Lester
- Re: SOAP via HTTP
- From: KevinO
- Re: SOAP via HTTP
- From: Gerald W. Lester
- SOAP via HTTP
- Prev by Date: Re: aes with critcl
- Next by Date: Re: strange tcl behavior
- Previous by thread: Re: SOAP via HTTP
- Next by thread: timeout for "socket"?
- Index(es):
Relevant Pages
|