[jdom-interest] Parsing WSDL with JDOM? How?
Frank Cohen
fcohen at pushtotest.com
Tue Dec 28 10:25:53 PST 2004
Thanks PMN. Your tip did the trick. I appreciate your help.
For general knowledge of the JDOM community, here is the Jython script
to set-up Xerces 2.6 and JDOM 1.0 to build a Document object from a
WSDL definition:
from org.jdom.input import SAXBuilder
from java.io import File
builder = SAXBuilder( "org.apache.xerces.parsers.SAXParser", 1 )
builder.setFeature( "http://apache.org/xml/features/validation/schema",
1 )
wsdldefs = "http://schemas.xmlsoap.org/wsdl/
http://schemas.xmlsoap.org/wsdl/"
builder.setProperty(
"http://apache.org/xml/properties/schema/external-schemaLocation",
wsdldefs )
wsdl1 = "FedWire.wsdl"
wsdlfile = File( wsdl1 )
doc = builder.build( wsdlfile )
-Frank
On Dec 27, 2004, at 2:25 PM, Per Norrman wrote:
> Frank Cohen wrote:
>> wsdldefs = "http://www.xmethods.net/sd/eBayWatherService.wsdl " + \
>> "http://www.w3.org/2001/XMLSchema " + \
>> "http://schemas.xmlsoap.org/wsdl/soap " +\
>> "http://schemas.xmlsoap.org/wsdl "
>> builder.setProperty(
>> "http://apache.org/xml/properties/schema/external-schemaLocation",
>> wsdldefs )
>
> This property should be a list of namespace/URI *pairs*--youv'e just
> enumerated
> some of the namespaces used in the document.
>
> Instead:
>
> wsdldefs = "http://www.xmethods.net/sd/eBayWatherService.wsdl <ebay
> URI>" + \
> "http://www.w3.org/2001/XMLSchema <Schema URI>" + \
> "http://schemas.xmlsoap.org/wsdl/soap <SOAP URI>" +\
> "http://schemas.xmlsoap.org/wsdl <WSDL URI>"
>
> /pmn
>
>
> _______________________________________________
> To control your jdom-interest membership:
> http://www.jdom.org/mailman/options/jdom-interest/youraddr@yourhost.com
>
>
---
Frank Cohen, PushToTest, http://www.PushToTest.com, phone: 408 374 7426
Author of "Java Testing and Design: From Unit Tests to Automated Web
Tests"
from Prentice Hall, details at http://thebook.pushtotest.com
More information about the jdom-interest
mailing list