Forums

getting internal error using XmlRpc lib

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

getting internal error using XmlRpc lib

Postby gauthier » Fri Sep 26, 2008 2:03 pm

I got internal error when trying to compile that code:

use CookComputing.XmlRpc

namespace WordPress.XmlRpc

struct Authors
var user_id as String
var user_login as String
var display_name as String
var user_email as String
var meta_value as String

interface IWordPressAPI

pro url as String

def getAuthors(blogId as int, username as String, password as String) as Authors[]
has XmlRpcMethod("wp.getAuthors", Description = "Get an array of users for the blog.")

use WordPress.XmlRpc

class Hello
def main is shared
proxy = XmlRpcProxyGen.create<of IWordPressAPI>()


The sample use http://www.xml-rpc.net/ library

Code: Select all
cobra -kif -r:CookComputing.XmlRpcV2.dll  program.cobra > log


Code: Select all
(empty)(1): error: COBRA INTERNAL ERROR / RequireException / ; sourceSite = C:\home\dev\src\dotnet\projects\cobralanguage\Source\Members.cobra:1314 in Method.constructedMethodWith for object Method-sh(39231, name=create, didBindInh=false, didStartBindInt=true, didBindInt=true, didBindImp=false, token=Token((EMPTY), '', nil, ln 1, col 1, (empty)), name=create, isNames=['public', 'shared', 'nonvirtual'], parentBox=Class-mi(5351, name=XmlRpcProxyGen, didStartBindInh=true, didBindInh=true, didStartBindInt=true, didBindInt=true, didBindImp=false, token=Token((EMPTY), '', nil, ln 1, col 1, (empty)), didBindInh=true, isGeneric=false, isGenericDef=false, needsConstruction=false, 5351), returnTypeNode=NilableTypeProxy-mi(39230, didBindInh=false, didBindInt=false, didBindImp=false, innerTypeProxy=ClrTypeProxy-sh(39229, didBindInh=false, didBindInt=false, didBindImp=false, clrType=System.Object), 39230), returnType=NilableType-mi(39247, didBindInh=false, didBindInt=false, didBindImp=false), implementsType=nil, 39231); info       = nil; this       = Method-de(39231, name=create, didBindInh=false, didStartBindInt=true, didBindInt=true, didBindImp=false, token=Token((EMPTY), '', nil, ln 1, col 1, (empty)), name=create, isNames=['public', 'shared', 'nonvirtual'], parentBox=Class-mi(5351, name=XmlRpcProxyGen, didStartBindInh=true, didBindInh=true, didStartBindInt=true, didBindInt=true, didBindImp=false, token=Token((EMPTY), '', nil, ln 1, col 1, (empty)), didBindInh=true, isGeneric=false, isGenericDef=false, needsConstruction=false, 5351), returnTypeNode=NilableTypeProxy-mi(39230, didBindInh=false, didBindInt=false, didBindImp=false, innerTypeProxy=ClrTypeProxy-sh(39229, didBindInh=false, didBindInt=false, didBindImp=false, clrType=System.Object), 39230), returnType=NilableType-mi(39247, didBindInh=false, didBindInt=false, didBindImp=false), implementsType=nil, isNames=['public', 'shared', 'nonvirtual'], docString=, params=['Param'(39228, "'(EMPTY)'", 'itf', 'Type?')], requirePart=RequirePart-sh(39248, didBindInh=false, didStartBindInt=true, didBindInt=true, didBindImp=false, token=Token((EMPTY), '', nil, ln 1, col 1, (empty)), connectToken=nil, isImplicit=true, 39248), ensurePart=EnsurePart-sh(39249, didBindInh=false, didStartBindInt=true, didBindInt=true, didBindImp=false, token=Token((EMPTY), '', nil, ln 1, col 1, (empty)), connectToken=nil, isImplicit=true, 39249), locals=[], stmts=[], genericParams=[], 39231);     .isGenericDef = false;
Compilation failed - 1 error, 0 warnings
Not running due to errors above.


Any idea?
gauthier
 
Posts: 116

Re: getting internal error using XmlRpc lib

Postby Charles » Fri Sep 26, 2008 8:32 pm

I'll take a look, but I had trouble building the XmlRpc .DLL. Could you reply and attach it here?
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: getting internal error using XmlRpc lib

Postby gauthier » Sat Sep 27, 2008 3:07 am

You can download the latest binary here:
http://xmlrpcnet.googlecode.com/files/xml-rpc.net.2.3.2.zip

that is what I use with my sample.

Thanks

Edit: just added the dll file
Attachments
CookComputing.XmlRpcV2.dll
(116 KiB) Downloaded 459 times
Last edited by gauthier on Sat Sep 27, 2008 9:54 am, edited 1 time in total.
gauthier
 
Posts: 116

Re: getting internal error using XmlRpc lib

Postby Charles » Sat Sep 27, 2008 8:18 am

I didn't find a DLL in that and when I went to build the project, I received some errors. Maybe I just missed it? Or downloaded a different file?

I'm traveling today so won't be able to check until later.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: getting internal error using XmlRpc lib

Postby Charles » Sun Sep 28, 2008 12:01 pm

Thanks for the upload. There are a few problems here with Cobra's treatment of generic methods. I have one of the fixes checked into development (and locked down with a new test case), but I'm not done yet.

This was a nice find, so thanks for the report. It may be another day or two before I have this all cleared up. I will post back when that happens.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: getting internal error using XmlRpc lib

Postby gauthier » Sun Sep 28, 2008 1:32 pm

Thanks for the update, this was intriguing to me because I tried similar generic signature (in cobra declaration only) and it worked right.
gauthier
 
Posts: 116

Re: getting internal error using XmlRpc lib

Postby Charles » Wed Oct 01, 2008 10:42 am

The problems are fixed and locked down with new test cases. The code that I got working is:
"""
cobra -r:CookComputing.XmlRpcV2.dll program.cobra
"""

use CookComputing.XmlRpc

namespace WordPress.XmlRpc

struct Authors
var user_id as String
var user_login as String
var display_name as String
var user_email as String
var meta_value as String

interface IWordPressAPI

pro url as String

def getAuthors(blogId as int, username as String, password as String) as Authors[]
has XmlRpcMethod("wp.getAuthors", Description = "Get an array of users for the blog.")

use WordPress.XmlRpc

class Hello

def main is shared
proxy = XmlRpcProxyGen.create<of IWordPressAPI>
print proxy
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 99 guests

cron