axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Coutts (JIRA)" <axis-...@ws.apache.org>
Subject [jira] Created: (AXIS-2210) wsdl2java reverses urn namespace when creating package name.
Date Tue, 06 Sep 2005 12:53:30 GMT
wsdl2java reverses urn namespace when creating package name.
------------------------------------------------------------

         Key: AXIS-2210
         URL: http://issues.apache.org/jira/browse/AXIS-2210
     Project: Apache Axis
        Type: Bug
  Components: WSDL processing  
 Environment: Axis-wsdl2java within an ANT task, also embedded within Web service wizard of
Eclipse 3.1 WTP 0.7. Windows XP/2000 platfroms.
    Reporter: Mike Coutts


While building a Web service [within Eclipse] using a top down process from a WSDL file with
an associated XSD schema file the Web services wizard creates the java skeleton for the web
service and the Java proxy for testing OK. However it reverses the package naming throughout
such that a target namespace of urn:com.ncr.test.message becomes the Java package message.test.ncr.com.

The reversed package name is used consistently throughout the auto-generated code from java
modules, through Servlet definitions to the test client JSP's so that refactoring to achieve
the desired package naming would be a major operation. This also suggests that the reversal
occurs very early on in the web services wizard, so we tested WSDL/XSD files listed below
using just an ANT driven AXIS Task

<axis-wsdl2java
	serverside="true"
	output="temp"
	testcase="false"
	verbose="true"
	url="test.wsdl">
</axis-wsdl2java>

And receive the same results, hence suggesting that the problem is in axis-wsdl2java

If we specifically list a mapping from the namespace to the package it works OK.

i.e. 
<axis-wsdl2java
	serverside="true"
	output="temp"
	testcase="false"
	verbose="true"
	url="test.wsdl">
	<mapping
		namespace="urn:com.ncr.test"
		package="com.ncr.test"/>
	
	<mapping
		namespace="urn:com.ncr.test.message"
		package="com.ncr.test.message"/>
</axis-wsdl2java>

However this can be done easily within Eclipse WTP.

My suspicion would be that the same process for reversing the namespace is being applied to
urn:com.ncr.test and urn:com.ncr.test.message as is applied (rightly) to the http:// based
equivalents i.e. http://ncr.com/test and http://ncr.com/test/message.

The files test.wsdl and message-configuration.xsd are listed here for verification purposes.

test.wsdl

<wsdl:definitions 
	xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
	xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
	xmlns:s="http://www.w3.org/2001/XMLSchema"
	xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
	xmlns:tns="urn:com.ncr.test"
	xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/"
	xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
	targetNamespace="urn:com.ncr.test"
	xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
	xmlns:tmcfg="urn:com.ncr.test.message" name="Messaging">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="urn:com.ncr.test">
		<s:import schemaLocation="message-configuration.xsd"
namespace="urn:com.ncr.test.message"/>
		<s:complexType name="Message">
			<s:sequence>
				<s:element minOccurs="1" maxOccurs="1" name="contents"
type="tmcfg:MessageContents" />
			</s:sequence>
		</s:complexType>
		<s:complexType name="MessageRequestResult">
			<s:sequence>
				<s:element minOccurs="1" maxOccurs="1" name="message" type="tns:Message" />
			</s:sequence>
		</s:complexType>
		<s:element name="RetrieveMessage">
			<s:complexType>
				<s:sequence>
					<s:element minOccurs="1" maxOccurs="1" name="consumerUniqueId"
type="s:string" />
				</s:sequence>
			</s:complexType>
		</s:element>
		<s:element name="RetrieveMessageResponse">
			<s:complexType>
				<s:sequence>
					<s:element minOccurs="1" maxOccurs="1" name="RetrieveMessageResult"
type="tns:MessageRequestResult" />
				</s:sequence>
			</s:complexType>
		</s:element>
     </s:schema>
  </wsdl:types>
  <wsdl:message name="RetrieveMessageSoapIn">
    <wsdl:part name="parameters" element="tns:RetrieveMessage" />
  </wsdl:message>
  <wsdl:message name="RetrieveMessageSoapOut">
    <wsdl:part name="parameters" element="tns:RetrieveMessageResponse" />
  </wsdl:message>  
  <wsdl:portType name="MessagingSoap">
	<wsdl:operation name="RetrieveMessage">
      <wsdl:input message="tns:RetrieveMessageSoapIn" />
      <wsdl:output message="tns:RetrieveMessageSoapOut" />
    </wsdl:operation>    
   </wsdl:portType>
  <wsdl:binding name="MessagingSoap" type="tns:MessagingSoap">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document" />
    <wsdl:operation name="RetrieveMessage">
      <soap:operation
soapAction="urn:com.ncr.test/RetrieveMessage"
style="document" />
      <wsdl:input>
        <soap:body use="literal" />
      </wsdl:input>
      <wsdl:output>
        <soap:body use="literal" />
      </wsdl:output>
    </wsdl:operation>    
  </wsdl:binding>
  <wsdl:service name="Messaging">
    <documentation xmlns="http://schemas.xmlsoap.org/wsdl/" />
    <wsdl:port name="MessagingSoap" binding="tns:MessagingSoap">
      <soap:address location="http://localhost/messaging/Service1.asmx" />
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>


message-configuration.xsd

<?xml version="1.0" encoding="UTF-8"?>
<s:schema id="message-configuration" targetNamespace="urn:com.ncr.test.message"
elementFormDefault="qualified" xmlns="urn:com.ncr.test.message"
xmlns:s="http://www.w3.org/2001/XMLSchema">
	<s:complexType name="MessageContents">
		<s:sequence>
			<s:element minOccurs="1" maxOccurs="1" name="text" type="s:string"/>
			<s:element minOccurs="1" maxOccurs="1" name="graphic" type="s:string"/>
		</s:sequence>
	</s:complexType>
</s:schema>


This issue was originally found in Eclipse 3.1 WTP 0.7 and reported as Eclipse.org Bugzilla
report 105939,  which was entered over a month ago although there has been no response or
comment.

Having tried this with Axis-wsdl2java we now suspect the issue is possibly within the Axis-WSDL2JAVA
processing engine. However, it can easily be reproduced within Eclipse using the following
instructions. 

To reproduce on Eclipse 3.1 with WTP 0.7 on Windows 2000 (target server and runtime is Tomcat
5.0 with j2sdk1.4.2_08).

1. Open a new eclipse project workspace
2. Set the JRE to j2sdk1.4.2_08 (Window -> Preferences -> Java -> Installed JRE)
3. Set the Server runtime to Apache Tomcat 5.9 (Window -> Preferences -> Server ->
Installed Runtimes -> Add -> Apache Tomcat 5.0).
4. Create a new Dynamic Web Project called test.
5. In the WebContent directory add a folder called wsdl
6. Copy test.wsdl and message-configuration.xsd into the wsdl folder (file content included
at end of report).
7. Right click Test.wsdl and start the Web services wizard with New -> Other -> Web
services -> Web service.
8. Web service type should be "Top down java bean web service".
9. Select "Generate a proxy" and "Test the Web service", click next
10. WSDL should read /Test/WebContent/wsdl/test.wsdl, click next
11. Service deployment configuration should indicate the Web service runtime as Apache Axis
and the server as Tomcat v5.0, click Finish to build the web service.

A quick look at the JavaSource directory under projects Test and TestClient should show package
of message.test.ncr.com and test.ncr.com.



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message