Why is ItemSearch in Amazon's Product Advertising API returning invalid XML? - amazon-product-api

The Amazon Product Advertising API appears to be fatally buggy and I'm wondering if it's just me, and if there's any work around for this apparent bug.
When I present the following parameters to the Product Advertising API:
<Arguments>
<Argument Name="Operation" Value="ItemSearch"></Argument>
<Argument Name="Service" Value="AWSECommerceService"></Argument>
<Argument Name="Signature"
Value="<omitted>"></Argument>
<Argument Name="Manufacturer" Value="Leg Avenue"></Argument>
<Argument Name="AssociateTag" Value="<omitted>"></Argument>
<Argument Name="Version" Value="2009-03-31"></Argument>
<Argument Name="AWSAccessKeyId" Value="<omitted>"></Argument>
<Argument Name="Timestamp" Value="2012-10-18T15:49:10Z"></Argument>
<Argument Name="ResponseGroup" Value="ItemAttributes,SalesRank"></Argument>
<Argument Name="SearchIndex" Value="Apparel"></Argument>
</Arguments>
I get back a whole bunch of XML, part of which contains a clear and significant bug:
<Publisher>Rubies/Publisher>
Note the missing proper close tag for the <Publisher> element. As you might expect, this causes any XML parser to blow up.
I don't see any easy work around for this. I searched around a bit and did not find anyone else reporting the same problem, which I find kind of surprising given the severity of this issue. It basically makes the entire API useless.
I'm sure I'm missing something - the API can't be this buggy. Anyone know what I'm doing wrong? Can anyone else confirm whether this is a bug?
[Edit] This appears to be intermittent.

If you make too many requests to the Amazon Product API in a row you get throttled. This can make debugging issues frustrating. If the problem is intermittent and you can get the information you expect from the API and your code given different parameters then perhaps there is bad data in Amazon's Product API database or you should wait a day and see if you're getting throttled.
If you're getting throttled you don't get any data instead an error code of some sort, it has been a while since I debugged some issues, my code works, perhaps you can adapt it.

Related

URL Rewrite with Google Tag Manager script issues

In Google Tag Manager, there is a 3rd party script that is added to each one of my pages on my site.
The script looks like this:
<script type='text/javascript'>
(function(a,b,c,d){
a='https://www.test1.com/proxydirectory/tags/12512/tag.js';
b=document;c='script';d=b.createElement(c);d.src=a;
d.type='text/java'+c;d.async=true;
d.id='cjapitag';
a=b.getElementsByTagName(c)[0];a.parentNode.insertBefore(d,a)
})();
</script>
According to the 3rd party instructions:
I will need to set up a reverse proxy from my own domain to their servers. The reverse proxy will send requests that start with the following path:
https://www.test1.com/proxydirectory/
And proxy those request back to their servers:
https://www.theirserver.com/
Before adding the rewrite, when I open my pages I get the following in my console after creating the Google Tag Manager stuff:
VM38:1 GET https://www.test1.com/proxydirectory/tags/12512/tag.js
net::ERR_ABORTED 404 (Not Found)
I figure that is because I am not rewriting the URL yet. Cool, at least I know the tag manager is setting my pages. So now for the rewrite.
I attempted a rewrite in IIS URL Rewrite, so that it will rewrite the https://www.test1.com/proxydirectory/tags/12512/tag.js to https://www.theirserver.com/tags/12512/tag.js with the following rule attempts :
Attempt #1:
<rule name="ReverseProxy">
<match url="https://www.test1.com/proxydirectory/" />
<action type="Rewrite" url="https://www.theirserver.com/" />
</rule>
Attempt #2:
<rule name="ReverseProxy">
<match url="proxydirectory/(.*)" />
<action type="Rewrite" url="https://www.theirserver.com/{R:1}" />
</rule>
Both of these attempts after rebuilding and reloading the page, even restarting the IIS server, did not work. I still get
VM38:1 GET https://www.test1.com/proxydirectory/tags/12512/tag.js
net::ERR_ABORTED 404 (Not Found)
and yes the 3rd Party server tag.js file does exist and the URL is correct (didn't post the real one here)
Not sure what to do. Thanks in advance.

JMeter generates server error when trying to reproduce an autoComplete tag

I am trying to load test with JMeter.
I have a program where incidents are created.
For now, when playing the recording, it logs in fine, but when saving data it generates the following error:
SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-5) Error Rendering View[/alta.xhtml]: javax.el.PropertyNotFoundException: /alta.xhtml #840,111 value="#{alta.nombre}": Target Unreachable, 'null' returned null
I have noticed that maybe the error is thrown because I have auto-complete lists.
Since, an error that is also seen in the console is:
SEVERE [javax.enterprise.resource.webcontainer.jsf.application] (default task-5) Error Rendering View[/alta.xhtml]: java.lang.NullPointerException
at org.primefaces.component.autocomplete.AutoCompleteRenderer.encodeSuggestionsAsList(AutoCompleteRenderer.java:647)
How can i fix this? Apparently in the JMeter recording all the values ​​are saved...
The autocomplete of the first error that I have put is the following:
<p:autoComplete id="via"
rendered="#{not alta.isNuevoNivel}"
dropdown="true"
widgetVar="viaWV"
placeholder="Seleccione la via"
value="#{alta.nombre}"
requiredMessage="Falta la via"
completeMethod="#{alta.completeTextPrimeraVia}"
required="true"
queryDelay="100"
cache="true"
forceSelection="true"
scrollHeight="200"
minQueryLength="0"
onfocus="if (#{null eq alta.via}) {PF('viaWV').search('');};"
onclick="PF('viaWV').search('');"
autoHighlight="false"
inputStyleClass="comboEditorAutoInput"
styleClass="comboEditorAuto"
panelStyleClass="panStyleAuto"
tabindex="24"
disabled="#{alta.isObligada() or not alta.isNueva()}" >
<p:ajax event="itemSelect"
partialSubmit="true"
delay="100"
listener="#{alta.onChangeViaEdicion()}"
update="rcCampoViaModificado :formEdicionVia:via_valor"
oncomplete="rcCampoViaModificado();"
onerror="onError();"/>
<p:ajax event="clear"
immediate="true"
delay="100"
listener="#{alta.clearVialEdicion()}"
update="rcCampoViaModificado"
oncomplete="rcCampoViaModificado();"
onerror="onError();"/>
</p:autoComplete>
Most probably your request fails due to missing or improperly implemented correlation, for modern Web 2.0 applications the chance of successful replaying recorded script is close to zero as the applications heavily rely on dynamic parameters which are used for client-side state tracking or security
When you record the actions in browser JMeter saves the values which are actual at the moment, but when you try to replay the script the values are not actual anymore so you need to extract the dynamic parameters from server response (or replicate their generation logic if they cannot be extracted) and substitute hard-coded values with their dynamic counterparts.
One of the possible ways of detecting dynamic values is recording the same scenario one more time and then comparing generated JMeter test plans - all the values which differ are a subject to correlation

Google map and firebase don't work together

UPDATE: This is the code that kills functionality of firebase. If I try to download from firebase a couple of seconds after this code (waiting with await Task.Delay, no other code running), it starts sending the code -13000, httpResult = 0 exception. The same request earlier works. Map works.
GoogleMapFragment gmf = new GoogleMapFragment(context, this);
FragmentTransaction ft = activity.FragmentManager.BeginTransaction();
ft.Add(mapLayout.Id, gmf, "my_fragment");
ft.Commit();
I wanted to have google map on layout in the same activity where I work with firebase. Map works, but somehow it interferes with firebase, which work only before creating Google map. Any ideas what can cause this?
Update 2: If I download small file before initializing google maps, I can later use firebase, so I 'solved' the issue in a little dirty way but at least I can continue working. After this 'fix' I get following error in the output but file is downloaded anyway. I must continue digging, for now I hope the worst is over...
error getting token java.util.concurrent.ExecutionException: com.google.firebase.FirebaseApiNotAvailableException: firebase-auth is not linked, please fall back to unauthenticated mode.
Old version of question:
I checked all possible answers here on SO for my question, but nothing brought me to right way. There's quite obvious output telling me that something is wrong, but I have no idea how to solve the issue. There's an answer in this question that one of possible reasons for HttpResult = 0 is that google play version on phone isn't actual enough. I used the method recommended for check and I have Google Play services 11.5.18 installed on phone. I have Xamarin.Firebase.Storage 42.1021.1 (10.2.1) installed and using Visual Studio 2015. Quite often I had to clean and rebuild and it sometimes worked, but not this time. In android properties I have Compile using android version 7.1 Nougat. I created firebase account just recently, not knowing much about this, added it in google console to existing project (as I already use google maps), filled sha1 code the same way I did with maps. Added google-services.json and set it's build action on GoogleServiceJson. No more actions I know about.
Here is my code, I tried various ways to download, upload, but this one seems to be good example:
FirebaseApp fba=FirebaseApp.InitializeApp(context);
firebaseStorage = FirebaseStorage.Instance;
firebaseStorageReference = firebaseStorage.GetReferenceFromUrl("gs://alien-chess.appspot.com");
firebaseStorageReference=firebaseStorageReference.Child("settings.dat");
byte[] bytes = new byte[1000];
firebaseStorageReference.PutBytes(bytes).AddOnFailureListener(new FirebaseFailureListener(this));
Here is my manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="AlienChessAndroid.AlienChessAndroid" android:versionCode="1" android:versionName="1.0" android:installLocation="preferExternal">
<uses-sdk android:minSdkVersion="19" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application android:label="Alien Chess" android:icon="#drawable/Alien" android:largeHeap="true">
<meta-data android:name="com.google.android.gms.version" android:value="#integer/google_play_services_version" />
<meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="AIzaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" />
</application>
And here are what I think are important parts from the output window
Failed to retrieve remote module version: V2 version check failed
Local module descriptor class for com.google.android.gms.firebasestorage not found.
Considering local module com.google.android.gms.firebasestorage:0 and remote module com.google.android.gms.firebasestorage:0
NetworkRequestFactoryProxy failed with a RemoteException:
com.google.android.gms.dynamite.DynamiteModule$zza: No acceptable module found. Local version is 0 and remote version is 0.
....
Unable to create a network request from metadata
android.os.RemoteException
....
StorageException has occurred.
An unknown error occurred, please check the HTTP result code and inner exception for server response.
Code: -13000 HttpResult: 0
There isn't much c# sources for visual studio and I can't read that easily recommendations for android studio as they are quite different for unskilled programmers.
Any ideas what other things should I check?

EWS Partial sync soap request returns organizer name as appointment subject

I am currently working on a project where the system, which is a node.js web server subscribes to push notification for changes in the resource calendars of an Exchange server. We followed the MSDN documentation to subscribe and communicate with the Exchange server using SOAP requests.
We used SOAP request below to fetch the changes and store them in the local database of the web server. The '+roomCalId' and '+syncState+' values are replaced with room calendar Id and its corresponding sync state which are stored previously in the database when subscribing.
<soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages"
xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types">
<soap:Header>
<t:RequestServerVersion Version="Exchange2013"></t:RequestServerVersion>
<t:TimeZoneContext>
<t:TimeZoneDefinition Name="UTC" Id="UTC"></t:TimeZoneDefinition>
</t:TimeZoneContext>
<t:ExchangeImpersonation>
<t:ConnectingSID>
<t:PrimarySmtpAddress>+roomCalId+</t:PrimarySmtpAddress>
</t:ConnectingSID>
</t:ExchangeImpersonation>
</soap:Header>
<soap:Body>
<m:SyncFolderItems>
<m:ItemShape>
<t:BaseShape>AllProperties</t:BaseShape>
</m:ItemShape>
<m:SyncFolderId>
<t:DistinguishedFolderId Id="calendar" />
</m:SyncFolderId>
<m:SyncState>+syncState+</m:SyncState>
<m:MaxChangesReturned>500</m:MaxChangesReturned>
<m:SyncScope>NormalItems</m:SyncScope>
</m:SyncFolderItems>
</soap:Body>
</soap:Envelope>
The process worked perfectly without any problems for the first few calendars. However, for newly created room calendars, the soap request above returns the organizer's name as appointment title instead of the actual title. Is there a reason why this might be happening?
Thats is a default setting on Room mailboxes where the Organiser name is used to replace the Subject of a Meeting. This is done for security reasons as most people have access to Meeting rooms but generally people like HR might not want people to see the subject of the meeting (eg meeting to talk about downsizing etc). You can change this setting using the Set-CalendarProcessing cmdlet https://technet.microsoft.com/en-us/library/dd335046(v=exchg.160).aspx and the AddOrganizerToSubject parameter

How can I find out how a build was triggered in Jenkins

I'm trying to update Jelly scripts in my Jenkins setup to email the reason for a build (the build trigger), but I can't find any documentation on this.
I know it should be available, as the build's page will show the information, but I want it to be displayed on the email being distributed.
Does anyone know if there is a var I can query, or a Jenkins API call I can call to get this?
You can do it by calling this API.
More convinient, in env var setted before the build, you'll find BUILD_URL :
BUILD_URL=https://jenkins-server.tld/job/JOBNAME/BUILD_NUMBER
So you just need to append /api/json. You can also got it in xml :
<freeStyleBuild>
<action>
<cause>
<shortDescription>Started by user kenji</shortDescription>
<userName>kenji</userName>
</cause>
</action>
<action/>
<action/>
<action>
<failCount>0</failCount>
<skipCount>0</skipCount>
<totalCount>1</totalCount>
<urlName>testReport</urlName>
</action>
<building>false</building>
<duration>9772</duration>
<fullDisplayName>JOBNAME #4</fullDisplayName>
<id>2011-08-10_11-19-42</id>
<keepLog>false</keepLog>
<number>4</number>
<result>SUCCESS</result>
<timestamp>1312967982296</timestamp>
<url>https://jenkins-server.tld/job/JOBNAME/4/</url>
<builtOn>macboo</builtOn>
<changeSet>
<kind>svn</kind>
<revision>
<module>https://svn-server.tld/JOBNAME/trunk</module>
<revision>7</revision>
</revision>
</changeSet>
</freeStyleBuild>