VersionOne.SDK.Python Exception while creating story -
when call create api python console, gives following exception.
traceback (most recent call last): file "<stdin>", line 3, in <module> file "c:\python27\lib\v1pysdk\base_asset.py", line 44, in create return class._v1_v1meta.create_asset(class._v1_asset_type_name, newdata) file "c:\python27\lib\v1pysdk\v1meta.py", line 128, in create_asset new_asset_xml = self.server.create_asset(asset_type_name, update_doc) file "c:\python27\lib\v1pysdk\client.py", line 202, in create_asset return self.get_xml(path, query=query, postdata=body) file "c:\python27\lib\v1pysdk\client.py", line 159, in get_xml document = elementtree.fromstring(body) file "c:\python27\lib\xml\etree\elementtree.py", line 1281, in xml parser.feed(text) file "c:\python27\lib\xml\etree\elementtree.py", line 1623, in feed self._raiseerror(v) file "c:\python27\lib\xml\etree\elementtree.py", line 1487, in _raiseerror raise err xml.etree.elementtree.parseerror: reference invalid character number: line 7575, column 75 i running python2.7 on windows. api calling
from v1pysdk import v1meta v1 = v1meta( address = 'www11.v1host.com', instance = '<instname>', username = 'sbaid', password = 'xxxxxx' ) new_story = v1.story.create( name = "temp", scope = v1.scope(321450) ) v1.scope(321450) returns correct project name, implies session version1 established correctly.
these 2 mandatory parameters , able create story these 2 parameters using web interface.
i able create story using following rest request
url - https://www11.v1host.com/instname/rest-1.v1/data/story
<asset href="/<instname>/rest-1.v1/new/story"> <attribute name="name" act="set">temp</attribute> <relation name="scope" act="set"> <asset href="/<instname>/rest-1.v1/data/scope/321450" idref="scope:321450" /> </relation> </asset>
there alternate way specify host address more reliable. here's example can try against public versionone sdk testing instance:
from v1pysdk import v1meta v1meta ( instance_url = 'https://www14.v1host.com/v1sdktesting', username = 'admin', password = 'admin' ) v1: new_story = v1.story.create( name = "temp test stackoverflow question", scope = v1.scope(0) ) fetched_story = v1.story.where(number=new_story.number).first() print fetched_story.name
Comments
Post a Comment