Jump to content

System.ApplicationException when downloading


Xira

Recommended Posts

After weeks and weeks of tweaking and testing, I finally got a Wherigo working just the way I want. I uploaded it and submitted the associated caches two days ago. A couple of hours ago, I decided to download it. I couldn't!!!

 

The error is:

 

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Exception of type 'System.ApplicationException' was thrown. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Wherigo.GSPCartridgeService.CartridgeService.GetCompiledCartridgeWithMetaData(GWZMetaData gwzMetaData, String CartridgeFileName, String CartridgeId, Int64 PlayerId, String PlayerName, DeviceType deviceType, String CompletionCode) at cartridge_download.btnDownload_Click(Object sender, EventArgs e)

 

Happily, I found some discussion about this in this forum. I tried every strategy I could find but nothing worked.

 

There were frequent references to text lengths, especially on startup. That gave me an idea. This cartridge is similiar to another I created a few weeks ago that downloads just fine but the start up dialog has a few more parts to it. Were there too many? I remove 3 of the dialog parts. Hallelujah! I could finally download it. I tried adding a part back. No dice. I had lucked out and removed exactly the right number.

 

So, I don't know if it's the number of parts, or the total length of text in the dialog, or something else, but trimming the dialog sequence in the cartridge's On Start event handler cleared the problem.

 

I don't need any response to this. I'm just posting this here so that if anyone else encounters the same problem they have another tactic to try for solving.

Link to comment

I agree. I'd like to know what the problem really is. So I did a whole lot of testing with a fake Wherigo that will never be made public. I established pretty quickly that it wasn't the number of entries in the dialog but rather what they contained. Eventually, the culprit was identified as a double hyphen, though obliques were suspected, too.

 

I was eventually able to reproduce a problem. I don't understand the error but I can fix it.

 

The text Wherigo consisted of a dialog with a single entry in the On Start entry handler. It contained the following text (not including the equal signs). Obfuscate strings must be off. As is, it can be downloaded. Remove the last line and it can't be downloaded. Change the double hyphens to single hyphens and the problem goes away again. Basically, the last line can't start with a double hyphen.

 

======

Some text is:

-- item one

-- item two

-- item three

 

Some text.

======

 

I applied the fix to my original Wherigo. It downloads just fine now.

 

Can anyone explain why this fix works?

 

But there's a quirk here. Early on, I realized the error had changed to the following:

 

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Length cannot be less than zero. Parameter name: length at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at Wherigo.GSPCartridgeService.CartridgeService.GetCompiledCartridgeWithMetaData(GWZMetaData gwzMetaData, String CartridgeFileName, String CartridgeId, Int64 PlayerId, String PlayerName, DeviceType deviceType, String CompletionCode) at cartridge_download.btnDownload_Click(Object sender, EventArgs e)

 

But once I got that problem dealt with, I went back a bit. My first tests had been on a version of the real Wherigo, stripped of most objects and media to speed up the upload time. It was getting the original error. I added a single dummy line of text after an instance of a double hyphen line and the problem disappeared.

 

I have no idea why the two test wherigos were reporting different errors. I can't put any more time into this.

 

Add a bit later: Fixing that problem introduced a new one. I'd been using the double hyphens to format lists. That worked fine in the emulator and the .gwc produced by Urwigo. The Wherigo compiler treated them as comments. Nothing displayed on the screen. I simply changed everything to single hyphens.

Edited by Xira
Link to comment

I sincerely appreciate your investigation. It makes what I do much easier.

 

I would guess Groundspeak's compiler works a slightly different way than the one everyone else is using, which would explain why Urwigo could create the GWC and Wherigo.com could not. Double hyphens are used as comments in Wherigo. I've also come to realize I cannot use apostrophes within comments, which causes me to use some odd phrasing if I want grammatically correct sentences within my comments.

 

Considering the line and carriage return characters are different, I could guess the site's compiler has rule: double hyphens before a line return within a text block (a string) are read as text (a literal) whereas a double hyphen without a following line return is read as beginning a comment. Yes, that's strange the site's compiler would falter while the community's compiler would work just fine.

 

This is just a hypothesis.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...