XFire

Problem calling methods from WSDL

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.1.2
  • Fix Version/s: 1.2
  • Component/s: None
  • Labels:
    None
  • Environment:
    Fedora Core 4, Apache Tomcat 5.5.17
  • Number of attachments :
    0

Description

I'm having trouble accessing a specific wsdl in XFire 1.1.2:
http://openskyquery.net/Sky/SkyPortal/SkyPortal.asmx?WSDL

Firstly, when I attempt to use the generator I receive the following error:

  • Error generating JAXB classes: src-resolve: Cannot resolve the name 's:schema' to a 'element declaration' component. at -1,-1 in http://openskyquery.net/Sky/SkyPortal/SkyPortal.asmx?WSDL#types?schema1
    java.lang.NullPointerException
    at java.io.File.<init>(File.java:234)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport$RelativeEntityResolver.resolveEntity(JAXBSchemaSupport.java:195)
    at com.sun.tools.xjc.ModelLoader$1.resolveEntity(ModelLoader.java:413)
    at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.resolveRelativeURL(NGCCRuntimeEx.java:151)
    at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.importSchema(NGCCRuntimeEx.java:188)
    at com.sun.xml.xsom.impl.parser.state.importDecl.action0(importDecl.java:45)
    at com.sun.xml.xsom.impl.parser.state.importDecl.leaveElement(importDecl.java:143)
    at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:275)
    at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
    at com.sun.tools.xjc.reader.ExtensionBindingChecker.endElement(ExtensionBindingChecker.java:275)
    at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
    at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
    at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.endElement(CustomizationContextChecker.java:178)
    at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
    at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.endElement(DOMForestScanner.java:119)
    at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:235)
    at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
    at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
    at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:107)
    at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:73)
    at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:81)
    at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:83)
    at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:237)
    at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:284)
    at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:87)
    at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:147)
    at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:136)
    at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:485)
    at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:197)
    at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:66)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.initialize(JAXBSchemaSupport.java:100)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:115)
    at org.codehaus.xfire.gen.WsGen.main(WsGen.java:115)
    Exception in thread "main" java.lang.NullPointerException
    at org.codehaus.xfire.gen.WsGen.main(WsGen.java:119)
    Caused by: java.lang.NullPointerException
    at java.io.File.<init>(File.java:234)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport$RelativeEntityResolver.resolveEntity(JAXBSchemaSupport.java:195)
    at com.sun.tools.xjc.ModelLoader$1.resolveEntity(ModelLoader.java:413)
    at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.resolveRelativeURL(NGCCRuntimeEx.java:151)
    at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.importSchema(NGCCRuntimeEx.java:188)
    at com.sun.xml.xsom.impl.parser.state.importDecl.action0(importDecl.java:45)
    at com.sun.xml.xsom.impl.parser.state.importDecl.leaveElement(importDecl.java:143)
    at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:275)
    at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
    at com.sun.tools.xjc.reader.ExtensionBindingChecker.endElement(ExtensionBindingChecker.java:275)
    at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
    at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
    at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.endElement(CustomizationContextChecker.java:178)
    at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
    at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.endElement(DOMForestScanner.java:119)
    at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:235)
    at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
    at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
    at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:107)
    at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:73)
    at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:81)
    at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:83)
    at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:237)
    at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:284)
    at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:87)
    at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:147)
    at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:136)
    at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:485)
    at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:197)
    at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:66)
    at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.initialize(JAXBSchemaSupport.java:100)
    at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:115)
    at org.codehaus.xfire.gen.WsGen.main(WsGen.java:115)
      • Nested Exception —
        java.lang.NullPointerException
        at java.io.File.<init>(File.java:234)
        at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport$RelativeEntityResolver.resolveEntity(JAXBSchemaSupport.java:195)
        at com.sun.tools.xjc.ModelLoader$1.resolveEntity(ModelLoader.java:413)
        at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.resolveRelativeURL(NGCCRuntimeEx.java:151)
        at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.importSchema(NGCCRuntimeEx.java:188)
        at com.sun.xml.xsom.impl.parser.state.importDecl.action0(importDecl.java:45)
        at com.sun.xml.xsom.impl.parser.state.importDecl.leaveElement(importDecl.java:143)
        at com.sun.xml.xsom.impl.parser.state.NGCCRuntime.endElement(NGCCRuntime.java:275)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
        at com.sun.tools.xjc.reader.ExtensionBindingChecker.endElement(ExtensionBindingChecker.java:275)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
        at com.sun.tools.xjc.reader.xmlschema.parser.CustomizationContextChecker.endElement(CustomizationContextChecker.java:178)
        at org.xml.sax.helpers.XMLFilterImpl.endElement(XMLFilterImpl.java:546)
        at com.sun.tools.xjc.reader.internalizer.DOMForestScanner$LocationResolver.endElement(DOMForestScanner.java:119)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:235)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:261)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:230)
        at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:107)
        at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:73)
        at com.sun.tools.xjc.reader.internalizer.DOMForestScanner.scan(DOMForestScanner.java:81)
        at com.sun.tools.xjc.reader.internalizer.DOMForestParser.parse(DOMForestParser.java:83)
        at com.sun.tools.xjc.ModelLoader$XMLSchemaParser.parse(ModelLoader.java:237)
        at com.sun.xml.xsom.impl.parser.NGCCRuntimeEx.parseEntity(NGCCRuntimeEx.java:284)
        at com.sun.xml.xsom.impl.parser.ParserContext.parse(ParserContext.java:87)
        at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:147)
        at com.sun.xml.xsom.parser.XSOMParser.parse(XSOMParser.java:136)
        at com.sun.tools.xjc.ModelLoader.createXSOM(ModelLoader.java:485)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:197)
        at com.sun.tools.xjc.api.impl.s2j.SchemaCompilerImpl.bind(SchemaCompilerImpl.java:66)
        at org.codehaus.xfire.gen.jaxb.JAXBSchemaSupport.initialize(JAXBSchemaSupport.java:100)
        at org.codehaus.xfire.gen.Wsdl11Generator.generate(Wsdl11Generator.java:115)
        at org.codehaus.xfire.gen.WsGen.main(WsGen.java:115)

Second, I've attempted to use the dynamic client which is creating malformed SOAP messages because parameters are not being wrapped correctly. For example, a call to the method "SubmitDistributedQuery" should look like this:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<RunIDHeader xmlns="SkyPortal.ivoa.net">
<IVOA_ID>string</IVOA_ID>
<ID>string</ID>
</RunIDHeader>
</soap:Header>
<soap:Body>
<SubmitDistributedQuery xmlns="SkyPortal.ivoa.net">
<qry>string</qry>
<outputType>string</outputType>
</SubmitDistributedQuery>
</soap:Body>
</soap:Envelope>

But I get this:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soap:Header>
<RunIDHeader xmlns="SkyPortal.ivoa.net" ns1:type="ns1:string" xmlns:ns1="http://www.w3.org/2001/XMLSchema-instance">SELECT TOP 10 o.ra, o.dec, o.modelMag_r
FROM SDSSDR3:PhotoPrimary o
WHERE REGION('CIRCLE J2000 0.27361752 14.00627188 60')
AND o.modelMag_r > 16.0 AND o.modelMag_r < 19.0
ORDER BY o.modelMag_r</RunIDHeader>
</soap:Header>
<soap:Body>
<SubmitDistributedQuery xmlns="SkyPortal.ivoa.net" xsi:type="xsd:string">SELECT TOP 10 o.ra, o.dec, o.modelMag_r
FROM SDSSDR3:PhotoPrimary o
WHERE REGION('CIRCLE J2000 0.27361752 14.00627188 60')
AND o.modelMag_r > 16.0 AND o.modelMag_r < 19.0
ORDER BY o.modelMag_r</SubmitDistributedQuery>
</soap:Body>
</soap:Envelope>

Notice how the query string is not wrapped under <qry/> and is duplicated in the header where it should not be. Also, the second parameter <outputType/> which should be the string "VOTABLE" does not appear anywhere at all. For a similar example, the same problem occurs when calling "GetColumns" with "sdss" and "photoprimary" (however in that instance there is no header).

The code for the dynamic client is just:
Client client = new Client(new URL("the wsdl"));
Object[] results = client.invoke("GetColumns", new Object[] {"sdss", "photoprimary"});

Finally, any clients I try and write on my own cannot communicate with the service because the SOAP action is not being filled out and the webservice refuses to allow a blank SOAP action.

This issue is quite important to me, so thank you for any and all help you can provide!

Activity

Hide
Fabian Linz added a comment -

I had a similar exception here. To get around the problem I removed all imports inside my schemas. Although the wsdl was not WS-I compliant any more the wsdl to java generation worked then.

I also changed your wsdl accordingly. I do not get the exception outlined above anymore but it still does not work. There are some other issues with the wsdl here. Perhaps I find the time to look at the new exception later, but the exception outlined above really seems to be caused by the imports inside the schemas.

Show
Fabian Linz added a comment - I had a similar exception here. To get around the problem I removed all imports inside my schemas. Although the wsdl was not WS-I compliant any more the wsdl to java generation worked then. I also changed your wsdl accordingly. I do not get the exception outlined above anymore but it still does not work. There are some other issues with the wsdl here. Perhaps I find the time to look at the new exception later, but the exception outlined above really seems to be caused by the imports inside the schemas.
Hide
Fabian Linz added a comment -

Small addion to my last comment:
The imports I removed from the schema are imports that are used to reference namespaces of schemas inside the same wsdl, so no location is provided here. Maybe that is the problem?

Show
Fabian Linz added a comment - Small addion to my last comment: The imports I removed from the schema are imports that are used to reference namespaces of schemas inside the same wsdl, so no location is provided here. Maybe that is the problem?
Hide
Dan Diephouse added a comment -

Well I fixed the NPE, but JAXB still seems to be having a problem with the imports for some reason. I've pinged the JAXB guys and I should have a response by Monday I would think. Will keep you updated!

Show
Dan Diephouse added a comment - Well I fixed the NPE, but JAXB still seems to be having a problem with the imports for some reason. I've pinged the JAXB guys and I should have a response by Monday I would think. Will keep you updated!
Hide
Dan Diephouse added a comment -

After talking to the JAXB guys, it seems this is a JAXB bug. The JAX-WS RI has the same exact problem. Working with them to come up with a solution.

Show
Dan Diephouse added a comment - After talking to the JAXB guys, it seems this is a JAXB bug. The JAX-WS RI has the same exact problem. Working with them to come up with a solution.
Hide
Dan Diephouse added a comment -

Koshuke fixed the bug in JAXB today. You can get a new nightly build which will incorporate the fix from here:

https://jaxb.dev.java.net/servlets/ProjectDocumentList?folderID=3074&expandFolder=3074&folderID=460

That probably won't be updated until later tonight. A build with the XFire side of things fixed is here:

http://snapshots.repository.codehaus.org/org/codehaus/xfire/xfire-all/1.2-SNAPSHOT/xfire-all-1.2-20060816.210303-7.jar

Show
Dan Diephouse added a comment - Koshuke fixed the bug in JAXB today. You can get a new nightly build which will incorporate the fix from here: https://jaxb.dev.java.net/servlets/ProjectDocumentList?folderID=3074&expandFolder=3074&folderID=460 That probably won't be updated until later tonight. A build with the XFire side of things fixed is here: http://snapshots.repository.codehaus.org/org/codehaus/xfire/xfire-all/1.2-SNAPSHOT/xfire-all-1.2-20060816.210303-7.jar

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: