Watch, Follow, &
Connect with Us
Public Report
Report From: Delphi-BCB/SOAP/WSDL Importer- BCB    [ Add a report in this area ]  
Report #:  35187   Status: Need Feedback
WSDL import generates WideString for Int Values
Project:  C++Builder Build #:  10.0.2445.40105
Version:    10.0 Submitted By:   Alexander Dong
Report Type:  Basic functionality failure Date Reported:  10/13/2006 2:03:55 AM
Severity:    Serious / Highly visible problem Last Updated: 7/24/2007 3:50:35 PM
Platform:    All versions Internal Tracking #:  
Resolution: Need More Info (Resolution Comments) Resolved in Build: : None
Duplicate of:  None
Voting and Rating
Overall Rating: (1 Total Rating)
2.00 out of 5
Total Votes: None
Description
The attached VendorService.wsdl has some types, like "TaxCode" with type = "s:int". The WSDL-Importer generates the class after import but all fields were from type WideString. Access to one of the value caused crash because of memory error.
Steps to Reproduce:

My Code to access:



NS_VendorService::Vendor *vendor = new NS_VendorService::Vendor();


NS_VendorService::VendorUsedFields *usedFields = new NS_VendorService::VendorUsedFields();


NS_VendorService::SearchParameters *searchParam = new NS_VendorService::SearchParameters();


NS_VendorService::ArrayOfAccount arrayOfAccounts;


NS_VendorService::ArrayOfMessage msgs;


NS_VendorService::_di_VendorServiceSoap vendFunc = NS_VendorService::GetVendorServiceSoap();



usedFields->AccountNo        = "Y";





usedFields->TaxCode          = "Y";


usedFields->TaxNumber

  = "Y";

// Now access:


vendFunc->LoadTab(key, vendor, 0, usedFields, searchParam, arrayOfAccounts, msgs);





for (int i = 0; i < arrayOfAccounts.Length; i++) {



NS_VendorService::PersAccount *account = (NS_VendorService::PersAccount*) arrayOfAccounts[i];




WideString taxcode   = account->TaxCode;    // ERROR! invalid because the address from TaxCode points to an int value, but the return type is WideString.

...
}





Workarounds
None
Attachment
None
Comments

Leo Siefert at 10/13/2006 5:50:37 AM -
I don't see an attached .wsdl file.

Also, Please attach a small project with all of your access code to demonstrate this.

In the code you put into steps, you seem to be trying to assign the TaxCode field to a WideString variable causing an error, yet your comment indicates that the field _is_ returning a WideString instead of an int - if that is so, then why should this line return an error?

Server Response from: ETNACODE01