Hi, I would like to use my own target namespace and schema namespace insteand
of default namespace. So I use the JAVA2WSDL tool within AXIS2-1.1.1 to
generate WSDL for my java code(see [1]) as follows:
java2wsdl -cp . -tn http://dog2.com -stn http://dog2.com/xsd -cn TestService
Then I put the WSDL(see [2]) into the META-INF directory and deploy the aar
file to tomcat 5.5, weblogic 9.1, websphere 6.1
1) Tomcat
When I access http://localhost:8080/axis2/services/TestService?wsdl, the WSDL
returned is what I generated using JAVA2WSDL
2)Weblogic 9.1
When I tried to retrieve TestService WSDL, I got an error(see [3]). But If I
remove the wsdl generated using JAVA2WSDL from the .aar file, it is perfect
fine and I can receive the wsdl generated by AXIS2 automatically.
3)Websphere 6.1
When I tried to retrieve TestService WSDL, I got an error as well(see[4]). But
if i remove the wsdl generated using JAVA2WSDL from the .aar file, it is
perfect fine and I can receive the wsdl generated by AXIS2 automatically.
Is it a bug in the AXIS2-1.1.1 JAVA2WSDL or I am missing something? Many thanks
in advance.
best regards
yong
[1] TestService.java
public class TestService
{
public int add(int op1, int op2)
{
return (op1 + op2);
}
}
[2] TestService.wsdl generated using JAVA2WSDL
<wsdl:definitions targetNamespace="http://dog2.com">
-
<wsdl:types>
-
<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified"
targetNamespace="http://dog2.com/xsd">
-
<xs:element name="add">
-
<xs:complexType>
-
<xs:sequence>
<xs:element name="param0" nillable="true" type="xs:int"/>
<xs:element name="param1" nillable="true" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
-
<xs:element name="addResponse">
-
<xs:complexType>
-
<xs:sequence>
<xs:element name="return" nillable="true" type="xs:int"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</wsdl:types>
-
<wsdl:message name="addMessage">
<wsdl:part name="part1" element="ns:add"/>
</wsdl:message>
-
<wsdl:message name="addResponseMessage">
<wsdl:part name="part1" element="ns:addResponse"/>
</wsdl:message>
-
<wsdl:portType name="TestServicePortType">
-
<wsdl:operation name="add">
<wsdl:input message="axis2:addMessage"/>
<wsdl:output message="axis2:addResponseMessage"/>
</wsdl:operation>
</wsdl:portType>
-
<wsdl:binding name="TestServiceSOAP11Binding" type="axis2:TestServicePortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
-
<wsdl:operation name="add">
<soap:operation soapAction="urn:add" style="document"/>
-
<wsdl:input>
<soap:body use="literal" namespace="http://dog2.com"/>
</wsdl:input>
-
<wsdl:output>
<soap:body use="literal" namespace="http://dog2.com"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
-
<wsdl:binding name="TestServiceSOAP12Binding" type="axis2:TestServicePortType">
<soap12:binding transport="http://schemas.xmlsoap.org/soap/http"
style="document"/>
-
<wsdl:operation name="add">
<soap12:operation soapAction="urn:add" style="document"/>
-
<wsdl:input>
<soap12:body use="literal" namespace="http://dog2.com"/>
</wsdl:input>
-
<wsdl:output>
<soap12:body use="literal" namespace="http://dog2.com"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
-
<wsdl:service name="TestService">
-
<wsdl:port name="TestServiceSOAP11port"
binding="axis2:TestServiceSOAP11Binding">
<soap:address location="http://localhost:8080/axis2/services/TestService"/>
</wsdl:port>
-
<wsdl:port name="TestServiceSOAP12port"
binding="axis2:TestServiceSOAP12Binding">
<soap12:address location="http://localhost:8080/axis2/services/TestService"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
[3]WSDL parse error in Weblogic 9.1
XML Parsing Error: prefix not bound to a namespace
Location: http://192.168.0.2:7001/dist/services/TestService?wsdl
Line Number 19, Column 440:
[4]WSDL error in Websphere 6.1
Error: java.lang.NoSuchMethodError:
javax/wsdl/PortType.getExtensionAttributes()Ljava/util/Map; at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processPortType(WSDL11ToAxisServiceBuilder.java:886)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.processBinding(WSDL11ToAxisServiceBuilder.java:429)
at
org.apache.axis2.description.WSDL11ToAxisServiceBuilder.populateService(WSDL11ToAxisServiceBuilder.java:242)
at
org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLFile(ArchiveReader.java:215)
at
org.apache.axis2.deployment.repository.util.ArchiveReader.processWSDLs(ArchiveReader.java:306)
at
org.apache.axis2.deployment.DeploymentEngine.doDeploy(DeploymentEngine.java:513)
at
org.apache.axis2.deployment.repository.util.WSInfoList.update(WSInfoList.java:196)
at
org.apache.axis2.deployment.RepositoryListener.update(RepositoryListener.java:227)
at
org.apache.axis2.deployment.RepositoryListener.checkServices(RepositoryListener.java:174)
at
org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:88)
at
org.apache.axis2.deployment.WarBasedAxisConfigurator.loadServices(WarBasedAxisConfigurator.java:252)
at
org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:72)
at
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:392)
at org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:331) at
com.ibm.ws.webcontainer.servlet.ServletWrapper.init(ServletWrapper.java:185) at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.init(ServletWrapper.java:316)
at
com.ibm.ws.webcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java:1119)
at
com.ibm.ws.wswebcontainer.servlet.ServletWrapper.initialize(ServletWrapper.java
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]