Hi,
I have checked the server is sending right type "text/xml".
Please just have a look on my code. Please Suggest me somthing I am new to WS.
*******************************************************
// creating a SOAP Message from StringBuffer to Input Stream to SOAP Msg
StringBuffer sb1 = new StringBuffer();
sb1.append("<?xml version='1.0' encoding='utf-8'?>");
sb1.append("<soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>");
sb1.append("<soap:Body>");
sb1.append("<AuthenticateUser xmlns='http://LoginAuth.com/webservices'>");
sb1.append("<AuthKey>hjhjkhkjjkjk</AuthKey>");
sb1.append("</AuthenticateUser>");
sb1.append("</soap:Body>");
sb1.append("</soap:Envelope>");
String strSoap=sb1.toString();
//"strSoap" is the SOAP message i have to send to get a reply.
byte[] b = strSoap.getBytes("UTF-8");
InputStream in = new ByteArrayInputStream(b);
MimeHeaders mh = new MimeHeaders();
mh.setHeader("Content-Type", "text/xml");
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage message = mf.createMessage(mh,in);
//Here I am getting the error..................
SOAPMessage reply = soapConnection.call(message, url);
.
.
.
The exception i am getting is..................
Mar 1, 2007 3:22:02 PM com.sun.xml.messaging.saaj.soap.MessageImpl identifyContentType
SEVERE: SAAJ0537: Invalid Content-Type. Could be an error message instead of a SOAP message
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Invalid Content-Type:text/html. Is this an error message instead of a SOAP response?
at com.sun.xml.messaging.saaj.soap.MessageImpl.identifyContentType(MessageImpl.java:296)
.
.
.
.
Exception caught:java.security.PrivilegedActionException: com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
Sumit