facebook

WS-I: (BP2102) error?

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

    wagles
    Member

    In my WSDL, if I import a schema as below:

            <xsd:import namespace="http://www.xyz.com/query_response"
                     schemaLocation="http://www.xyzhost.com/query-response.xsd">
    

    I get the following error, and code generation fails. I am generating the code using the New Web Service wizard, MyEclipse 5.5 GA. I don’t believe I should be getting this error.

    WS-I: (BP2102) An XML schema import element references something other than an XML schema definition: the referenced element does not have “schema” from XML namespace “http://www.w3.org/2001/XMLSchema&#8221; as root element.

    This happens irrespective of whether I set project preferences to ‘ignore compliance’ for WS-I or not.

    If I copy this external schema to my local folder, as shown below, the error goes away and code generation is successful.

           <xsd:import namespace="http://www.xyz.com/query_response"
                     schemaLocation="query-response.xsd">
    

    I do need to reference the schema using http, and don’t want to copy to my local folder.

    Any idea how MyEclipse is doing WS-I compliance and why I am getting this error?

    #272483 Reply

    wagles
    Member

    Is there some way to enable logging etc. during WSDL validation, so I can see further details on what is causing this problem? I am hoping I can enable logging and see the possible output being generated as I explicitly run ‘validation’ on the WSDL.

    Please let me know if anybody has any suggestions on possible workarounds OR how I can proceed with analyzing this problem.

    Thank you

    #272538 Reply

    Riyad Kalla
    Member

    wagles,
    I’ve asked someone from the WS team to have a look at this issue.

    #272605 Reply

    wagles
    Member

    In general, is there some way to turn logging on, or get a better view into what the various plugins are doing beyond what is visible through the user interface?

    I am looking into some way to get at the root cause of the error rather than the high level error. Clearly the high level error is not correct and is probably happening due to something deeper down.

    #272610 Reply

    wagles
    Member

    Another update… the MyEclipse UI based tooling does not seem to be very robust.

    1) Discovered that the schemas that were being accessed using http – the http response was not returning the content-type. So I was getting the above error. Discovered the error by using the XFire’s eclipse plugin which reported the correct error.

    2) Once I had the http response return the content-type, there were still errors. Eventually, used Xfire’s ant task which reported additional errors while doing the wsdl2java. Had to fix that customizing the bindings (with JAXB2).

    None of these errors were detected/displayed by the MyEclipse UI.

    So now I am at a stage where my WSDL & schemas are being compiled. But the UI in MyEclipse is still reporting errors in the “Problems” tab which obviously are not errors because the WSDL is valid and is compiling correctly.

    Here is a sample error:
    Referenced file contains errors (http://xyz/abc/included-schema). For more information, right click on the message and select “Show Details…”

    This included-schema is rather deeply embedded in the hierarchy of schema inclusion, i.e. there is a top level wsdl -> interface wsdl -> top level schema -> next level schema -> included-schema. This shows the level of ‘included-schema’ in the hierarchy which is reporting the error. Besides the nesting of schema, the schema URLs also use URL redirection to point to the correct schema. Now I am not sure if all these factors are contributing to these errors being displayed in the Problems tab.

    Also, there is no “Show Details…” option available at all to provide more information.

    Additionally, there is no way to provide external bindings customizations using the UI.

    #272760 Reply

    Brian Fernandes
    Moderator

    wagles,

    Regarding the errors you mention were not reported, did you ever check the eclipse Error Log view? I am currently reviewing the generation process in MyEclipse to see if crucial errors are not being reported at all or if they are only being logged in the Error Log view without the user being adequately notified.

    Additionally, there is no way to provide external bindings customizations using the UI.

    Accepted, we already have this filed as a feature request, I’ll try and up the priority.

    If you have the time, it would help us a great deal if you could create some sort of representative schema (or the original schema itself, but I guess that will not be possible) which demonstrates most of the problems you mentioned and send it to support@genuitec.com ATTN Brian.

    I appreciate the time you have taken in cataloging your experience in detail, we’ll do our best to improve the experience.

    #272779 Reply

    wagles
    Member

    Brian,

    Thanks for your response.

    1) I think you’ll be able to recreate the error due to missing content-type for a schema imported using http. I have in the meanwhile worked with the external agency to have them return the appropriate content-type for the imported schemas, so it’ll hard for me to retest/recreate that scenario.

    2) This won’t look very nice on my part… but unfortunately I am not quire sure if I can or cannot share the original schema. I also am not quite sure who to contact to get that answered authoritatively. So I’ll take the less risky approach of not sharing the schema at this point. In the meanwhile I’ll try to determine if I can share the schema with you, and if I can, I’ll send it to the contact info you have provided. Even recreating the scenario and sharing the schemas with you will be hard and time consuming due to all the http redirections and schema inclusion hierarchy in place.

    3) I explicitly ran the validation on the WSDL again.. nothing shows up in the Error Log view, though there are some other errors which don’t seem to be related to the WSDL validation based on the timestamp and the content of those error messages. The WSDL validation error though continues to get reported on the WSDL file under the “Errors” in the Problems View.

    Thank you

    #272781 Reply

    Brian Fernandes
    Moderator

    wagles,

    I completely understand you not being able to share the the schema, this is why I asked for a representative schema. Again, I do understand how this is also going to be difficult to recreate because of all the redirection; no problems with that.

    2) Once I had the http response return the content-type, there were still errors. Eventually, used Xfire’s ant task which reported additional errors while doing the wsdl2java. Had to fix that customizing the bindings (with JAXB2).

    I’m quite interested in these errors, it seems like these should have been reported by ME and I don’t think they had anything to do with the redirection since you mention binding issues. If you remember, can you tell me what errors were reported by the ant task?

    3) I explicitly ran the validation on the WSDL again.. nothing shows up in the Error Log view, though there are some other errors which don’t seem to be related to the WSDL validation based on the timestamp and the content of those error messages. The WSDL validation error though continues to get reported on the WSDL file under the “Errors” in the Problems View.

    I forgot to address this in my last reply – I was talking about errors in the log after you attempt to generate, not just validate. Do try that and let me know, though if you have fixed the problem now and generation works, nothing might show up. right now.

    To further explain the validation process – the validator in the wizard always uses the strictest settings, irrespective of the WS-I settings you might make in your project. This is because the WSDL file must be passed to the XFire generator which does complain about non compliant WSDL at times. If you open the same WSDL file in the WSDL editor, then the WS-I compliance settings should affect the validation process.

    #272790 Reply

    wagles
    Member

    Hi Brian,

    I just reran the Web Service generation flow using MyEclipse.

    Here is what happens:
    1. During the “new webservice” task, there is a WSDL validation step that comes in. That still fails with errors referring to the included schemas, which errors such as:

    WSDL file has validation errors. Code generation may fail
    WSDL URL: <the wsdl file name here>

    Referenced file contains errors (http://<the schema namespace here>).

    This is not quite correct because I believe the schema is valid. If it is not, there is no additional information displayed either on the user interface or in the Error Log view. So now my wsdl file has a perpetual little red x in the Package view, and the Problems view shows the error like above without any further details of what is wrong with the validation. The Error Log also does not show anything relevant to validation.

    2) But I can still proceed even if the validation fails. When myeclipse goes to the code generation phase, I can see the errors that I earlier couldn’t see, not that you have told me of the Error Log view trick. So if someone doesn’t think about going to the Error Log, the normal UI just displays an ordinary failure message.

    Now in the Error Log, I get a bunch of errors with the first one like:

    A class/interface with the same name “<the package>.<the class>” is already in use. Use a class customization to resolve this conflict.
    org.xml.sax.SAXParseException: A class/interface with the same name “<the package>.<the class>” is already in use. Use a class customization to resolve this conflict.
    at com.sun.tools.xjc.util.CodeModelClassFactory.createClass(CodeModelClassFactory.java:91)
    at com.sun.tools.xjc.util.CodeModelClassFactory.createClass(CodeModelClassFactory.java:60)
    at com.sun.tools.xjc.generator.bean.ImplStructureStrategy$1.createClasses(ImplStructureStrategy.java:42)
    at com.sun.tools.xjc.generator.bean.BeanGenerator.generateClassDef(BeanGenerator.java:371)
    at com.sun.tools.xjc.generator.bean.BeanGenerator.getClazz(BeanGenerator.java:403)
    at com.sun.tools.xjc.generator.bean.BeanGenerator.<init>(BeanGenerator.java:178)
    at com.sun.tools.xjc.generator.bean.BeanGenerator.generate(BeanGenerator.java:151)
    at com.sun.tools.xjc.model.Model.generateCode(Model.java:226)
    at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:211)
    at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:66)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.initialize(JAXBSchemaSupport.java:105)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:154)
    at com.genuitec.eclipse.ws.xfire.generator.WSGenJob.run(WSGenJob.java:209)
    at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)

    Now when I used the XFire ant task, I could specify the class customization and that fixed the problem.

    #272946 Reply

    Brian Fernandes
    Moderator

    1. During the “new webservice” task, there is a WSDL validation step that comes in. That still fails with errors referring to the included schemas

    MyEclipse 6 will have a better WSDL validator which will hopefully correct this issue.

    2) But I can still proceed even if the validation fails. When myeclipse goes to the code generation phase, I can see the errors that I earlier couldn’t see, not that you have told me of the Error Log view trick. So if someone doesn’t think about going to the Error Log, the normal UI just displays an ordinary failure message.

    Agreed, these errors must be directly reported to the user; we’ll try to improve this in a future release.

    Now when I used the XFire ant task, I could specify the class customization and that fixed the problem.

    I’ve increased the priority of this PR, the ability to specify custom binding files might not make it to the very next release but certainly the one after that.

    We appreciate your support, thanks.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: WS-I: (BP2102) error?

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