facebook

Error processing :XML document must have a top level element

  1. MyEclipse Archived
  2.  > 
  3. Web Services
Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #280904 Reply

    blueyPinky
    Member

    Hi there,

    I m very new to myEclipse..and e version i m using is 5.. and i have been using it to develop web services for my project..the server i am using is tomcat 4.0.

    but somehow I have this error after i have run it on the Web Services Explorer..

    The error message is:
    “XML document must have a top level element. Error processing resource ‘http://localhost:51852/wsexplorer/wsdl/soap_envelope…”

    does anyone know how to show it?

    Your help is greatly appreciated..

    Thanks

    #280915 Reply

    Loyal Water
    Member

    The issue is related to your XML document. You must close the tags that you have opened in your document. Please double check the document.

    #280959 Reply

    blueyPinky
    Member

    Hi Nipun,

    Thanks for your reply..

    Below is my XML document..But i have check and see no errors in it..all the tags has an open and close tags..i don’t see any errors..

    <?xml version=”1.0″ encoding=”ISO-8859-1″?>
    <!DOCTYPE web-app
    PUBLIC “-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN”
    http://java.sun.com/dtd/web-app_2_3.dtd”&gt;
    <web-app>
    <servlet>
    <servlet-name>XFireServlet</servlet-name> <servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet</servlet-class>
    <load-on-startup>0</load-on-startup>
    </servlet>
    <servlet-mapping>
    <servlet-name>XFireServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
    </web-app>

    #281139 Reply

    Riyad Kalla
    Member

    What is the contents of your services.xml file?

    Also have you really set Tomcat up to run on port 51852?

    #281175 Reply

    blueyPinky
    Member

    Hi rkalla,

    Thanks for your reply..

    The contents of my services.xml is as below:
    <beans xmlns=”http://xfire.codehaus.org/config/1.0″&gt;
    <service>
    <name>CSITWebService</name>
    <serviceClass>
    com.csit.webServices.ICSITWebService
    </serviceClass>
    <implementationClass>
    com.csit.webServices.CSITWebServiceImpl
    </implementationClass>
    <style>wrapped</style>
    <use>literal</use>
    <scope>application</scope>
    </service>
    </beans>

    But how do I set up my Tomcat to let it run on the port??
    Thanks for your help..

    #281201 Reply

    Riyad Kalla
    Member

    Pinky,
    I just re-read your inital post more closely, are you really trying to run this on Tomcat 4? I don’t believe Tomcat 4 supported the J2EE 1.3 spec, which is what you are trying to deploy to it.

    #281233 Reply

    blueyPinky
    Member

    Oh my goodness..So you mean i cannot deploy my project on Tomcat 4?

    Then which version i must use? Does Tomcat 5 support the J2EE 1.3 spec??

    Thanks for your reply..=)

    #281274 Reply

    Riyad Kalla
    Member

    NOTE: Tomcat supports a subset of the collections of specs that make up the “J2EE” and “Java EE” specs, so I’m using it in a very loose sense… you can’t take a full J2EE or Java EE compliant application and deploy it to Tomcat at all, but you can deploy a Web Application to Tomcat. I just wanted to clarify that.

    Yea Tomcat 5.0 supports J2EE 1.3 spec, Tomcat 5.5 supported the J2EE 1.4 spec, and Tomcat 6 supports the Java EE 5 spec… also worth noting is that MyEclipse 6 comes bundled with Tomcat 6 preconfigured and ready to run out of the box. So you can run your projects immediately using the “MyEclipse Tomcat Server” if you wanted.

    #281318 Reply

    blueyPinky
    Member

    I have just install Tomcat 5. But I still receive the same error:

    XML document must have a top level element. Error processing resource ‘http://localhost:58947/wsexplorer/wsdl/soap_envelope..

    Anymore advises?

    Thanks..

    #281337 Reply

    Riyad Kalla
    Member

    1. How are you accessing that URL? Inside a browser? The WS Explorer? If so, which mode are you using in the WS Explorer to access it?

    2. Where did you get that URL from?

    3. Are you launching Tomcat on port 58947?

    4. Can you paste your entire Tomcat startup log here.

    #281360 Reply

    blueyPinky
    Member

    1. I am accessing my web service project in the WS Explorer under the WSDL Main..

    2. I get the URL from an example of HelloWorld. But I got change the URL name to my project name my the web service name.

    3. How do I launch the Tomcat? After i configure it in myEclipse, I start the server and test my project.

    4. My Tomcat 5.0 startup log is:

    Feb 1, 2008 10:32:03 AM org.apache.coyote.http11.Http11AprProtocol init
    INFO: Initializing Coyote HTTP/1.1 on http-8080
    Feb 1, 2008 10:32:04 AM org.apache.coyote.ajp.AjpAprProtocol init
    INFO: Initializing Coyote AJP/1.3 on ajp-8009
    Feb 1, 2008 10:32:04 AM org.apache.catalina.startup.Catalina load
    INFO: Initialization processed in 719 ms
    Feb 1, 2008 10:32:04 AM org.apache.catalina.core.StandardService start
    INFO: Starting service Catalina
    Feb 1, 2008 10:32:04 AM org.apache.catalina.core.StandardEngine start
    INFO: Starting Servlet Engine: Apache Tomcat/5.5.25
    Feb 1, 2008 10:32:04 AM org.apache.catalina.core.StandardHost start
    INFO: XML validation disabled
    Feb 1, 2008 10:32:04 AM org.apache.catalina.core.ApplicationContext log
    INFO: org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL: http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL: http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL: http://jakarta.apache.org]]
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
    log4j:WARN Please initialize the log4j system properly.
    Feb 1, 2008 10:32:06 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Feb 1, 2008 10:32:06 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    Feb 1, 2008 10:32:06 AM org.apache.catalina.core.ApplicationContext log
    INFO: ContextListener: contextInitialized()
    Feb 1, 2008 10:32:06 AM org.apache.catalina.core.ApplicationContext log
    INFO: SessionListener: contextInitialized()
    log4j:WARN No appenders could be found for logger (org.apache.commons.digester.Digester.sax).
    log4j:WARN Please initialize the log4j system properly.
    Feb 1, 2008 10:32:08 AM org.apache.coyote.http11.Http11AprProtocol start
    INFO: Starting Coyote HTTP/1.1 on http-8080
    Feb 1, 2008 10:32:08 AM org.apache.coyote.ajp.AjpAprProtocol start
    INFO: Starting Coyote AJP/1.3 on ajp-8009
    Feb 1, 2008 10:32:08 AM org.apache.catalina.storeconfig.StoreLoader load
    INFO: Find registry server-registry.xml at classpath resource
    Feb 1, 2008 10:32:08 AM org.apache.catalina.startup.Catalina start
    INFO: Server startup in 4250 ms

    Thanks..

    #281384 Reply

    Riyad Kalla
    Member

    Bluey,
    Thank you for the information I asked for… the one very strange part here is I have no idea where you are getting this URL from:
    http://localhost:58947/wsexplorer/wsdl/soap_envelope..”

    The reason I say that is because:
    1. From your Tomcat log, it looks like Tomcat is running on the normal 8080 port, so your URL should start with:
    http://localhost:8080

    2. I’m not sure what the name or deployment context root for your project is, but you mentioned “HelloWorld”, so my guess is your project is deployed to:
    http://localhost:8080/HelloWorld

    3. Your web.xml file says that your services are bound to the /services/* path, which means all your services will be accessible under the root:
    http://localhost:8080/HelloWorld/services/

    4. Your services.xml file says your service name is CSITWebService, which means it’s URL will be:
    http://localhost:8080/HelloWorld/services/CSITWebService

    and to get WSDL from it, for the WS Explorer or for your own use in a browser, you would use the URL:
    http://localhost:8080/HelloWorld/services/CSITWebService?WSDL

    so given that, I hope you see why I’m totally confused as to where that other URL you are referring to comes from… if you open your project properties, and go to MyEclipse > Web, the 2nd text box “Web Context-root” should tell you which value you should use to access your web app. In the example URL above I assumed it was “/HelloWorld”, but you will want to double check that value to see what it is set to on your end.

    #281439 Reply

    blueyPinky
    Member

    But the URL that I have been using is the same as what you have reply in your earlier message.

    What you have given me:
    http://localhost:8080/HelloWorld/services/CSITWebService?WSDL

    The URL that i have been using:
    http://localhost:8080/CSIT/services/CSITWebService?WSDL

    where CSIT is my project name..

    After i have test it, the first error that occur is ‘The SOAP response failed schema validation. Please switch to the source view for the SOAP response in XML format. ‘

    After I switch to source view, the error in the SOAP Response Envelope is ‘XML document must have a top level element. Error processing resource ‘http://localhost:49360/wsexplorer/wsdl/soap_envelope…&#8217;

    And i found something where there is someone who say maybe can try using (https://tcpmon.dev.java.net/ ). I have download it, but i don not know how to use it.

    #281440 Reply

    blueyPinky
    Member

    And this is my web.xml
    <?xml version=”1.0″ encoding=”ISO-8859-1″?>
    <web-app xmlns=”http://java.sun.com/xml/ns/j2ee&#8221;
    xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance&#8221;
    xsi:schemaLocation=”http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd&#8221;
    version=”2.4″>
    <servlet>
    <servlet-name>XFireServlet</servlet-name>
    <servlet-class>org.codehaus.xfire.transport.http.XFireConfigurableServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>

    </servlet>
    <servlet-mapping>
    <servlet-name>XFireServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
    </servlet-mapping>
    </web-app>

    and my SOAP Request Envelope is:
    <?xml version=”1.0″ encoding=”UTF-8″ ?>
    – <soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:q0=”http://webServices.csit.com&#8221; xmlns:xsd=”http://www.w3.org/2001/XMLSchema&#8221; xmlns:xsi=”http://www.w3.org/2001/XMLSchema-instance”&gt;
    – <soapenv:Body>
    <q0:getSec />
    </soapenv:Body>
    </soapenv:Envelope>

    #281461 Reply

    Riyad Kalla
    Member

    blueyPinky,
    I’m not sure what is going on, but can you export this project to an Archive for me (File > Export > Archive) and email it to support@genuitec.com ATTN Riyad, with a link to this thread for reference? I’ll see if I can reproduce the problem on my end.

Viewing 15 posts - 1 through 15 (of 25 total)
Reply To: Error processing :XML document must have a top level element

You must be logged in to post in the forum log in