TargetNameSpace for a ComplexType

"Isabelle Sampaio" <[email protected]>
Newsgroups gmane.comp.apache.webservices.wsif.devel
Message-ID <[email protected]>
Hello everyone,

I'm new and I'm not sure if someone has asked this before, if that's the
case, sorry, guys :)

Anyway, I'm trying to invoke a service that returns a complex type (let's
say, "blah"), and as you must know it's necessary to map the type:

QName qn = new QName( targetNS, className);
service.mapType( qn, Class.forName(classLocation));

Currently, I'm presuming the user of my class knows the targetNS for that
complexType, but unfortonately, that's not possible. Does anyone knows how
to get the targetnamespace for a complex type? I know I can get the
targetnamespace using this command:
(presuming I've read the wsdl already)

System.out.println(def.getNamespaces());
In my sample, the result would be:
{impl=http://cit05:8080/axis/services/ServerFileTrans,
intf=http://cit05:8080/axis/services/ServerFileTrans,
wsdlsoap=http://schemas.xmlsoap.org/wsdl/soap/,
apachesoap=http://xml.apache.org/xml-soap,
soapenc=http://schemas.xmlsoap.org/soap/encoding/,
xsd=http://www.w3.org/2001/XMLSchema,
wsdl=http://schemas.xmlsoap.org/wsdl/,
tns1=urn:ServerFileTrans, =http://schemas.xmlsoap.org/wsdl/}

The targetnamespace I need is named "tns1" in this case. But that's not a
standart, I mean, it could be different. (I've seen "targetnamespaces"
with different names in other samples)

Is there any other way to get the TargetNameSpace for a ComplexType,
reading it from the WSDL? Could anyone please help me??

Thanks and sorry about my english :(

Isabelle Sampaio
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.