Sometimes, the Delphi WSDL importer imports fine, but the generated code does not accept test cases sent by other tools.
Below are some links for messages and comment fragments that I want to investigate further.
I have included the .NET message, because my experience is that searching on those gives more accurate results for something that could be broken in more than one environment.
Based on those:
Some on-line tools prefer the WSDL to be in one document, but a lot of WSDL documents use import and or include features, so here are some links on that too:
Bruneau Babet correctly informed me that – though Delphi SOAP clients support both document literal and RPC encoded – Delphi SOAP servers cannot support document literal, as they can only support RPC encoded. Through that I found
- [WayBack] web services – Delphi SOAP Server – Document/Literal – Possible? – Stack Overflow.
- [WayBack] Delphi 2007: Using Web Services which has not changed since then: [WayBack] 10.2 Tokyo: Using Web Services – RAD Studio
- [WayBack] Release Notes for Delphi 2009 and C++Builder 2009 mention as part of the SOAP Server Notes:
The Win32/native SOAP server is currently on the Deprecated list and is classified as “Other Consideration: Need alternative.” If you want a document/literal server, you should build your SOAP server using Delphi for .NET (RAD Studio), which supports the SOAP specifications that are supported by the .NET framework.
- [WayBack] Release Notes for Embarcadero Delphi 2010 and C++Builder 2010 rephrase the SOAP Server Notes in terms of Delphi Prism instead of Delphi for .NET:
The Win32 SOAP server support generates the older RPC|Encoded style WebServices. If you want a document/literal service or a service of any other WS-I compliant style, you should build your SOAP server using Delphi Prism, which supports the SOAP specifications that are supported by the .NET framework, including WS-I compliant styles.
- This continued until [WayBack] Release Notes for XE3 – RAD Studio XE3, as after that [WayBack] No more Delphi for .NET: Prism removed from RAD Studio XE4 | Tim Anderson’s IT Writing. Here the SOAP Server Notes magically have disappeared from the [Archive.is] Release Notes for XE4 – RAD Studio.
- [WayBack] RPC Encoded and RPC Literal Delphi SOAP Server? – embarcadero.delphi.webservices
- [RSP-16581] WS-I Basic Profile 1.1 Compliance – Embarcadero Technologies
Unable to create a SOAP Server Application (WebService) with [WayBack] WS-I Basic Profile 1.1 compliance.
As far as I know, with delphi we can developed RPC/Encoded web services but there is no way to create Document/Literal service.
There are some companies that continue to use SOAP for information transfer, SAP one of them and we had to use C # to develop the application server.
With C# only [WayBack] [SoapDocumentMethod] or [WayBack] [SoapRpcMethod] is assigned to the Web Method.
WS-I_Basic_Profile
- I remember from the Delphi 7-2010 days that issues were raised in the private forums to press for document literal support as that is where the Java and .NET world were headed too
- A few notes on Delphi, WSDL and SOAP: passing nil values, Document/Literal versus RPC Encoded (yup: 5 years ago, I bumped into a few posts writing about this)
- Validating WSDL
- [WayBack] Apache CXF — WSDLValidator
- Check the WSDL document for XML well-formedness.
- Validate the WSDL document against its XML schema.
- Validate the WSDL document using some of the semantic rules defined in the WSDL specification.
- Validate the WSDL document against custom validation rules, such as those defined by the Web Services Interoperability (WS-I) organization (i.e. WS-I Basic Profile rules).
- Validate the WSDL against strange exceptions, incorrectly generated code and general bad WSDL issues.
Back on those days, the big plan was to move everything Delphi to the .NET platform which supports both document literal and RPC encoded.
All in all, document literal has been on the radar with the Delphi R&D team since at least 2009, and nothing has been done.
References:
- [WayBack] SOAP Binding: Difference between Document and RPC Style Web Services
- Web Services Description Language – Wikipedia (note that despite WSDL 2.0 – which was originally named WSDL 1.2 – being out for 10+ years, most tools still only support WSDL 1.1, and some not even fully).
- [WayBack] Which style of WSDL should I use?,
[WayBack] IBM Knowledge Center – Literal vs. Encoded, RPC- vs. Document-Style[WayBack]
web services – What is the difference between Document style and RPC style communication? – Stack Overflow
[WayBack] Mike’s Software Development Blog: WSDL SOAP bindings confusion – RPC vs documentall with explanations (and some examples) of:
- RPC/encoded
- RPC/literal
- Document/encoded
- Document/literal
- XSD
- WSDL 1.1
- WSDL 2.0:
- SOAP 1.1: [WayBack] Simple Object Access Protocol (SOAP) 1.1
- SOAP 1.2:
- [WayBack] Java Solution Architect: WSDL 2.0 VS WSDL 1.1
WS-I Basic Profile v1.1 provides guidance for using SOAP 1.1, WSDL 1.1, and UDDI 2.0.
WS-I Basic Profile v2.0 provides guidance for using SOAP 1.2, WSDL 1.1, UDDI 2.0, WS-Addressing, and MTOM.
- WS-I:
- SOAP HTTP: a SOAP Fault should always translate into a HTTP status code 500 (Internal Server error). This even holds when a different status could be more appropriate (so no “403” for Forbidden, but a SOAP Fault indicating forbidden with a status code 500:
- Imports in various environments:
I looks like a wsdl message request part entries need to be named parameters for some tooling to correctly infer document/literal in a wrapped way. Some links for further research on this:
When you are surely running SOAP over HTTP, you can use this small class to raise exceptions which automatically get translated into SOAP Faults having the right return code using a trick I bumped into a few years ago from [WayBack] web services – Accessing the original TWebRequest object in a Delphi SOAP Server – Stack Overflow:
unit SoapFaultWithHttpCodeExceptionUnit;
interface
uses
System.SysUtils;
type
ESoapFaultWithHttpCodeException = class(Exception)
strict private
FHttpStatusCode: Integer;
public
constructor Create(const AHttpStatusCode: Integer);
property HttpStatusCode: Integer read FHttpStatusCode;
end;
implementation
uses
Winapi.WinHTTP,
Soap.WebBrokerSOAP,
Web.HTTPApp,
IdCustomHTTPServer;
constructor ESoapFaultWithHttpCodeException.Create(const AHttpStatusCode: Integer);
var
IdHTTPResponseInfo: TIdHTTPResponseInfo;
ReasonString: string;
WebDispatcher: IWebDispatcherAccess;
begin
IdHTTPResponseInfo := TIdHTTPResponseInfo.Create(nil, nil, nil);
try
FHttpStatusCode := AHttpStatusCode;
IdHTTPResponseInfo.ResponseNo := AHttpStatusCode;
ReasonString := Format('%d: %s', [AHttpStatusCode, IdHTTPResponseInfo.ResponseText]);
inherited Create(ReasonString);
// https://stackoverflow.com/questions/10405227/accessing-the-original-twebrequest-object-in-a-delphi-soap-server
if Supports(GetSOAPWebModule, IWebDispatcherAccess, WebDispatcher) then
begin
WebDispatcher.Response.StatusCode := HTTP_STATUS_SERVER_ERROR;
WebDispatcher.Response.ReasonString := ReasonString;
end
finally
IdHTTPResponseInfo.Free;
end;
end;
end.
—jeroen
Read the rest of this entry »