SOAP AddResource Error

Ideas and discussions on third party tools and utilities

Moderator: Forum Moderator

Post Reply
User avatar
Mutt-Li
Novice Crafter
Posts: 45
Joined: Fri Oct 22, 2010 7:06 pm

SOAP AddResource Error

Post by Mutt-Li » Wed Jan 19, 2011 7:02 pm

I just found a bug in the Soap Add Resource Function

if the resource (name) exists on another Server (Deisi now exists on 2 planets Deisi [Sunrunner] Kammris Iron and Deisi [Flurry] Nabooian Berry Fruit) SoapAddResource causes an error and returns "status 4" and does not add the resource,
I added Deisi [Flurry] Nabooian Berry Fruit manually
here is the returned packet (with a few newlines added)

<?xml version="1.0" encoding="ISO-8859-1"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="urn:swgcraft">
<SOAP-ENV:Body>
<ns1:SoapAddResourceResponse xmlns:ns1="urn:swgcraft">
<return xsi:type="tns:AddResourceOutput">
<Status xsi:type="xsd:integer">4</Status>
<ResourceID xsi:type="xsd:integer">
</ResourceID>
</return>
</ns1:SoapAddResourceResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

User avatar
Mutt-Li
Novice Crafter
Posts: 45
Joined: Fri Oct 22, 2010 7:06 pm

Re: SOAP AddResource Error

Post by Mutt-Li » Wed Jan 19, 2011 7:08 pm

Oh, just incase you want it ,
here is the sent packet, with extra newlines, and without my Hashed password

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
<SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:NS2="urn:swgcraft">
<NS1:SoapAddResource xmlns:NS1="urn:swgcraft">
<input href="#1"/>
</NS1:SoapAddResource>
<NS2:AddResourceInput id="1" xsi:type="NS2:AddResourceInput">
<Name xsi:type="xsd:string">Deisi</Name>
<Server xsi:type="xsd:int">9</Server>
<Planet xsi:type="xsd:int">6</Planet>
<Class xsi:type="xsd:string">Nabooina Berry Fruit</Class>
<Stats href="#2"/>
<Login href="#3"/>
<Current xsi:type="xsd:boolean">true</Current>
<ProgramInfo href="#4"/>
</NS2:AddResourceInput>
<NS2:Stats id="2" xsi:type="NS2:Stats">
<er xsi:type="xsd:int">0</er>
<cr xsi:type="xsd:int">0</cr>
<cd xsi:type="xsd:int">0</cd>
<dr xsi:type="xsd:int">0</dr>
<fl xsi:type="xsd:int">0</fl>
<hr xsi:type="xsd:int">0</hr>
<ma xsi:type="xsd:int">0</ma>
<oq xsi:type="xsd:int">0</oq>
<sr xsi:type="xsd:int">0</sr>
<ut xsi:type="xsd:int">0</ut>
<pe xsi:type="xsd:int">0</pe>
</NS2:Stats>
<NS2:Login id="3" xsi:type="NS2:Login">
<userid xsi:type="xsd:string">9259</userid>
<md5pass xsi:type="xsd:string">Im not telling you</md5pass>
</NS2:Login>
<NS2:ProgramInfo id="4" xsi:type="NS2:ProgramInfo">
<Name xsi:type="xsd:string">FZ_OCR_Res_Scanner</Name>
<Version xsi:type="xsd:string">1.0.1</Version>
</NS2:ProgramInfo>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

User avatar
Sobuno
Developer
Posts: 2589
Joined: Sun Mar 25, 2007 2:17 am
Contact:

Re: SOAP AddResource Error

Post by Sobuno » Wed Jan 19, 2011 8:48 pm

Status Codes:
1 = A resource named $name already exists. The stats have been updated if it had none.
2 = $class cannot spawn on $planet
3 = Resource added
4 = Class does not exist (Or isn't a spawnable class)
5 = Server does not exist
6 = Planet does not exist
7 = The resource name contains invalid characters
8 = A resource named $name already exists, but does not have the same class as the input resource
999 = Userid and password do not match
Your class is misspelled (Nabooina instead of Nabooian or whatever the correct is), working as intended.

User avatar
Zimoon
Forum Moderator
Posts: 4817
Joined: Mon May 14, 2007 6:55 am
Location: Stockholm, SE
Contact:

Re: SOAP AddResource Error

Post by Zimoon » Wed Jan 19, 2011 10:30 pm

SWGCraft uses the class names spelled exactly as they are in the resourcetree.XML file that is available almost next to SWGAide, at its download site. SWGAide downloads it and uses it dynamically, I think it is available in the "crafting" folder.

Use that file and you will be fine.

There are very real and valid reasons for the few class names that does not read exactly as read in your inventory. More on that subject is read bottommost of the XML file :)

/Zimoon

User avatar
Mutt-Li
Novice Crafter
Posts: 45
Joined: Fri Oct 22, 2010 7:06 pm

Re: SOAP AddResource Error

Post by Mutt-Li » Thu Jan 20, 2011 12:56 am

I just had a look at the saved screenshot,
the spelling on the screenshot is incorrect too
it seems someone at SOE screwed it up

User avatar
Mutt-Li
Novice Crafter
Posts: 45
Joined: Fri Oct 22, 2010 7:06 pm

Re: SOAP AddResource Error

Post by Mutt-Li » Thu Jan 20, 2011 2:20 am

SWGCraft uses the class names spelled exactly as they are in the resourcetree.XML file that is available almost next to SWGAide, at its download site. SWGAide downloads it and uses it dynamically, I think it is available in the "crafting" folder.
My program, uses OCR to read the survey list, so how can i use it dynamically, other than using it as a spellchecker

User avatar
Zimoon
Forum Moderator
Posts: 4817
Joined: Mon May 14, 2007 6:55 am
Location: Stockholm, SE
Contact:

Re: SOAP AddResource Error

Post by Zimoon » Thu Jan 20, 2011 5:47 pm

You can read the XML file into a hashmap, or a simple list, and each resource class from ORC must be verified/corrected against/with the map. In fact, you just need the leafs of the tree as no node wih children can ever spawn in the worlds.

/Zimoon

User avatar
Mutt-Li
Novice Crafter
Posts: 45
Joined: Fri Oct 22, 2010 7:06 pm

Re: SOAP AddResource Error

Post by Mutt-Li » Fri Jan 21, 2011 9:54 pm

I prefer the cvs files, easier to read,
I implemented a Conversion process to convert a 'Incorrect' Class to the 'Correct' one, (selected from a list) and record the correction for later use

User avatar
Zimoon
Forum Moderator
Posts: 4817
Joined: Mon May 14, 2007 6:55 am
Location: Stockholm, SE
Contact:

Re: SOAP AddResource Error

Post by Zimoon » Sat Feb 05, 2011 1:02 pm

Mutt-Li wrote:I prefer the cvs files, easier to read,
I implemented a Conversion process to convert a 'Incorrect' Class to the 'Correct' one, (selected from a list) and record the correction for later use
Easier to read (for the human eye) I guess depends on formatting and layout. Reading a compact and not tabulated CVS is often a nightmare (and TABs are outside the protocol though often supported by readers). Reading a badly laid out XML is also a nightmare.

For computers CVS offers no natural way to tell hierarchies such as for resource classes, it can be done but kind of clumsy and not as elegant as XML.

That said, I belive the formatting and layout of the resourcetree.XML is quite nice and I often lookup what I need in my text editor (called MED and I brought it with me when I stopped using OS/2 many years ago, it's upside is HEX and binary display plus syntax coloring).

Yeah, extracting a small list of the oddities should work. And there are a few ;)

Zimoon

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests