0

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

Edited by montjoile: error description

2
Contributors
6
Replies
29
Views
2 Years
Discussion Span
Last Post by montjoile
0

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

0

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

0

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...

0

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?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.