<?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>
<ZmaraTest xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
<MatnrIv>AKN_138802</MatnrIv>
<WerksIv>BP01</WerksIv>
</ZmaraTest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
With soapUI it works with this Message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
<soapenv:Header/>
<soapenv:Body>
<urn:ZmaraTest>
<MatnrIv>AKN_138802</MatnrIv>
<!--Optional:-->
<WerksIv>BP01</WerksIv>
</urn:ZmaraTest>
</soapenv:Body>
</soapenv:Envelope>
For me as human reader (and SOAP-newbe) both are ok, but the first do not
work.
Update to D7.1 and bugfix 24535 did not help.
TIA
Rainer
There is a subtlety between the two: the namespace of the 'MatrnIv' &
WerksIv elements! Could you point me to the WSDL/Schema or email me a
copy/link?
In the Delphi case the default xmlns attribute at the 'ZmaraTest' level
applies to the child elements. SOAPUI's version never declares a default
namespace. The schema should clarify the issue. I suspect I problem on our
side strictly since the SOAPUI works. If that's the case, there's probably
a way to remedy by tweaking the binding generated by the importer.
Cheers,
Bruneau.
As I suspected, the elements are indeed unqualified - which means that the
child elements should be in the null namespace. I ran the importer on the
WSDL to confirm that the importer indeed flagged this to the runtime. Can
you confirm the following for me? In the file generated by the importer,
does your version of ZmaraTest look like this:
//
************************************************************************ //
// XML : ZmaraTest, global, <element>
// Namespace : urn:sap-com:document:sap:soap:functions:mc-style
// Serializtn: [xoLiteralParam]
// Info : Wrapper
//
************************************************************************ //
ZmaraTest = class(TRemotable)
private
FMatnrIv: char18;
FWerksIv: char4;
FWerksIv_Specified: boolean;
procedure SetWerksIv(Index: Integer; const Achar4: char4);
function WerksIv_Specified(Index: Integer): boolean;
public
constructor Create; override;
published
property MatnrIv: char18 Index (IS_UNQL) read FMatnrIv write FMatnrIv;
property WerksIv: char4 Index (IS_OPTN or IS_UNQL) read FWerksIv write
SetWerksIv stored WerksIv_Specified;
end;
The relevant issue here is the index of the two properties. The 'IS_UNQL'
flag tells the runtime that these properties/elements are unqualified. The
runtime should then generate something along the lines of:
<MatnrIv xmlns="">.....</MatnrIv>
The latest runtime (available here -
http://codecentral.borland.com/Item/24535 ) is required to process the
IS_UNQL flag. The latest importer (available at the same location) should
detect and tag unqualified elements.
Cheers,
Bruneau.
"Jean-Marie Babet" <bba...@borland.com> wrote in message
news:4783f13c$1...@newsgroups.borland.com...
// ************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : http://...
// Encoding : utf-8
// Codegen : [wfDebug,wfUseSerializerClassForAttrs]
// Version : 1.0
// (04.01.2008 15:23:32 - 1.33.2.5)
// ************************************************************ //
...
Marc = class; { "urn:sap-com:document:sap:soap:functions:mc-style" }
Mara = class; { "urn:sap-com:document:sap:soap:functions:mc-style" }
...
// ************************************************************ //
// Namespace : urn:sap-com:document:sap:soap:functions:mc-style
// ************************************************************ //
Marc = class(TRemotable)
private
...
published
property Mandt: clnt3 read FMandt write FMandt;
property Matnr: char18 read FMatnr write FMatnr;
...
end;
// ************************************************************ //
// Namespace : urn:sap-com:document:sap:soap:functions:mc-style
// ************************************************************ //
Mara = class(TRemotable)
private
...
published
property Mandt: clnt3 read FMandt write FMandt;
property Matnr: char18 read FMatnr write FMatnr;
...
end;
// ************************************************************ //
// Namespace : urn:sap-com:document:sap:soap:functions:mc-style
// transport : http://schemas.xmlsoap.org/soap/http
// style : document
// binding : ZMARA_TESTSoapBinding
// service : ZMARA_TESTService
// port : ZMARA_TESTSoapBinding
// URL : http://....
// ************************************************************ //
ZMARA_TEST = interface(IInvokable)
['{EFD75353-A1C3-8036-5C82-48B755122108}']
procedure ZmaraTest(const MatnrIv: char18; const WerksIv: char4;
out MaraEs: Mara; out MarcEs: Marc); stdcall;
end;
...
IMO, I'm using the /24535 importer and runtime !??
Thank you for your help (and patience)
Rainer
"Jean-Marie Babet" <bba...@borland.com> schrieb im Newsbeitrag
news:4785197e$1...@newsgroups.borland.com...
Interestingly the importer unwrapped the request/response in your case. So
that's why you don't see the request/response objects. In my case, the
importer opted not to unwrap because of the multiple out. There's even a
warning emitted for that.
Clearly we're not using the same version of the importer. Are you using the
one posted at the following link:
http://codecentral.borland.com/Item/24535
The version info emitted in the file should read:
// (1/10/2008 12:30:53 PM - - $Rev: 10138 $)
Yours currently reads:
> // (04.01.2008 15:23:32 - 1.33.2.5)
When time allows please try the latest runtime/importer. I'll also try to
make some time to exercise the runtime on my end to make sure that indeed it
generates the XML I expect (i.e. one with the child elements in null
namespace).
Cheers,
Bruneau.
Here's the result of some test that I ran. In a simple application I had the
following:
procedure TForm3.Button1Click(Sender: TObject);
var
Service: ZMARA_TEST;
Request: ZmaraTest;
begin
Service := GetZMARA_TEST(False, '', HTTPRIO1);
Request := ZmaraTest.Create;
try
Request.MatnrIv := 'AKN_138802';
Request.WerksIv := 'BP01';
Service.ZmaraTest(Request);
finally
Request.Free;
end;
end;
NOTE: I'm ignoring the response of the call since this is strictly to see
the request XML.
In the HTTPRIO1 component, I handled the Before Execute event to peek at the
XML. It's as follows:
<?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>
<ZmaraTest xmlns="urn:sap-com:document:sap:soap:functions:mc-style">
<MatnrIv xmlns="">AKN_138802</MatnrIv>
<WerksIv xmlns="">BP01</WerksIv>
</ZmaraTest>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
This is what I would expect: IOW, the child elements in the null namespace.
Please let me know if you don't see the same behaviour or if this XML is not
handled correctly. It's now equivalent to the SOAPUI one.
Cheers,
Bruneau.
Unfortunately this was only a first test. Next week I'll start with the
"real tasks".
Thank you very much for your support!
Rainer.
P.S.
what is the right invocation for the importer to get the wsdl from the
server with authentication?
WSDLImp -P
"http://server..stripped.../sap/ZMARA_TEST?sap-client=204&wsdl=1.1" -user:its_me
-pass:abcde gives the message
*Error*: Unable to load WSDL File/Location:
http://server..stripped.../sap/ZMARA_TEST?sap-client=204&wsdl=1.1. Error
[Required whi
te space was missing.
Line: 1
<!DOCTYPE html PUBLIC"-//W3C//DTD HTML ]
"Jean-Marie Babet" <bba...@borland.com> schrieb im Newsbeitrag
news:4786957a$1...@newsgroups.borland.com...
Yes, this is a common misunderstanding that I'd like to remedy at some
point. The IDE's importer is in a design-time package that I cannot (am not
allowed) to touch as easily as the command line importer. Ultimately I might
make the IDE invoke the command line importer. We've done this with other
things in the past (like I think the C++ IDE now invokes TLIB.EXE instead of
using the IDE's packaged librarian).
The next time I update the runtime/importer on Code Central, I'll point out
the IDE importer vs. command line importer issue in the README or something
like that.
Cheers,
Bruneau.