1.0.2004.2 goes beta

Posts   
 
    
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 09-Mar-2005 20:40:43   

Whoa, after 4 months of hard work, it's finally in 'beta' phase simple_smile LLBLGen Pro 1.0.2004.2. Please visit the forum: http://www.llblgen.com/tinyforum/Threads.aspx?ForumID=22&SectionID=2 for more details, and grab the goods from the upgrades section in the customer area.

The enclosed readme is very important, read it before proceeding. Not everything new has been mentioned in the readme, though in teh coming 2 weeks I hope to finalize the documentation which will shed more light on the new stuff added.

Enjoy! simple_smile

Frans Bouma | Lead developer LLBLGen Pro
jeffreygg
User
Posts: 805
Joined: 26-Oct-2003
# Posted on: 09-Mar-2005 21:40:27   

Woowoo! Grats, Frans. Can't wait to take a look!

Jeff...

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 09-Mar-2005 23:55:42   

I noticed you

  • ADDED: Entity classes and entity collections now implement IXmlSerializable

Does this mean that we can use the entities over webservices now? From what i found on google yes, but MS seems to have no docs on it.

Based on an earlier question, and your answer, i am guessing it still wont implement them correctly. Could you then please tell me by implmenting it, what is gained?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 10-Mar-2005 09:30:38   

Answer wrote:

I noticed you

  • ADDED: Entity classes and entity collections now implement IXmlSerializable

Does this mean that we can use the entities over webservices now? From what i found on google yes, but MS seems to have no docs on it.

In theory, yes. I have to setup a testsystem for this. But it was 20 lines of code, so I thought, what the heck simple_smile . I can imagine VS.NET will go bezerk in client mode, i.e.: consuming a webservice which returns generated code entities. This is because VS.NET generates stubs for every class returned by the webservice, even though the type is already known by the client (for example you reference the same generated code assembly).

Based on an earlier question, and your answer, i am guessing it still wont implement them correctly. Could you then please tell me by implmenting it, what is gained?

Well, objects are now serializable by the XmlSerializer, and a webservice which produces xml for java clients or other webservices can now be implemented, and if you generate the stub classes by hand (i.e.: you control the stubclasses, so you don't generate them wink ) on the client side, it should be possible to get a 2-way system. But I have to test this in detail with a setup. What I know is that vs.net's code to consume a webservice is pretty bad, it always does it the 'easy does it' route while limiting you at the same time, as contract first webservice consuming is then out of the question for example.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 10-Mar-2005 16:31:39   

Ok, ran into a nice XmlDocument XPath bug in .NET (selectsinglenode when there is a tempuri.org namespace: you have to fake the prefix!)

But, after fixing that (or better: adding a workaround) I could do the following:

  • create a webservice:

[WebMethod]
public CustomerEntity GetCustomer(string customerID)
{
    CustomerEntity toReturn = new CustomerEntity(customerID);
    using(DataAccessAdapter adapter = new DataAccessAdapter())
    {
        adapter.FetchEntity(toReturn);

        return toReturn;
    }
}

then, create a silly client with a grid and a textbox + a button:


private void _getCustomerButton_Click(object sender, System.EventArgs e)
{
    try
    {
        Zeus.CustomerService service = new ServiceTester.Zeus.CustomerService();
        CustomerEntity c = (CustomerEntity)service.GetCustomer(_customerIDTextBox.Text);

        EntityCollection col = new EntityCollection();
        col.Add(c);

        _mainGrid.DataSource = col;
    }
    catch(Exception ex)
    {
        ExceptionViewer viewer = new ExceptionViewer(ex);
        viewer.ShowDialog(this);
    }
}

and... it works! smile

... though, there is one caveat: because the XmlSerializer in .NET 1.x is stupid, it thinks every class implementing IXmlSerializable is a DataSet. So when you add a webreference to the webservice, you'll get a class generated for you (the so called stub class) which contains your method as a method which returns a DataSet. Simply add a reference to the namespace of your generated code to the class, and alter the methods so they return the entity type they should return instead.

Though this IS cumbersome as VS.NET is so silly to re-generate this class whenever it can nail you. disappointed

However it is as close to webservice support as I can get. I now have to test the return of a changed entity to get it saved by the webservice. simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 10-Mar-2005 16:40:13   

So the wsdle.exe or whatever it is that generates teh client code will cuase the probems disappointed

Bah...always something simple_smile

Well, in 2.0 IXmlSerializable is a published interface from my understanding so it should better understand how to deal with stuff now.

But we should be able to now directly return entities in a webmethod?

EDIT: Nevermind, you answered my questions before i could ask them. Now thats service!!! smile

Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 15-Mar-2005 18:59:54   

Frans:

Did you ever test out the webservice doing a save?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 15-Mar-2005 21:47:25   

Answer wrote:

Frans:

Did you ever test out the webservice doing a save?

I did, it works simple_smile (grabbing an entity, binding it to a grid, editing a field, sending it back to the service, save it.

I'll see if I can put up the .zip tomorrow.

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 16-Mar-2005 01:08:59   

COOL! smile

Once beta 2 comes out, i will start to test it out, see if it handles IXmlSerializable any better.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 16-Mar-2005 10:05:53   

Answer wrote:

COOL! smile

Once beta 2 comes out, i will start to test it out, see if it handles IXmlSerializable any better.

simple_smile

I saw in a video on channel 9 yesterday that the webservice designer of vs.net 2005 uses XmlNode as return type.

Anyway, I did test it on .NET 1.1, with changing the proxy class' types, it worked ok simple_smile

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 25-Mar-2005 06:00:17   

I read that in Beta 2 it doesnt think that everything that implements IXmlSerializable is a dataset. Which is our main problem! wink

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 25-Mar-2005 09:52:58   

Answer wrote:

I read that in Beta 2 it doesnt think that everything that implements IXmlSerializable is a dataset. Which is our main problem! wink

Yeah in .NET 2.0 they've 'fixed' this indeed simple_smile

I've been busy with the docs so I couldn't complete the petshop port this week.

Frans Bouma | Lead developer LLBLGen Pro
Answer
User
Posts: 363
Joined: 28-Jun-2004
# Posted on: 01-Apr-2005 18:08:47   

Frans,

I am awaiting beta 2 before installing, but have u tried using the webservices with beta 1?

Is there anything special u had to do? Or do the llblgen entitie jsut work, like datasets/simple custom objects do in 1.1?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 01-Apr-2005 18:52:48   

Answer wrote:

Frans,

I am awaiting beta 2 before installing, but have u tried using the webservices with beta 1?

Is there anything special u had to do? Or do the llblgen entitie jsut work, like datasets/simple custom objects do in 1.1?

I haven't tested the webservice code with .net beta x.y, just with 1.x. It should work though, however with MS and 'should work' you'll never know what you'll eventually get wink

I'm getting real progress now with the petshop stuff, finally.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 18-Apr-2005 17:13:22   

The petshop example port is available! simple_smile (C#, Adapter, SqlServer2000)

Frans Bouma | Lead developer LLBLGen Pro
Posts: 40
Joined: 26-Nov-2004
# Posted on: 18-Apr-2005 18:01:19   

May not be the right place to put this but here we go...

I got an error when compiling

E:\SourceCode\Projects\Petshop\DAL\DatabaseGeneric\FactoryClasses\EntityFieldFactory.cs(261): No overload for method 'EntityField2' takes '11' arguments

here is an example.

fieldToReturn = new EntityField2("SupplierId", "SupplierEntity", typeof(System.Int32), TypeDefaultValue.GetDefaultValue(typeof(System.Int32)), true, (int)fieldIndex, 0, 0, 10, false, false);

I am using the beta version (1.0.2004.2) as per your readme.htm.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39774
Joined: 17-Aug-2003
# Posted on: 18-Apr-2005 18:12:33   

GarethBrown wrote:

May not be the right place to put this but here we go...

I got an error when compiling

E:\SourceCode\Projects\Petshop\DAL\DatabaseGeneric\FactoryClasses\EntityFieldFactory.cs(261): No overload for method 'EntityField2' takes '11' arguments

here is an example.

fieldToReturn = new EntityField2("SupplierId", "SupplierEntity", typeof(System.Int32), TypeDefaultValue.GetDefaultValue(typeof(System.Int32)), true, (int)fieldIndex, 0, 0, 10, false, false); I am using the beta version (1.0.2004.2) as per your readme.htm.

You're sure you reference the right runtime libraries? VS.NET might resolve the references to the 1.0.2004.1 runtime libraries simple_smile

If you are using the 1.0.2004.2 runtimes, be sure you're using the latest beta, as the issue you run into is the ReadOnly parameter which was added during the beta period.

Frans Bouma | Lead developer LLBLGen Pro
Posts: 40
Joined: 26-Nov-2004
# Posted on: 18-Apr-2005 18:26:11   

I must remember to keep an eye on those beta updates! Thanks that fixed it.