简体   繁体   中英

JAVA and JAVAX core imports for Web Services with Android

I'm working on developing an app for Android tablets that's meant as a way to read credit cards and process the payments through a client's NetSuite ERP system. I used wsdl2java from Apache.CFX to generate the java files for NetSuite's web services. However, most of the class files import from javax.xml and javax.jws.

As a means to resolve this, as Eclipse would not compile when using rt.jar in the project library, I used jarjar to refactor rt.jar so that those references were instead made to ns.javax. Doing this and bringing the refactor jar into the library eliminated the errors piled up in the Problems tab. However, it still wouldn't compile, as Java core references were still being made.

So I made the next logical step, and with jarjar refactored all java and javax. Now I get new errors, for the most part now all stemming from the following all over the web services classes:

The constructor QName(string, string) is undefined

I changed the import to remove the new class prefix, but then just created new errors as various other classes and objects couldn't be defined throughout the web services files.

I can't seem to find much in the way of relevant resources to get this working as all of my searches turn up references to other NetSuite apps for Android that are available, and nothing about consuming the web services on the Android platform. Right now, I can only guess that I'm going about this in a half-correct fashion at best.

Are there libraries out there I can use to replace rt.jar that will work on the Android platform?

---- EDIT ----

I thought I'd add an example of some of the core imports being made causing this issue...

import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlElementDecl;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
import javax.xml.namespace.QName;

I was able to generate Android-compatible web services classes from a wsdl by using EasyWSDL.com . I had to modify a few class files, though, as it generated methods that exceeded the 64k limit Java imposes upon method size.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM