i'm quite new to webservices and have a urgent problem with getting a
document literal SOAP-client working.
The client is developed with D2007/Win32 and has only one method:
function SendMessage(const XMLInput: WideString): WideString; stdcall;
The error i receive is
"document element http://schemas.xmlsoap.org/soap/envelope/:Envelope
expected, http://w3.org/2003/05/soap-envelope:Envelope found" (translated
from german).
With wireshark (sniffer) we were able to trace back the problem to what i
think is an invalid header and envelope.
There are some differences between the reference request and mine that may
or may not be relevant:
header:
- content-type is "text/xml" not application/soap+xml"; i have no extra
"action=..." attribute
- Connection: keep-alive vs close
- Cache-Control: no-cache (only in my header)
message:
- <?xml version="1.0"?> preceding (only my message)
- some more and different xmlns elements within the "SOAP-Env:Envelope" tag
- "XMLInput" is enclosed by <SOAP-ENV:string>
So the big question is: where can i alter the accordant propertys?
I know i can alter the message via the OnBeforeExecute event of the
THTTPRIO but that seems very "dirty" to me.
Furthermore i have no clue where i can alter the header attributes like
content-type...
Can anyone give me some buzzwords like class-names or some hints please?
Thanks in advance - Lukas
The soap requests in detail:
------------------------------
reference:
------------------------------
header:
POST /xyz/service HTTP/1.1
Connection: close
SoapAction: "/xyz/service"
content-type: application/soap+xml; charset="utf-8"; action="/xyz/service"
User-Agent: Jakarta Commons-HttpClient/3.0.1
Host: 139.25.30.90:10903
Content-Length: 157
message:
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope">
<SOAP-ENV:Body>
<XMLInput>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
------------------------------
my request:
------------------------------
header:
POST /xyz/service HTTP/1.1
SOAPAction: "xyz/service"
Content-Type: text/xml; charset="utf-8"
User-Agent: Borland SOAP 1.2
Host: 139.25.30.90:10903
Content-Length: 1532
Connection: Keep-Alive
Cache-Control: no-cache
message:
<?xml version="1.0"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<SOAP-ENV:string>
<XMLInput>
</SOAP-ENV:string>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
Most of what you mentioned is related to SOAP 1.2 vs. SOAP 1.1:
For SOAP 1.2 the content type changed to "application/soap+xml". The XML
namespaces of the envelope and encoding schemas also changed (to allow one
to detect the two). The only odd thing is that typically a Service requiring
1.2 would detect the earlier version and send back a SOAP 1.1 envelope with
a VersionMismatch fault.
I doubt that the 'Connection' of 'Cache-Control' HTTP headers are relevant
here.
If the client you're dealing with has only one message that takes a string
and returns a string, it would be much much simpler to bypass SOAP and have
a custom routine that builds the envelope around the request, posts it and
strips the envelope to extract the response from the returning packet. You
may use the SOAP runtime subcomponents to handle the POST and use the XML
component to handle any necessary encoding of the string.
Also, do you know what the WebService is implemented in? All implementation
that I know of still support SOAP 1.1. It's bound to happen that newer
services will drop 1.1 altogether but it seemed that no one was taking that
route (yet).
Cheers,
Bruneau.
PS: Support for 1.2 is more involved that the items you mentioned. Since you
have a simple method, it possible to tweak the runtime to do the few things
you need but there's more to 1.2 support in areas such as arrays
(arrayType->itemType + arraySize), headers, faults, multiref values, etc.
does RAD Studio 2007 Enterprise support SOAP 1.2?
If not, when will this happen?
TIA,
Joachim Engel.
"Jean-Marie Babet" <bba...@borland.com> schrieb im Newsbeitrag
news:473c9876$1...@newsgroups.borland.com...
Native/Win32 Delphi SOAP from D2007 does not support 1.2. D2007 was a
interface-compatible release and that put some serious limitations on what
could be done in that release. There were some bugs that we wanted to
address that were very difficult to fix with no interface changes (anyone
[me included] who's peeked at that latest version OpToSOAPComConv.pas will
probably cringed as some of the code in there).
Support for 1.2 is on the list for whatever is next. There are other items
on that list (MTOM, WS*, etc)... There's also interest in related areas
(e.g. REST). Ultimately the decision falls on the shoulders of the product
managers (Nick et al). My guess is that it will be in as it's relatively
easier to implement than some of the other items.
Cheers,
Bruneau.
I'm a little bit disappointed. SOAP V1.2 is nothing really new!?
(recommodation from 2003)
Does the current JBuilder support V1.2?
TIA,
Joachim Engel.
"Jean-Marie Babet" <bba...@borland.com> schrieb im Newsbeitrag
news:474b2614$1...@newsgroups.borland.com...
I totally agree with you. Unfortunately Borland/Codegear dropped the ball on
Delphi/SOAP(*) for quite a while: other than fixes for existing support,
it's only recently that we resumed work on some mainstream features
(doc|lit, external schemas, some tricky schema types, etc)... and
unfortunately the work had to be done in a non-interface breaking way.
JBuilder does support 1.2 as the underlying runtime is Axis'.
Cheers,
Bruneau.
PS: (*) For a while the thinking was that all SOAP effort would move to the
.NET side.
Kind regards
Joachim Engel.
"Jean-Marie Babet" <bba...@borland.com> schrieb im Newsbeitrag
news:474f2e02$1...@newsgroups.borland.com...