Results 1 to 3 of 3

Thread: problem with sending a message

  1. #1
    Join Date
    Apr 2008
    Posts
    21

    Default 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. #2
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Make sure you use Xalan 2.7.0.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #3
    Join Date
    Oct 2009
    Posts
    11

    Default

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •