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 Ulf Heyder <uh...@gmx.de> on 2006/12/01 10:40:31 UTC
Fwd: [AXIS2] False namespace2package mapping in wsdl2java
Hello,
I still can't get wsdl2java to follow my -ns2p option
-ns2p bar=foo.bar.service.types,foo=foo.bar.service.types.foo
All java classes created from the xsd types in namespace "bar" are written to java package "de.foo_bar.www.bar" instead of "foo.bar.service.types".
Of course I can more ore less easily move the classes to the desired package. On the other hand I have to do it every time I restart the wsdl2java.
Any suggestions?
Thanks, Ulf
-------- Original-Nachricht --------
Datum: Wed, 29 Nov 2006 11:50:48 +0100
Von: "Ulf Heyder" <uh...@gmx.de>
An: axis-user@ws.apache.org
Betreff: [AXIS2] False namespace2package mapping in wsdl2java
I have problems mapping namespaces to packages using WSDL2JAVA (AXIS2 1.1)
My WSDL contains the following schema definition
<xsd:schema targetNamespace="http://www.foo-bar.de/bar"
xmlns:bar="http://www.foo-bar.de/bar"
xmlns:foo="http://www.foo-bar.de/foo">
<xsd:import namespace="http://www.w3.org/2005/05/xmlmime"
schemaLocation="xsd/xmime.xsd"/>
<xsd:element name="CreateProductXmlRequest" type="bar:AttachmentType"/>
<xsd:element name="CreateProductXmlResponse" type="xsd:string"/>
<xsd:complexType name="AttachmentType">
<xsd:sequence>
<xsd:element minOccurs="0" name="fileName" type="xsd:string"/>
<xsd:element name="binaryData" type="xmime:base64Binary"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
I start wsdl2java like this:
<target name="generate.service" depends="init">
<java classname="org.apache.axis2.wsdl.WSDL2Java">
<arg value="-uri"/>
<arg value="${project.base.dir}/FoobarService.wsdl"/>
<arg value="-o"/>
<arg value="${project.base.dir}"/>
<arg value="-p"/>
<arg value="foo.bar.service"/>
<arg value="-ss"/>
<arg value="-ssi"/>
<arg value="-g"/>
<arg value="-t"/>
<arg value="-sd"/>
<arg value="-ns2p"/>
<arg value="bar=foo.bar.service.types,foo=foo.bar.service.types.foo"/>
<classpath refid="class.path"/>
</java>
</target>
The java classes are written to the packages:
foo.bar.service (expected, -p custom package name):
FoobarServiceCallbackHandler.java
FoobarServiceMessageReceiverInOut.java
FoobarServiceSkeleton.java
FoobarServiceSkeletonInterface.java
FoobarServiceStub.java
and
FoobarServiceTest.java
org.w3.www._2005._05.xmlmime (expected, default mapping)
Base64Binary.java
HexBinary.java
de.foo_bar.www.bar (unexpected, expected in foo.bar.service.types following
-ns2p parameter):
ExtensionMapper.java
AttachmentType.java
CreateProductXmlRequest.java
CreateProductXmlResponse.java
Is my WSDL2JAVA call not correct?
Ulf
--
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!
--
"Ein Herz für Kinder" - Ihre Spende hilft! Aktion: www.deutschlandsegelt.de
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org
Re: Fwd: [AXIS2] False namespace2package mapping in wsdl2java
Posted by Carlos Ribeiro <ca...@multicert.com>.
You probably need to do: "-n2sp
http://www.foo-bar.de/bar=foo.bar.service.types"
Ulf Heyder wrote:
> Hello,
>
> I still can't get wsdl2java to follow my -ns2p option
>
> -ns2p bar=foo.bar.service.types,foo=foo.bar.service.types.foo
>
> All java classes created from the xsd types in namespace "bar" are written to java package "de.foo_bar.www.bar" instead of "foo.bar.service.types".
>
> Of course I can more ore less easily move the classes to the desired package. On the other hand I have to do it every time I restart the wsdl2java.
>
> Any suggestions?
>
> Thanks, Ulf
>
>
> -------- Original-Nachricht --------
> Datum: Wed, 29 Nov 2006 11:50:48 +0100
> Von: "Ulf Heyder" <uh...@gmx.de>
> An: axis-user@ws.apache.org
> Betreff: [AXIS2] False namespace2package mapping in wsdl2java
>
> I have problems mapping namespaces to packages using WSDL2JAVA (AXIS2 1.1)
>
> My WSDL contains the following schema definition
>
> <xsd:schema targetNamespace="http://www.foo-bar.de/bar"
> xmlns:bar="http://www.foo-bar.de/bar"
> xmlns:foo="http://www.foo-bar.de/foo">
>
> <xsd:import namespace="http://www.w3.org/2005/05/xmlmime"
> schemaLocation="xsd/xmime.xsd"/>
>
> <xsd:element name="CreateProductXmlRequest" type="bar:AttachmentType"/>
> <xsd:element name="CreateProductXmlResponse" type="xsd:string"/>
>
> <xsd:complexType name="AttachmentType">
> <xsd:sequence>
> <xsd:element minOccurs="0" name="fileName" type="xsd:string"/>
> <xsd:element name="binaryData" type="xmime:base64Binary"/>
> </xsd:sequence>
> </xsd:complexType>
> </xsd:schema>
>
> I start wsdl2java like this:
>
> <target name="generate.service" depends="init">
> <java classname="org.apache.axis2.wsdl.WSDL2Java">
> <arg value="-uri"/>
> <arg value="${project.base.dir}/FoobarService.wsdl"/>
> <arg value="-o"/>
> <arg value="${project.base.dir}"/>
> <arg value="-p"/>
> <arg value="foo.bar.service"/>
> <arg value="-ss"/>
> <arg value="-ssi"/>
> <arg value="-g"/>
> <arg value="-t"/>
> <arg value="-sd"/>
> <arg value="-ns2p"/>
> <arg value="bar=foo.bar.service.types,foo=foo.bar.service.types.foo"/>
> <classpath refid="class.path"/>
> </java>
> </target>
>
>
> The java classes are written to the packages:
>
> foo.bar.service (expected, -p custom package name):
> FoobarServiceCallbackHandler.java
> FoobarServiceMessageReceiverInOut.java
> FoobarServiceSkeleton.java
> FoobarServiceSkeletonInterface.java
> FoobarServiceStub.java
> and
> FoobarServiceTest.java
>
> org.w3.www._2005._05.xmlmime (expected, default mapping)
> Base64Binary.java
> HexBinary.java
>
> de.foo_bar.www.bar (unexpected, expected in foo.bar.service.types following
> -ns2p parameter):
> ExtensionMapper.java
> AttachmentType.java
> CreateProductXmlRequest.java
> CreateProductXmlResponse.java
>
>
> Is my WSDL2JAVA call not correct?
>
> Ulf
>