Announcement Announcement Module
Collapse
No announcement yet.
problem with sending a message Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • problem with sending a message

    I have this code which is generating an error
    Element requestElement = new Element("EvaluateHandRequest");
    Namespace ns = Namespace.getNamespace("http://www.springinaction.com/poker/schemas");
    requestElement.setNamespace(ns);
    Document doc = new Document(requestElement);
    System.out.println(doc.toString());
    for (int i = 0; i < cards.length; i++) {
    Element cardElement = new Element("card");
    Element suitElement = new Element("suit");
    suitElement.setText(cards[i].getSuit().toString());
    Element faceElement = new Element("face");
    faceElement.setText(cards[i].getFace().toString());
    cardElement.addContent(suitElement);
    cardElement.addContent(faceElement);
    doc.getRootElement().addContent(cardElement);

    }

    // Send message
    JDOMSource requestSource = new JDOMSource(doc);
    JDOMResult result = new JDOMResult();
    webServiceTemplate.sendSourceAndReceiveToResult(re questSource, result);


    THis is the error generated at the sendSourceAndReceiveToResult method

    org.springframework.ws.client.WebServiceTransforme rException: Transformation error: org.jdom.JDOMException: Exception in startElement: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.; nested exception is javax.xml.transform.TransformerException: org.jdom.JDOMException: Exception in startElement: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
    Caused by: javax.xml.transform.TransformerException: org.jdom.JDOMException: Exception in startElement: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.

  • #2
    Make sure you use Xalan 2.7.0.

    Comment


    • #3
      I encountered the same problem and I am using Xalan 2.7.0. But when I hit the debugger I noticed that Xerces from Sun's distribution of rt.jar is being used.

      Any suggestions how I can overcome this issue?

      Thanks,
      --Narasimha

      Comment

      Working...
      X