Groups > Borland > Delphi web services WSDL > Re: What's wrong with this Delphi-SOAP-Message?




What's wrong with this Delphi-SOAP-Message?

What's wrong with this Delphi-SOAP-Message?
Fri, 4 Jan 2008 16:01:08 +0100
Hello,
I'm consuming a (SAP-) WebService with Delphi 7.
The SOAP-Message sent to Server gives a "Deserialisation
failed-Exception":

<?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 

Post Reply
Re: What's wrong with this Delphi-SOAP-Message?
Tue, 8 Jan 2008 13:57:14 -0800
Hello 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.

Post Reply
Re: What's wrong with this Delphi-SOAP-Message?
Wed, 9 Jan 2008 11:01:14 -0800
Thank you for emailing me the WSDL.

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" <bbabet@borland.com> wrote in message
news:4783f13c$1@newsgroups.borland.com...
> Hello 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.
>
>

Post Reply
Re: What's wrong with this Delphi-SOAP-Message?
Thu, 10 Jan 2008 08:32:53 +010
Hello Bruneau,
now I'm confused..
My unit looks like this (... stripped):

// ************************************************************ //
// 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)
  ['']
    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" <bbabet@borland.com> schrieb im Newsbeitrag
news:4785197e$1@newsgroups.borland.com...
> Thank you for emailing me the WSDL.
>
> 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.


Post Reply
Re: What's wrong with this Delphi-SOAP-Message?
Thu, 10 Jan 2008 12:39:53 -080
Hello,

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.

Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact