0 Replies Latest reply on Mar 2, 2012 6:23 AM by 791417

    SOAPException: faultCode=SOAP-ENV:Protocol; msg=Missing content type

      I have a WSDL file for which I have created a Web Service stub/skeleton through jdeveloper(version Below is the complete code which has been generated by developer. Now whenever i try to run this file in jdeveloper I get the following exception. Please let me know how to resolve this issue.

      Also error message is received at the following line of code:
      *msg.send(endpointURL, ""<<some URL>>", requestEnv);*
      *Exception Message*
      [SOAPException: faultCode=SOAP-ENV:Protocol; msg=Missing content type.]
      at org.apache.soap.transport.TransportMessage.read(TransportMessage.java:249)
      at oracle.soap.transport.http.OracleSOAPHTTPConnection.post(OracleSOAPHTTPConnection.java:973)
      at oracle.soap.transport.http.OracleSOAPHTTPConnection.send(OracleSOAPHTTPConnection.java:722)
      at org.apache.soap.messaging.Message.send(Message.java:125)
      at mypackage.NPVNSDLStub.PANDetails(NPVNSDLStub.java:88)
      at mypackage.NPVNSDLStub.main(NPVNSDLStub.java:41)
      *Code generated by Jdeveloper*
      package mypackage;
      import oracle.soap.transport.http.OracleSOAPHTTPConnection;
      import org.apache.soap.encoding.SOAPMappingRegistry;
      import org.w3c.dom.Element;
      import java.util.Vector;
      import oracle.jdeveloper.webservices.runtime.WrappedDocLiteralStub;
      import java.net.URL;
      import org.apache.soap.Envelope;
      import org.apache.soap.Body;
      import org.apache.soap.messaging.Message;
      import java.util.Properties;
      * Generated by the Oracle JDeveloper 10g Web Services Stub/Skeleton Generator.
      * Date Created: Wed Feb 29 18:39:33 IST 2012
      * WSDL URL: file:/C:/WS/sample.wsdl
      public class NPVNSDLStub extends WrappedDocLiteralStub 
      public NPVNSDLStub()
      m_httpConnection = new OracleSOAPHTTPConnection();
      public static void main(String[] args)
      NPVNSDLStub stub = new NPVNSDLStub();
      catch(Exception ex)
      private String _endpoint = "<<some URL>>";
      public String getEndpoint()
      return _endpoint;
      public void setEndpoint(String endpoint)
      _endpoint = endpoint;
      private OracleSOAPHTTPConnection m_httpConnection = null;
      private SOAPMappingRegistry m_smr = null;
      public String PANDetails(String Request) throws Exception
      URL endpointURL = new URL(_endpoint);
      Envelope requestEnv = new Envelope();
      Body requestBody = new Body();
      Vector requestBodyEntries = new Vector();
      String wrappingName = "PANValidationRequest";
      String targetNamespace = "<<namespace url>>";
      Vector requestData = new Vector();
      requestData.add(new Object[] {"Request", Request});
      requestBodyEntries.addElement(toElement(wrappingName, targetNamespace, requestData, false));
      Message msg = new Message();
      *msg.send(endpointURL, "<<some URL>>", requestEnv);*
      Envelope responseEnv = msg.receiveEnvelope();
      Body responseBody = responseEnv.getBody();
      Vector responseData = responseBody.getBodyEntries();
      return (String)fromElement((Element)responseData.elementAt(0), java.lang.String.class);
      Edited by: EJP on 2/03/2012 17:22: added code tags, but your indentation needs fixing