BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

New problem with MapPoint.NET

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WebServices SOAP
View previous topic :: View next topic  
Author Message
Graham Harris
Guest





PostPosted: Thu Mar 29, 2007 11:13 am    Post subject: New problem with MapPoint.NET Reply with quote



Hi

I have an interesting problem with the above webservice. If I use the wsdl
import from Delphi 2007 and build it in Delphi 2007 I get the following error:
---------------------------
Error
---------------------------
ERemotableException Server was unable to read request. --> There is an error
in XML document (12, 1177). --> The specified type was not recognized: name='ViewByBoundingLocations',
namespace='urn:mappoint', at <MapView xmlns='http://s.mappoint.net/mappoint-30/'>.
---------------------------
OK
---------------------------

Then when I build the application in Delphi 2005 I do not get the error.
Then when I use the Delphi 2005 import in Delphi 2007 I get the error.

The ViewByBoundingLocations in both is defined as:

ViewByBoundingLocations = class(MapView)
private
FLocation: ArrayOfLocation;
published
property Locations: ArrayOfLocation read FLocation write FLocation;
end;

TIA

Graham Harris
Back to top
Jean-Marie Babet
Guest





PostPosted: Thu Mar 29, 2007 10:18 pm    Post subject: Re: New problem with MapPoint.NET Reply with quote



Hello,

This indicates that the runtime does not have a type registered for this
name/namespace. This will happen if 'ViewByBoundingLocations' was added
*manually* but the corresponding registration for it was not added [If you
don't register a type, we assign it a default name/namespace - that's fine
for Servers but not for Client where the WSDL dictates the name/namespace].

How was ViewByBoundingLocations generated? If it was by the WSDL importer,
there's a problem if the importer did not register the type.

Cheers,

Bruneau.
Back to top
Jean-Marie Babet
Guest





PostPosted: Fri Mar 30, 2007 1:20 am    Post subject: Re: New problem with MapPoint.NET Reply with quote



Hello,

It seems that the declaration was added by hand and no registration code was
added. Here's what the current importer generates:


//
************************************************************************ //
// XML : ViewByBoundingLocations, global, <complexType>
// Namespace : http://s.mappoint.net/mappoint-30/
//
************************************************************************ //
ViewByBoundingLocations = class(MapView)
private
FLocations: ArrayOfLocation;
FLocations_Specified: boolean;
procedure SetLocations(Index: Integer; const AArrayOfLocation:
ArrayOfLocation);
function Locations_Specified(Index: Integer): boolean;
public
destructor Destroy; override;
published
property Locations: ArrayOfLocation Index (IS_OPTN) read FLocations
write SetLocations stored Locations_Specified;
end;


And the corresponding registration:


RemClassRegistry.RegisterXSClass(ViewByBoundingLocations,
'http://s.mappoint.net/mappoint-30/', 'ViewByBoundingLocations');


The above line is missing is the mappoint.pas you posted. That should remedy
the problem. It tells the runtime what class can handle this name/namespace
combination.

Cheers,

Bruneau.

PS: Also not the IS_OPTN. It's not the 'Route' property you mentioned in the
other post but that's the flag that determines whether we let it go or send
a nil node if the property is not set. I noticed that was missing in your
definition.
Back to top
Graham Harris
Guest





PostPosted: Fri Mar 30, 2007 6:53 am    Post subject: Re: New problem with MapPoint.NET Reply with quote

Hi Bruneau

As your next post indicates it was added mannually as the WSDL importer does
not seem to pick it up.

Thanks
Graham Harris

Quote:
Hello,

This indicates that the runtime does not have a type registered for
this name/namespace. This will happen if 'ViewByBoundingLocations' was
added *manually* but the corresponding registration for it was not
added [If you don't register a type, we assign it a default
name/namespace - that's fine for Servers but not for Client where the
WSDL dictates the name/namespace].

How was ViewByBoundingLocations generated? If it was by the WSDL
importer, there's a problem if the importer did not register the type.

Cheers,

Bruneau.
Back to top
Graham Harris
Guest





PostPosted: Fri Mar 30, 2007 7:03 am    Post subject: Re: New problem with MapPoint.NET Reply with quote

Hi Bruneau

Is that for Delphi 2007?

And is the class body is as follows (I assume):

procedure ViewByBoundingLocations.SetLocations(Index: Integer;
const AArrayOfLocation: ArrayOfLocation);
begin
FLocations := AArrayOfLocation;
FLocations_Specified := True;
end;

destructor ViewByBoundingLocations.Destroy;
var
i: Integer;
begin
for i := 0 to Length(FLocations) do
FLocations[i].Free;
SetLength(FLocations, 0);

inherited;
end;

function ViewByBoundingLocations.Locations_Specified(Index: Integer): boolean;
begin
Result := FLocations_Specified;
end;


TIA

Grarham Harris
Back to top
Jean-Marie Babet
Guest





PostPosted: Fri Mar 30, 2007 10:57 pm    Post subject: Re: New problem with MapPoint.NET Reply with quote

Hello,

The importer does not emit the type because the importer *sees* that it's
not used by any of the operation exposed by the service. That's a flaw for
polymorphic types as the service may only refer to base types while defining
a host of derived ones. I've fixed the importer to address this issue couple
weeks ago: A type considers itself 'used' even if no one refers to it as
long as there's a reference to its base type.

In the mean time you can use the -Ot+ to tell the importer to emit all types
encountered irrespective of whether they are referred to or not. This will
ensure that you not only have the type but you also have the XML information
needed for the runtime to know how to convert that type to and from XML.

Cheers,

Bruneau.
Back to top
Jean-Marie Babet
Guest





PostPosted: Fri Mar 30, 2007 11:01 pm    Post subject: Re: New problem with MapPoint.NET Reply with quote

Almost - tweak the for loop to go until "Length(FLocations)-1":

Quote:
destructor ViewByBoundingLocations.Destroy;
var
i: Integer;
begin
for i := 0 to Length(FLocations) do

The rest is good.

Cheers,

Bruneau.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi WebServices SOAP All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.