views:

312

answers:

0

When I try to post the XML to an SSL link by the following code

public void send(String url, String xmldoc)
 {

  StringBuffer sb = new StringBuffer();
  try
  {

   ByteArrayInputStream bais = new ByteArrayInputStream(xmldoc
     .getBytes());  
   InputSource is = new InputSource(bais);
   DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();  
   factory.setNamespaceAware(true);  
   DocumentBuilder builder = factory.newDocumentBuilder();  
   Document document = builder.parse(is);
   org.w3c.dom.Element root = document.getDocumentElement();
   org.apache.axis.message.SOAPBodyElement input[] =
   {
    new org.apache.axis.message.SOAPBodyElement(root)
   };  
   Service service = new Service();  
   org.apache.axis.client.Call call = (Call) service.createCall();  
   call.setProperty(Call.SOAPACTION_USE_PROPERTY, new Boolean(true));
   call.setTimeout(new Integer(0x2bf20));
   call.setTargetEndpointAddress(new URL(url));
   call.setOperationStyle("document");
   Vector result = null;
   result = (Vector) call.invoke(input);  
   SOAPBodyElement body = (SOAPBodyElement) result.elementAt(0);   

  }
  catch (Exception e)
  {
   e.printStackTrace();
  }
 }

I get this exception

XMLUtils - -Failed to set EntityResolver to null on DocumentBuilder <java.lang.NullPointerException>java.lang.NullPointerException
 at weblogic.xml.jaxp.ChainingEntityResolver.popEntityResolver(ChainingEntityResolver.java:61)
 at weblogic.xml.jaxp.RegistryDocumentBuilder.setEntityResolver(RegistryDocumentBuilder.java:168)
 at org.apache.axis.utils.XMLUtils.releaseDocumentBuilder(XMLUtils.java:252)
 at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:342)
 at org.apache.axis.message.Text.<init>(Text.java:42)
 at org.apache.axis.message.MessageElement.addTextNode(MessageElement.java:1392)
 at org.apache.axis.message.SOAPHandler.addTextNode(SOAPHandler.java:148)
 at org.apache.axis.message.SOAPHandler.endElement(SOAPHandler.java:112)
 at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
 at weblogic.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:585)
 at weblogic.apache.xerces.impl.XMLNamespaceBinder.handleEndElement(XMLNamespaceBinder.java:898)
 at weblogic.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:644)
 at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1008)
 at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
 at weblogic.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:329)
 at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:525)
 at weblogic.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:581)
 at weblogic.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
 at weblogic.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1175)
 at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:135)
 at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:152)
 at javax.xml.parsers.SAXParser.parse(SAXParser.java:345)
 at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
 at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
 at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
 at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
 at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
 at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
 at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
 at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
 at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
 at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
 at org.apache.axis.client.Call.invoke(Call.java:2767)
 at org.apache.axis.client.Call.invoke(Call.java:1792)

I am getting exception on the line where I invoke the result.Can anyone help me in solving this.I am using w/l 8.1 and AXIS 1.4 jar