I add that file to my project. Then I add a “uses Service,Service.DataContracts” at the top of another source file in the same project.
The compiler says unknown namespace for both Service and Service.DataContracts.
Shouldn’t I be able to reference the UserSecurity and ALL the other myriad classes in that generated code without having to prefix every single one of them with the namespace?
Seems like I had this issue come up in the past. I’m not sure if I posted about it, but I couldn’t find one, so maybe I didn’t.
No, my point is that other files CAN’T do “uses Service.DataContracts”. THAT is the problem I’m trying to solve. I had to prefix a bunch of datacontract object classes.
I think the slSvcUtil generated file NEVER has its own namespace, that I’ve seen anyway.
here is what was on the command line:
slSvcUtil http://localhost/EDBWebsite/Service.svc?wsdl /language:Oxygene /directory:"C:\Users\Mark\Documents\Visual Studio 2013\Projects\SW\OPG\EDB\EDBSilverlight\EDBSilverlight"
Here is the start of the service file:
namespace Service;
interface
uses
System,
System.Data,
System.Runtime.Serialization,
System.Collections.Generic,
System.ServiceModel,
System.ServiceModel.Activation,
Service.DataContracts,
EDB.EDBDatabase;
// having it all to do over again, I would make the getoptions and setoptions work on a single object that is
// all defined here and passed to the database for filling in or using for updating
type
[ServiceContract( &Namespace := "http://www.swtechnologies.com/edb" )]
IEDBService = public interface
Now Oracle has managed to screw me up and I can’t even publish any more… But that is another story…
I just added Service to the namespace in the generated file, and the page.xaml.pas compiled ok. Now maybe need to figure out why the generated file doesn’t have that namespace in it.
It is what is generated by default by slSvcUtil which is passed the Oxygene language. Don’t know if they are dropping the ball on that or Oxygene or whether I should have specified something somewhere to make it output the namespace.
Often there are also extra repeated lines generated in the output uses statement.
Things like:
uses
namespace1,
namespace1,
namespace1;
I don’t have an example at the moment, but I’ve seen that. It never caused a compiler problem.