The problem is you can't simply expect for the Spanish to able to field that large an army and navy in one campaign, it's not resources but the sheer logistical scale a massive invasion and blockade with 15th-century technology. There's also a very big difference what the Spanish had on a map and what they actually had. By 1517 the Spanish only had parts of the Caribbean and wouldn't have Mexico and 1521 and the Inca Empire at least until the 1530's this is not counting the fact that it would take the Spanish a time long to fully control those areas.
Lets say for the sake of this POD say Spain has from its conquests from the Aztec and Incan Empires, the two Sicilies, and the Spanish Netherlands Spain proper and even the Philippines. The sheer amount of men they would have to draw would make it completely unfeasible, first, it would leave a lot of land undefended, second the only way they of to Japan would be the long way across the Cape of Good Hope into Africa. The Spanish would just better off with trade, an invasion would be damn near impossible to pull off. As for Naval Artillery one, Edo is only a small castle the capital is in Kyoto. Second, the Spanish would have to fight province through province besieging numerous castles, that only were near the coast. On top of Spain would technically be fighting hundreds of de-facto-political entities because feudal Japan was so fragmented there is no quick victory in this scenario.