You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by James Moore <mo...@ISI.EDU> on 2005/07/29 00:03:15 UTC
WSDL of standard architecture XSDs and using 3rd party implementations
in the WSDL2Java Web Service Generation Process
Hello all,
I was hoping someone might be able to answer a question about Web
Service generation using Axis WSDL2Java. Here is my situation:
I've created a web service (wsdl) that imports a couple of schemas. One
of the imported xsd performs its own import of the "XML Digital
Signature schema". The <element> used in a <message> of my WSDL is
defined in the imported xsd using a <complexType>. This complex type
has a <sequence> of elements. One of these elements is a <ds:Signature>
where the "ds" namespace is "http://www.w3.org/200/09/xmldsig#" (aka the
XML Digital Signature architecture). Here is where my question begins....
When I generate the web service using WSDL2Java all the elements of the
"ds" namespace are generated.
What I'd like to do is take one of the "Publically Available Code,
Tookits or SDKs" from "http://www.w3.org/Signature", include it in my
project, and use that as the implementation for the <ds:Signature>
element of the <complexType> <sequence>.
With that said, I'm having a hard time finding any information on Google
regarding this matter. Does anyone have some information, pointers,
tips, etc, etc... about how to do this??
Below is an example WSDL and XSD that illustrates the basic concept of
what i'm explaining above. Here there is a WSDL file that includes a
schema with a namespace "http://myschema.com". This schema then defines
a <complexType> that is constructed using a <sequence> of elements. One
of the elements in the sequence is the "ds:Signature" element. So here
the import of the "ds" namespace would end up generating all the java
classes for the "XML Digital Signature" schema because the namespace and
XSD is imported in the "http://myschema.com" XSD. This is where I'd
like to be able to include the third party "XML Digital Signature"
implementation jar into the WSDL2Java generation process, thus
eliminating the generation of the "ds" files and replacing all
references to the "ds:Signature" with the package/class of the third
party implementation.
Any help would be greatly appreciated. Thanks for your time in
advance. Hope to hear from the AXIS community members soon.
Example WSDL snippet (not the real one but given for a depiction):
<wsdl:definitions
targetnamespace="http://mywsdl.com"
xmlns:tns="http://mywsdl.com"
xmlns:imdschema="http://myschema.com"
...
>
<wsdl:types>
<xsd:schema
....
<xsd:import namespace="http://myschema.com"
schemaLocaiton="myschema.xsd"/>
>
</xsd:schema>
</wsdl:types>
<wsdl:message name="myType">
<wsdl:part element="imdschema:myType" name="myType"/>
</wsdl:message>
....
</wsd:definitions>
Example XSD snippet:
<?xml version....?>
<schema
targetNamespace="http://myschema.com"
xmlns:tns="http://myschema.com"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
....
>
<import namespace="http://www.w3.org/2000/09/xmldsig#"
schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd/>
<complexType name="myType">
<sequence>
<element ref="ds"Signature minOccurs="0"/>
<element ref .....
<element ref .....
.....
</complexType>
....
</wsdl:definitions>
--
__________________________________________________________________________________
James J. Moore
IBM Systems Group
Advanced Systems Infrastructure Development
Fellowship Assignee
USC/Information Sciences Institute
Center for Grid Technologies
PhD Graduate Research Assistant
Email: mooreja [at] isi.edu
Re: WSDL of standard architecture XSDs and using 3rd party implementations in the WSDL2Java Web Service Generation Process
Posted by Davanum Srinivas <da...@gmail.com>.
See example below. It uses the -x option to exclude generation for
specific namespaces.
<java classname="org.apache.axis.message.addressing.tools.wsdl.WSDL2Java"
failonerror="true"
fork="yes">
<classpath>
<pathelement location="${maven.build.dest}"/>
<path refid="maven.dependency.classpath"/>
</classpath>
<arg value="-o"/>
<arg value="${maven.build.dir}/stubs/src"/>
<arg value="-Nhttp://schemas.xmlsoap.org/ws/2004/08/addressing=org.apache.axis.message.addressing"/>
<!-- Don't generate classes for ws-addressing types as we already
have them -->
<arg value="-x"/>
<arg value="http://schemas.xmlsoap.org/ws/2004/08/addressing"/>
<arg value="test/addressing/tools/ping_service.wsdl"/>
</java>
On 7/28/05, James Moore <mo...@isi.edu> wrote:
> Hello all,
>
> I was hoping someone might be able to answer a question about Web
> Service generation using Axis WSDL2Java. Here is my situation:
>
> I've created a web service (wsdl) that imports a couple of schemas. One
> of the imported xsd performs its own import of the "XML Digital
> Signature schema". The <element> used in a <message> of my WSDL is
> defined in the imported xsd using a <complexType>. This complex type
> has a <sequence> of elements. One of these elements is a <ds:Signature>
> where the "ds" namespace is "http://www.w3.org/200/09/xmldsig#" (aka the
> XML Digital Signature architecture). Here is where my question begins....
>
> When I generate the web service using WSDL2Java all the elements of the
> "ds" namespace are generated.
>
> What I'd like to do is take one of the "Publically Available Code,
> Tookits or SDKs" from "http://www.w3.org/Signature", include it in my
> project, and use that as the implementation for the <ds:Signature>
> element of the <complexType> <sequence>.
>
> With that said, I'm having a hard time finding any information on Google
> regarding this matter. Does anyone have some information, pointers,
> tips, etc, etc... about how to do this??
>
>
>
> Below is an example WSDL and XSD that illustrates the basic concept of
> what i'm explaining above. Here there is a WSDL file that includes a
> schema with a namespace "http://myschema.com". This schema then defines
> a <complexType> that is constructed using a <sequence> of elements. One
> of the elements in the sequence is the "ds:Signature" element. So here
> the import of the "ds" namespace would end up generating all the java
> classes for the "XML Digital Signature" schema because the namespace and
> XSD is imported in the "http://myschema.com" XSD. This is where I'd
> like to be able to include the third party "XML Digital Signature"
> implementation jar into the WSDL2Java generation process, thus
> eliminating the generation of the "ds" files and replacing all
> references to the "ds:Signature" with the package/class of the third
> party implementation.
>
> Any help would be greatly appreciated. Thanks for your time in
> advance. Hope to hear from the AXIS community members soon.
>
>
>
> Example WSDL snippet (not the real one but given for a depiction):
> <wsdl:definitions
> targetnamespace="http://mywsdl.com"
> xmlns:tns="http://mywsdl.com"
> xmlns:imdschema="http://myschema.com"
> ...
> >
> <wsdl:types>
> <xsd:schema
> ....
> <xsd:import namespace="http://myschema.com"
> schemaLocaiton="myschema.xsd"/>
> >
> </xsd:schema>
> </wsdl:types>
> <wsdl:message name="myType">
> <wsdl:part element="imdschema:myType" name="myType"/>
> </wsdl:message>
> ....
> </wsd:definitions>
>
> Example XSD snippet:
> <?xml version....?>
> <schema
> targetNamespace="http://myschema.com"
> xmlns:tns="http://myschema.com"
> xmlns:ds="http://www.w3.org/2000/09/xmldsig#"
> ....
> >
> <import namespace="http://www.w3.org/2000/09/xmldsig#"
> schemaLocation="http://www.w3.org/TR/2002/REC-xmldsig-core-20020212/xmldsig-core-schema.xsd/>
>
> <complexType name="myType">
> <sequence>
> <element ref="ds"Signature minOccurs="0"/>
> <element ref .....
> <element ref .....
> .....
> </complexType>
> ....
> </wsdl:definitions>
>
> --
> __________________________________________________________________________________
>
> James J. Moore
>
> IBM Systems Group
> Advanced Systems Infrastructure Development
> Fellowship Assignee
>
> USC/Information Sciences Institute
> Center for Grid Technologies
> PhD Graduate Research Assistant
> Email: mooreja [at] isi.edu
>
>
--
Davanum Srinivas -http://blogs.cocoondev.org/dims/