Getting "Unbalanced ELEMENT got:body expected:h1" errors -- help! - Weblogic

This is a discussion on Getting "Unbalanced ELEMENT got:body expected:h1" errors -- help! - Weblogic ; I've created a simple "HelloWorld" web service, and a matching client. The= WSDL appears correct (I have validated it on some web-based XML validators= ), and I can ask the web service for the WSDL, which it returns properly. However, ...

+ Reply to Thread
Results 1 to 3 of 3

Getting "Unbalanced ELEMENT got:body expected:h1" errors -- help!

  1. Default Getting "Unbalanced ELEMENT got:body expected:h1" errors -- help!

    I've created a simple "HelloWorld" web service, and a matching client. The=
    WSDL appears correct (I have validated it on some web-based XML validators=
    ), and I can ask the web service for the WSDL, which it returns properly.

    However, when I make my simple call to the service from the client, I get t=
    he below stacktrace. Can anyone suggest to me what might be causing this? =
    I'm at a loss right now about it; namespace conflicts, perhaps?

    - Tim

    ------------------------------------------

    Error at Line:1, token:[CLOSETAGBEGIN]Unbalanced ELEMENT got:body expected:=
    h1
    =09at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:37=
    4)
    =09at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.jav=
    a:197)
    =09at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:2=
    41)
    =09at weblogic.xml.domimpl.Loader.load(Loader.java:112)
    =09at weblogic.xml.domimpl.Loader.load(Loader.java:73)
    =09at weblogic.xml.domimpl.Loader.load(Loader.java:35)
    =09at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.ja=
    va:149)
    =09at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:56)
    =09at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)
    =09at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:361)
    =09at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:50)
    =09at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:=
    437)
    =09at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:108)
    =09at com.on24.webservices.clients.helloworld.HelloWorldService_Impl.<init>=
    (Unknown Source)
    =09at com.on24.webservices.clients.helloworld.HelloWorldService_Impl.<init>=
    (Unknown Source)
    =09at com.on24.webservices.clients.helloworld.HelloWorldTestClient.main(Hel=
    loWorldTestClient.java:11)
    javax.xml.rpc.ServiceException: Failed to parse WSDL http://localhost.on24.=
    com:5001/wstest/HelloWorldService weblogic.wsee.wsdl.WsdlException: Failed =
    to read wsdl file from url due to -- java.io.IOException: Unbalanced ELEMEN=
    T got:body expected:h1
    =09at weblogic.wsee.jaxrpc.ServiceImpl.throwServiceException(ServiceImpl.ja=
    va:163)
    =09at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:=
    446)
    =09at weblogic.wsee.jaxrpc.ServiceImpl.<init>(ServiceImpl.java:108)
    =09at com.on24.webservices.clients.helloworld.HelloWorldService_Impl.<init>=
    (Unknown Source)
    =09at com.on24.webservices.clients.helloworld.HelloWorldService_Impl.<init>=
    (Unknown Source)
    =09at com.on24.webservices.clients.helloworld.HelloWorldTestClient.main(Hel=
    loWorldTestClient.java:11)
    Caused by: weblogic.wsee.wsdl.WsdlException: Failed to read wsdl file from =
    url due to -- java.io.IOException: Unbalanced ELEMENT got:body expected:h1
    =09at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:313)
    =09at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:361)
    =09at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:50)
    =09at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:=
    437)
    =09... 4 more
    Caused by: java.io.IOException: Unbalanced ELEMENT got:body expected:h1
    =09at weblogic.xml.domimpl.Loader.load(Loader.java:38)
    =09at weblogic.wsee.util.dom.DOMParser.getWebLogicDocumentImpl(DOMParser.ja=
    va:149)
    =09at weblogic.wsee.util.dom.DOMParser.getDocument(DOMParser.java:56)
    =09at weblogic.wsee.wsdl.WsdlReader.getDocument(WsdlReader.java:311)
    =09... 7 more
    Caused by: javax.xml.stream.XMLStreamException: Unbalanced ELEMENT got:body=
    expected:h1
    =09at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.jav=
    a:208)
    =09at weblogic.xml.stax.XMLStreamReaderBase.next(XMLStreamReaderBase.java:2=
    41)
    =09at weblogic.xml.domimpl.Loader.load(Loader.java:112)
    =09at weblogic.xml.domimpl.Loader.load(Loader.java:73)
    =09at weblogic.xml.domimpl.Loader.load(Loader.java:35)
    =09... 10 more
    Caused by: Error at Line:1, token:[CLOSETAGBEGIN]Unbalanced ELEMENT got:bod=
    y expected:h1
    =09at weblogic.xml.babel.baseparser.BaseParser.parseSome(BaseParser.java:37=
    4)
    =09at weblogic.xml.stax.XMLStreamReaderBase.advance(XMLStreamReaderBase.jav=
    a:197)
    =09... 14 more

  2. Default Re: Getting "Unbalanced ELEMENT got:body expected:h1" errors -- help!

    I am getting the same error. Did you resolve this?

  3. Default Re: Getting "Unbalanced ELEMENT got:body expected:h1" errors -- help!

    This error occurs when you pass the WSDL URL as you are creating the servic=
    e object:

    SimpleImplService service =3D new SimpleImplService_Impl(<endPointURL> + "?=
    WSDL");

    And, you also define the ENDPOINT_ADDRESS_PROPERTY property on the Stub, as=
    shown below

    ((Stub)port)._setProperty(Stub.ENDPOINT_ADDRESS_PROPERTY, <endPointURL>);

    If you remove the endPointURL from the service object create statement, you=
    should remove this error:

    SimpleImplService service =3D new SimpleImplService_Impl();

    Scott J.

+ Reply to Thread