Announcement Announcement Module
Collapse
No announcement yet.
parser errors when attempting to include a response Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • parser errors when attempting to include a response

    Hi, I have a web service I based on the tutorial, except it has a response. I'm not sure how to construct the response, but I figured it should just be an Element of the xml that I want inside the soap body. However, I get this exception:
    Code:
         [java] XML-22900: (Fatal Error) An internal error condition occurred.
         [java] 2007-08-07 09:29:23,860 [cs] WARN [org.springframework.ws.soap.server.SoapMessageDispatcher] - Endpoint invocation resulted in exception - responding with SOAP Fault
         [java] javax.xml.transform.TransformerException: XML-22900: (Fatal Error) An internal error condition occurred.
         [java] at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:881)
         [java] at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:477)
         [java] at org.springframework.xml.transform.TransformerObjectSupport.transform(TransformerObjectSupport.java:75)
         [java] at org.springframework.ws.server.endpoint.adapter.PayloadEndpointAdapter.invoke(PayloadEndpointAdapter.java:50)
         [java] at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:210)
         [java] at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:157)
         [java] at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:86)
         [java] at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:56)
         [java] at org.springframework.ws.transport.http.MessageDispatcherServlet.doService(MessageDispatcherServlet.java:157)
    I don't understand the exception, but I tried to wrap my response in a soap envelope and now it runs cleanly. But my result doesn't look right - I've got two soap envelopes now (see below). Any suggestions?
    Code:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
       <env:Header/>
       <env:Body>
          <Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
             <sel:SSNInfoResult xmlns:sel="http://adpselect.com/select/schemas">
                <sel:ssn>000549819</sel:ssn>
                <state xmlns="">U.S.A</state>
                <isValid xmlns="">true</isValid>
             </sel:SSNInfoResult>
          </Envelope>
       </env:Body>
    </env:Envelope>
    Here's my invoker code:
    Code:
    	protected Element invokeInternal(Element ssnInfoRequest) throws Exception {
    		  log.debug("invokeInternal");
          String ssn = ssnExpression.valueOf(ssnInfoRequest);
    
          SSNInfo ssnInfo = candidateService.getSSNInfo(ssn, null);
    		  log.debug("ran getSSNInfo");
    
    
          Element root = new Element("Envelope", "http://schemas.xmlsoap.org/soap/envelope/");
          Namespace ns = Namespace.getNamespace("sel",
          		"http://adpselect.com/select/schemas");
          root.addNamespaceDeclaration(ns);
    		  Element el = new Element("SSNInfoResult",ns);
           ... add a bunch of elements to el...
           root.addContent(el);
           return root;

  • #2
    You definitely don't want to create a SOAP envelope in your payload code. Spring-WS will wrap your response payload with the envelope for you.

    Regarding the XML exception: it seems like this is an Oracle-specific XML error. I tried googling for the error code, and I got some people who ran into the same thing: http://www.google.com/search?q=XML-22900. You might want to try some of the suggestions presented there.

    Comment


    • #3
      Oracle parser wants two soap envelopes

      I was able to get past this problem by using Apache's XML Parsers instead of Oracles. This page has instructions for switching (for OC4J 10.1.3): http://www.oracle.com/technology/tec..._to/index.html.

      Comment

      Working...
      X