I want to run a java application which calls a web service. Everything works fine from the netbeans ide, but fails when I run the .jar generated. What could be the problem? How can I check the content type that the error is pointing at?

The error says: SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message

EDIT
I am realizing that the problem could be originated by the fact that the web service that Im consuming uses a custom data type, but I have no idea where to look.
Please help

What is the exact complete error message?

The error says "SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message"

This may be relevant?

I have to say that I dont have an explicit response method call in my code. This is how I call a method of the web service:

 public static void main(String[] args) {
        logger.setUseParentHandlers(false);

         try { // This code block invokes the TipoCambioSoap:tipoCambioDia operation on web service
            javaapplication15.TipoCambio tipoCambio = new javaapplication15.TipoCambio_Impl();
            javaapplication15.TipoCambioSoap tipoCambioSoap = tipoCambio.getTipoCambioSoap();
            tipoCambioSoap.tipoCambioDia();

            VarDolar[] Cam = tipoCambioSoap.tipoCambioDia().getCambioDolar().getVarDolar();
            float Cambio = Cam[0].referencia;
            String Fecha = Cam[0].fecha;
            JavaApplication15.inserta_bd(Fecha, Cambio);
            } catch (ServiceException | RemoteException | SQLException | ParseException ex) {
                logger.log(Level.SEVERE, "Excepcion al ejecutar ws: '{}'", ex);
            } 
         }

Now how can I change the get and post URLs as the answer says ?
thanks

Between the Spanish(?) and the Java EE content I don't think I can help much here, I'm just a Java SE man. Hopefully someone else can step in quickly...

The error above is saying com.sum.xml.messaging.saaj.soap.MessageImpl identifyContentType

As far as I can see, I just need to set the properly content type. I have tried with

System.setProperty("Content-Type", "text/xml");

but no results. I think there are some properties setted in netbeans that are needed to be added to the jar while executing it. How can I make it work?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.