Problem upgrading web service client from Delphi 7 to Delphi XE

In trying to upgrade our web service client to Delphi XE we have now get a web service error of Invalid Format.

When we examine the SOAP request we see the following differences from Delphi 7 vs Delphi XE

In Delphi 7 we get

<SomeStuff xmlns="" xsi:nil="true" />

In Delphi XE we get

<SomeStuff xsi:nil="true" />

We have narrowed the failure down to these differences in the client request.  Is there anyway to get Delphi XE to generate a SOAP request with the  xmlns attribute set to blank as it used to be?
0
Kelly
10/21/2010 4:33:36 PM
embarcadero.delphi.webservices 976 articles. 0 followers. Follow

5 Replies
2176 Views

Similar Articles

[PageSpeed] 9

Hello,


> In trying to upgrade our web service client to Delphi XE we have now get a 
> web service error of Invalid Format.
>
> When we examine the SOAP request we see the following differences from 
> Delphi 7 vs Delphi XE
>
> In Delphi 7 we get
>
> <SomeStuff xmlns="" xsi:nil="true" />
>
> In Delphi XE we get
>
> <SomeStuff xsi:nil="true" />
>
> We have narrowed the failure down to these differences in the client 
> request.  Is there anyway to get Delphi XE to generate a SOAP request with 
> the  xmlns attribute set to blank as it used to be?


In general XE offers more flexibility on how to encoding the XML.  For a 
non-nil node one can tag an element/parameter as unqualified to have the 
xmlns=""' attribute using the IS_UNQL flag. I would need to know more about 
'SomeStuff'. Is it a parameter to a function or a property of a class. And 
does the service use literal encoding? Without this information I can't 
really say how to make the runtime do what you're after [other then tweak 
the generated XML in the OnBeforeExecute event but I recommend this approach 
as a last resort]; The runtime should understand what the service expects 
and generate the correct request. So, if you could point me to a WSDL/Schema 
or even post the binding generated by the importer, that would help.

Cheers,

Bruneau
0
Jean
10/22/2010 2:51:22 AM
> {quote:title=Jean-Marie Babet wrote:}{quote}
> Hello,
> 
> 
> > In trying to upgrade our web service client to Delphi XE we have now get a 
> > web service error of Invalid Format.
> >
> > When we examine the SOAP request we see the following differences from 
> > Delphi 7 vs Delphi XE
> >
> > In Delphi 7 we get
> >
> > <SomeStuff xmlns="" xsi:nil="true" />
> >
> > In Delphi XE we get
> >
> > <SomeStuff xsi:nil="true" />
> >
> > We have narrowed the failure down to these differences in the client 
> > request.  Is there anyway to get Delphi XE to generate a SOAP request with 
> > the  xmlns attribute set to blank as it used to be?
> 
> 
> In general XE offers more flexibility on how to encoding the XML.  For a 
> non-nil node one can tag an element/parameter as unqualified to have the 
> xmlns=""' attribute using the IS_UNQL flag. I would need to know more about 
> 'SomeStuff'. Is it a parameter to a function or a property of a class. And 
> does the service use literal encoding? Without this information I can't 
> really say how to make the runtime do what you're after [other then tweak 
> the generated XML in the OnBeforeExecute event but I recommend this approach 
> as a last resort]; The runtime should understand what the service expects 
> and generate the correct request. So, if you could point me to a WSDL/Schema 
> or even post the binding generated by the importer, that would help.
> 
> Cheers,
> 
> Bruneau
0
Kelly
10/26/2010 8:44:51 PM
> {quote:title=Kelly Sonderegger wrote:}{quote}
> > {quote:title=Jean-Marie Babet wrote:}{quote}
> > Hello,
> > 
> > 
> > > In trying to upgrade our web service client to Delphi XE we have now get a 
> > > web service error of Invalid Format.
> > >
> > > When we examine the SOAP request we see the following differences from 
> > > Delphi 7 vs Delphi XE
> > >
> > > In Delphi 7 we get
> > >
> > > <SomeStuff xmlns="" xsi:nil="true" />
> > >
> > > In Delphi XE we get
> > >
> > > <SomeStuff xsi:nil="true" />
> > >
> > > We have narrowed the failure down to these differences in the client 
> > > request.  Is there anyway to get Delphi XE to generate a SOAP request with 
> > > the  xmlns attribute set to blank as it used to be?
> > 
> > 
> > In general XE offers more flexibility on how to encoding the XML.  For a 
> > non-nil node one can tag an element/parameter as unqualified to have the 
> > xmlns=""' attribute using the IS_UNQL flag. I would need to know more about 
> > 'SomeStuff'. Is it a parameter to a function or a property of a class. And 
> > does the service use literal encoding? Without this information I can't 
> > really say how to make the runtime do what you're after [other then tweak 
> > the generated XML in the OnBeforeExecute event but I recommend this approach 
> > as a last resort]; The runtime should understand what the service expects 
> > and generate the correct request. So, if you could point me to a WSDL/Schema 
> > or even post the binding generated by the importer, that would help.
> > 
> > Cheers,
> > 
> > Bruneau

Hi Bruneau,

Sorry to be so late in responding.  I had to reproduce the problem on my own machine.

So currently the following type of request fails
 
<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>
   <CheckInsertCustomer xmln="http://mycompany.com/User>
       <c>
            <CustomerSetupFee xsi:nil="true" />
       </c>
    </CheckInsertCustomer>
<SOAP-ENV:Body>
</SOAP-ENV:Envelope>

However this type of request succeeds 
<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>
   <CheckInsertCustomer xmln="http://mycompany.com/User>
       <c>
            <CustomerSetupFee xmlns="" xsi:nil="true" />
       </c>
    </CheckInsertCustomer>
<SOAP-ENV:Body>
</SOAP-ENV:Envelope>

The only difference being that xmln="" is set as an attribute on CustomerSetupFee

If the IS_UNQL flag is what I use then how would I use it?  Is there a way to set it up when generating the SOAP code?

Thanks Bruneau,
Kelly
0
Kelly
10/26/2010 9:03:00 PM
Hello,


> Sorry to be so late in responding.  I had to reproduce the problem on my 
> own machine.

No need to apologize: I've been away from the forum working in another area.


> So currently the following type of request fails
>
> <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>
>   <CheckInsertCustomer xmln="http://mycompany.com/User>
>       <c>
>            <CustomerSetupFee xsi:nil="true" />
>       </c>
>    </CheckInsertCustomer>
> <SOAP-ENV:Body>
> </SOAP-ENV:Envelope>
>
> However this type of request succeeds
> <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>
>   <CheckInsertCustomer xmln="http://mycompany.com/User>
>       <c>
>            <CustomerSetupFee xmlns="" xsi:nil="true" />
>       </c>
>    </CheckInsertCustomer>
> <SOAP-ENV:Body>
> </SOAP-ENV:Envelope>

OK, so the service expects the element to be unqualified. I'd like to see 
the binding that Delphi generated for the call to CheckInsertCustomer. Is it 
something like this:

{Code}

type
  TCustomerSetupFee = class(TRemotable)
  end;

  CheckInsertCustomerParam = class(TRemotable)
  private
    FCustomerSetupFee: TCustomerSetupFee;
    FCustomerSetupFee_specified: Boolean;
    procedure SetCustomerSetupFee(Index: Integer; A: TCustomerSetupFee);
  published
    property CustomerSetupFee: TCustomerSetupFee
                               Index (IS_NLBL or IS_UNQL)
                               read FCustomerSetupFee
                               write SetCustomerSetupFee
                               stored FCustomerSetupFee_specified;
  end;

  IService = interface(IInvokable)
  ['{91CD7287-EA4F-4FA9-9C1C-6C8A78AE84E5}']
    function CheckInsertCustomer(c: CheckInsertCustomerParam): string; 
stdcall;
  end;
{code}

The key above is the IS_NLBL and IS_UNQL flag. If these two are set, the XML 
generated by Delphi SOAP will be:


{code}
<?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>
    <CheckInsertCustomer xmlns="urn:test_namespace">
      <c>
        <CustomerSetupFee xmlns="" xsi:nil="true"/>
      </c>
    </CheckInsertCustomer>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
{code}



>
> The only difference being that xmln="" is set as an attribute on 
> CustomerSetupFee
>
> If the IS_UNQL flag is what I use then how would I use it?  Is there a way 
> to set it up when generating the SOAP code?


See the above sample. However, this may not apply to you if that's not the 
code the importer generated for you. I you cannot post the code Delphi 
generated for you, please, do email me the binding at bbabet at embarcadero 
dot com.

Cheers,

Bruneau
0
Jean
11/8/2010 1:21:21 AM
Hello,

Thanks for the WSDL. I'll need to double-check this later but the WSDL you 
sent contains two schemas and they both say that the elements default to 
qualified. As in:

{code}
<s:schema elementFormDefault="qualified"
   .....
{code}


So, this means that all elements are qualified by default and that an 
unqualified element must explicitly override the default with a 
'form="unqualified"' attribute. However, I find no such attributes in the 
schema itself. So I don't really understand why the Service expects 
unqualified nil elements.

I can update the wsdl/schema to specify unqualified elements (by adding the 
`nillable="true"` attribute to the element) and Delphi SOAP will then 
generate unqualified elements; but the problem is that it will generate 
unqualified elements all the time: not just for nil elements.

Is that going to be OK with the Service when the element's value is not nil? 
I'll send you a copy of the binding generated with a .WSDL updated to 
specify unqualified elements. And maybe that will work with the Service.

I will re-read the spec on nil elements 
(http://www.w3.org/TR/xmlschema-0/#Nils) to make sure I'm not missing 
anything.

Cheers,

Bruneau
0
Jean
11/8/2010 10:40:00 PM
Reply:

Similar Artilces:

Problem with Delphi 6 to Delphi 7 upgrade
I have just purchased Delphi XE because I have an immediate need of D7 which came for free with XE. I downloaded and installed D7 and I think I applied the Update 1 that I had also downloaded. After much messing around with old components, I have finally attempted to compile my D6 project with D7. I get the following error:- [Fatal Error] apm.dpr(225): Unit ExtDlgs was compiled with a different version of ExtCtrls.TPanel I have checked the library paths all point to D7 versions of everything and now am at a loss to know what to do next. Also checked the sequence to make sure that al...

Delphi 7 to Delphi XE
Have been using Delphi 7 for many moons ( have got later versions but never upgraded to ) My first problem is: Component Palette. in XE it is a small toolbar docked in top right in Delphi 7 it gives a large view of all the components. I am struggling to be able to cope/access my components.in Delphi XE. Can I make the component pallette tool bar the same size as Delphi 7, or is there a fast way to view/choose all available components in XE, that I have not spotted yet? Kind Regards, Robert. Hi, What I know is that in Delphi 2010 and XE you can choose between t...

Upgrade from Delphi 5 and Delphi XE: Variant and SysUtils unit problems.
Hi. I am a newbie to Delhi XE. I have just taken on the task of converting my stuff from Delphi 5 [sic] to Delphi XE. The first errors I got was "Variants unit out of data or corrupted" and "symbol deprecated" in SysUtils I hope I can fix the problem by simply pointing to the "up-to-date" units. I am also wondering wether I will not have to switch to Unicode, since the errors seem to be string related (not that I know what changing to Unicode entails). Any help? Marcus > {quote:title=Marcus de Bruin wrote:}{quote} > Hi. > > I...

Migrating to Delphi XE from Delphi 7.0
Below is my code in Delphi 7.0, this is how to call another units in webmodule... Hello All, I create a web application in Delphi 7.0, using the Web Server Application, CGI, IntraWeb 7.0.15. And I used TIWPageProducer to view like this url "http://localhost/mcr/mcr.exe/main". I built and run. I viewed in thru IIS and it is running... This is my code in Delphi 7.0 .... .... procedure TWebModule1.proMainGetForm(ASender: TIWPageProducer; AWebApplication: TIWApplication; var VForm: TIWPageForm); begin VForm := TfrmMain.Create(AWebApplication); end;...

Migrating to Delphi XE from Delphi 7.0
Below is my code in Delphi 7.0, this is how to call another units in webmodule... Hello All, I create a web application in Delphi 7.0, using the Web Server Application, CGI, IntraWeb 7.0.15. And I used TIWPageProducer to view like this url "http://localhost/mcr/mcr.exe/main". I built and run. I viewed in thru IIS and it is running... This is my code in Delphi 7.0 .... .... procedure TWebModule1.proMainGetForm(ASender: TIWPageProducer; AWebApplication: TIWApplication; var VForm: TIWPageForm); begin VForm := TfrmMain.Create(AWebApplication); end; procedure TWebModule1....

Delphi 7 to Delphi XE: TBlobField to XML [Edit]
Hi, I'm migrating a Delphi7 application to Delphi XE. I'm using a TClientDataSet to communicate, by using a XML frame, with my server. In this TClientDataSet I'm using a TBlobField which is an array of 384 byte. The blobField is allocate by a code like this : {code} myStream : TStream; myStream := aClientDataSet.CreateBlobStream(myBlobField, bmwrite); vResult := myStream.Write(ArrayOf384Byte[0], length(ArrayOf384Byte)); //vResult = 384 => GooD ! (...) {code} For communicate with the server, we have to decode the Blobfield in XML before to sending it. We have...

Is possible to install delphi 7 and delphi 2009 upgrade?
I have delphi 7 interprise installed on my PC. Our company bought a delphi 2009 professional (upgrade). All of our projects now are made in delphi 7. We don't have time to move those projects to delphi 2009. Now, we are planning to create a new project using delphi 2009. Is it possible to install delphi 2009 in different windows profile without affecting delphi 7 projects? Edwin Aceron wrote: > I have delphi 7 interprise installed on my PC. Our company bought a > delphi 2009 professional (upgrade). All of our projects now are made > in delphi 7. We don't have time to move...

Delphi 7.0 code convert to delphi XE ...
Hello All, I create an application using Web Server Application then CGI stand alone... In WebModule I add ModuleController component and IWPageProcedure... Below is my code in Delphi 7.0, this is how to call another units in webmodule... .... .... procedure TWebModule1.proMainGetForm(ASender: TIWPageProducer; AWebApplication: TIWApplication; var VForm: TIWPageForm); begin VForm := TfrmMain.Create(AWebApplication); end; procedure TWebModule1.proLogInGetForm(ASender: TIWPageProducer; AWebApplication: TIWApplication; var VForm: TIWPageForm); begin VForm := TfrmLogIn.Create(AWebA...

Delphi XE / Delphi 2010
Hello! I noticed that Embarcadero® Delphi® 2010 Version is not on the list of products on Embarcadero page. Or is it still possible to buy it? Will RAD Studio XE compile programs written in Delphi 2010 without problems.? Thanks. Am 13.09.2010 09:04, schrieb Petra Nemec: > Will RAD Studio XE compile programs written in Delphi 2010 without problems.? As always you will probably have to recreate the projects as the import is still a bit -- special. Christian Hello! Does anybody know if it is still possible to get a Delphi2010 trial version (if yes where)? ...

Delphi 2007 to Delphi 7
I've written a class in Delphi 2007 that is not supported in Delphi 7. What would be the best way to achive what I've done in Delphi 2007 in Delphi 7? Thanks, Tom type BondConstants = class { Bond Types } type BondType = record const TREASURY = 3; AGENCY = 0; CORP = 1; MUNI = 2; SBA = 5; MBS = 4; CMO = 6; end; { Day Count Methods } type DayCount = record const ACTUAL_360 = 2; ACTUAL_365 = 1; ACTUAL_ACTUAL = 1; d30_360 = 0; ...

Delphi 7 to Delphi XE2
Hi, Still using that old workhorse, Delphi7, but am going to the conference in London hosted by Embarcadero on Delphi XE2. Although I would like to "move with the times" and am keen to get the UNICODE and 64-bit support offered by the latest IDEs, I confess to being more than a little scared about all the UNICODE/String/AnsiString and 32/64 bit issues I'm probably going to fall over. Anyone recently upgraded from Delphi7 to one of the latest Delphi IDEs? Thanks, Alain On 03/02/2012 08:55, Alain Dekker wrote: > Still using that old workhorse, Delphi7, but...

Problem using Java web service from Delphi 7
Hello all, I am a Delphi developer trying to build a client for a java written web service. In Delphi (I am using Delphi 7 enterprise) I use the wizard which imports the wsdl and builds Delphi interfaces (and types, classes) related to the service imported. Everything works a part a (very important!) detail: if an axis method returns a string array the wizard "sees" a simple string only. I've tried to tweak with several options of the wizard, or even manually modify the generated interface but with no success. Other messages found with google seems to confirm that there...

Delphi 2006 to Delphi XE Crystal BPL problem [Edit]
I am in the process of migrating our application from Delphi 2006 to Delphi XE and, for ease of use, I have both 2006 and XE installed on my development computer. I access Crystal Reports XI RDC in our application and so I rebuilt the BPL in XE in order to add the new package to XE. However, when I try to add the package to XE I get the error message: “Registration procedure, Craxddrt_tbl.Register in the package c:\Documents and Settings\All Uers\Documents\RADS Studio\8.0\BPL\Crystal.bpl raised exception class EFilerError: Component TDatabase can’t be registered by package crystal.bpl be...

How to access Delphi 7 & 2009 after purchasing Delphi XE
I have purchased and installed Delphi XE and now I'm unable to find information on how to download previous versions of Delphi, namely Delphi 7 and 2009. Please respond. Regards, SB, L&T Hi sushweta biswas, > I have purchased and installed Delphi XE and now I'm unable to find information on how to download previous versions of Delphi, namely Delphi 7 and 2009. Your reseller should have told you: after registering Delphi XE, you can go to http://www.embarcadero.com/xe-earlier-versions to enter your serial number of Delphi XE as well as your EDN account informati...

Web resources about - Problem upgrading web service client from Delphi 7 to Delphi XE - embarcadero.delphi.webservices

Facebook Starts Upgrading Profiles To Timeline
A couple of readers told us that timeline previews have kicked in on their profiles without their having initiated the change themselves. A welcome ...

Facebook Upgrading “Insights” Metrics Dashboard for Page Managers Tonight
Facebook has just begun pushing an upgrade to its “Insights” metrics dashboard for Facebook Pages that gives administrators more visibility into ...

Flickr: Help: Free Accounts, Upgrading and Gifts
Flickr is almost certainly the best online photo management and sharing application in the world. Show off your favorite photos and videos to ...

Upgrading From Windows 1.0 to Windows 8 On Actual Hardware - YouTube
If you're watching this video, you've probably seen the other videos that prove it is possible to upgrade from Windows 1.0 all the way to Windows ...

Coalition's NBN will need ongoing, costly upgrading, experts warn
The Coalition's planned broadband infrastructure will "freeze" broadband speeds, and need ongoing and expensive upgrading to resemble the system ...

Beware of unintended and costly consequences when upgrading houses
Meeting the Building Code measures on energy efficiency is a potentially tricky business, even if you are upgrading or extending only one part ...

Nuclear states still upgrading stocks
Nuclear armed states continue to upgrade their stockpiles despite s trend towards global disarmament.

Apple users face issues upgrading to iOS 9
Apple customers were facing issues while upgrading to iOS 9, which was released this morning in Australia, technology blog 9to5Mac reported. ...

Promise check: $16m towards upgrading Hobart's Cadbury factory
Keep track of the Coalition's promise to spend $16 million on upgrading Hobart's Cadbury chocolate factory.

Upgrading IOIO to Bluetooth - YouTube
An instructional video showing how to upgrade IOIO's firmware in order to make it Bluetooth capable. Downloads are at: https://github.com/yt ...

Resources last updated: 12/9/2015 10:05:14 AM