Unmarshalling Error [com.ctc.wstx.exc.WstxLazyException] - vb.net

I am communicating with a partner's webservice using proxy classes they've provided.
I have this line of code which is throwing an exception:
Dim response As requestWebRemittanceResponse = Me.webRemittanceService.requestWebRemittance(webRemittanceRequest)
webRemittanceService is and instance of one of these proxy classes and webRemittanceRequest is an instance of another.
Which seems rather straight forward, but the following exception is something I've never seen and does not help much as I cannot step into the requestWebRemittance(webRemittanceRequest) method.
Unmarshalling Error: [com.ctc.wstx.exc.WstxLazyException] Invalid character reference: null character not allowed in XML content. at [row,col {unknown-source}]: [1,391]
The partner is saying that it's not something from their side.
Any help would be greatly appreciated.

I found the problem which made me feel like an idiot.
I was decrypting a password that needs to be sent to the webservice.
The decrypter used was adding an unprintable character to the password string.

Related

HealthCheckUI (AspNetCore.Diagnostics.HealthChecks) Unexpected Character 'H' error

I'm having an issue with the AspNetCore HealthCheckUI.
I followed this example:
https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks#healthcheckui
My UI is up and running and my services are up and running with a healthcheck that just returns a string "Healthy". And I think that's the root cause of the issue.
It looks like the UI is showing a "false" error because it's expecting JSON and seeing a string. And so it's throwing an "Unexpected character 'H'" error while parsing the response.
Is there a way to stop the healthcheckui from expecting json?
Is there a way have this AspNetCore HealthChecksUI package work with a Healthcheck that doesn't return JSON?
Found the closest thing I could find to an answer, which is basically change all my healthchecks to json :(
https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks/issues/440

Power BI issues with Incapsula

I'm trying to get data->web to a service that uses Incapsula for DDOS and I'm getting the error:
DataSource.Error: The server committed a protocol violation.
Section=ResponseHeader Detail=CR must be followed by LF
There was a workaround posted here:
Power BI (Power Query) Web request results in "CR must be followed by LF" Error
But that workaround won't work for me, as the data that is returned is not a Web.Page (rather it's JSON) and therefore the Web.Page function will return a message that the results don't look like a Web.page.
Query looks like this:
= Json.Document(Web.Contents("url", [Headers=[Authorization="Basic {encoded value}", #"X-Forte-Auth-Organization-Id"="{org_id}"]]))
and will actually work when I use the query validator, but when I exit out to use I get the error shown above.
If I do this:
=Json.Document(Web.Page(Web.Contents(url, [Headers=[Authorization="Basic {encoded value}", #"X-Forte-Auth-Organization-Id"="{org_id}"]])))
then I get this error:
DataFormat.Error: The resource at 'url' cannot be retrieved using
Web.Page. It doesn't appear to be a web page.
Stack overflow wouldn't let me post the actual urls because I don't have enough reputation.
Any assistance is greatly appreciated.
[Disclaimer: I work for Incapsula]
I recommend contacting Incapsula support at support[at]incapsula.com
They can help you with this, but are unable to post the response publically.

How to properly encode special characters in a REST API url

EDIT: The NHTSA docs, as CBroe points out, say to replace an ampersand with an underscore. However, I'm also getting an error with forward slashes (albeit a different one, page not found, because it's decoding the slash), for example the make 'EXISS/SOONER':
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/EXISS%2FSOONER?format=json
And replacing the ampersand with an underscore no longer results in an error message, but in zero results returned, which should not be the case.
ORIGINAL POST:
I'm trying to download the content from the following URL:
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/s&s?format=json
And the site returns the following error message:
Server Error in '/' Application.
A potentially dangerous Request.Path value was detected from the client (&).
The problem is the ampersand; a similar request for a different car make works:
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/toyota?format=json
I have verified from a different endpoint that S&S is a valid make for the API.
Based on stackoverflow answers, I've tried all the following without success:
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/s%26s?format=json
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/s%26amp;s?format=json
http://www.nhtsa.gov/webapi/api/Recalls/vehicle/modelyear/1997/make/s%26amp%3Bs?format=json

Invalid input - URIString in webMethods 8 using AS2

I have an issue when I try to send an EDI document to a partner using AS2 (HTTPS). The transaction is being translated correctly and when it reaches EDIINT step I got the error:
Invalid input - URIString [EDIINT.000001.000003]
I already checked the URL provided by partner and it's working.
Something that is strange is that we can send the MDN when we receive any transaction from them, but when we try to send a transaction from our end, we got that error.
What's causing such errors and how can I fix it?
can you try encoding the URL string

Cannot parse feed

I'm trying to parse this feed http://www.bbc.co.uk/sport/football/teams/newcastle-united/rss.xml
I get this message "A feed could not be found at http://. A feed with an invalid mime type may fall victim to this error, or SimplePie was unable to auto-discover it.. Use force_feed() if you are certain this URL is a real feed."
If I use force_feed I get an error "This XML document is invalid, likely due to invalid characters. XML error: Mismatched tag at line 27, column 8" but looking at the xml I can't see any errors. Indeed, checking at http://validator.w3.org/ seems to validate fine.
Any suggestions?
I'm running the latest version of simplepie downloaded a few days ago.
I found the problem when I stripped out the code to create a test case. The url being loaded was http://www.bbc.co.uk//sport/football/teams/newcastle-united/rss.xml (notice the double forward slash). simplepie seems to not be dealing with this gracefully. Removing the double slash fixes the problem