Skip to main content

a problem when using wsimport to generate stubs from a Axis 1.4 server

5 replies [Last post]
climber2002
Offline
Joined: 2006-05-08
Points: 0

Hi all,

I have a web service developed in Axis 1.4, and I want to use JAX-WS as the client, I use wsimport to generate the stubs ,but the following errors occured, can someone help me? thank you very much.

D:\open source\jax-ws\jaxws-ri\bin> wsimport -d d:\test\test1 -s d:\test\test2 http://localhost:8081/otasoap/services/LogonManager?wsdl

warning: src-resolve: Cannot resolve the name 'soapenc:Array' to a(n) 'type definition' component.
line ? of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
error: undefined simple or complex type 'soapenc:Array'
line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
error: undefined attribute 'soapenc:arrayType'
line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
error: undefined simple or complex type 'soapenc:Array'
line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
error: undefined attribute 'soapenc:arrayType'
line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2
error: undefined simple or complex type 'soapenc:string'
line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema3
error: undefined simple or complex type 'soapenc:string'
line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema1
error: undefined simple or complex type 'soapenc:string'
line 0 of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema1

The WSDL got from the Axis server is as following, I use RPC/ENCODING style.

<?xml version="1.0" encoding="UTF-8" ?>
-
-
-
-

-
-

-
-
-

-
-
-

-
-
-

-

-
-
-

-
-
-

-

-
-

-

-

-

-

-

-

-

-

-

-
-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-

-
-

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jitu
Offline
Joined: 2003-06-14
Points: 0

JAX-WS's wsimport cannot consume rpc/encoded WSDLs. It works with rpc/lit and doc/lit WSDLs.

climber2002
Offline
Joined: 2006-05-08
Points: 0

Hi jitu,

Thanks very much for your response. I'm a newbie of JAX-WS, I have changed from rpc/encoding to rpc/literal, but still some errors, can you help me to solve it. thanks very much. here is what I did,

I write an interface LogonManager:

public interface LogonManager {

public String logon(String username, String password) throws DeniedAccessFault, ExpiredAccountFault, ServiceBreakDownFault;

public boolean logout(String sessionId);

public CategoryBean[] getAccessRights(String sessionId, String[] categoryNames) throws DeniedAccessFault, ServiceBreakDownFault;
}

public class CategoryBean implements Serializable {

private String name;

private boolean granted;

public boolean isGranted() {
return granted;
}

public void setGranted(boolean granted) {
this.granted = granted;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

}

then I use JAVA2WSDL to generate the WSDL, here is the ant target


in the above config, I use RPC/LITERAL

then I use the WSDL2JAVA to generate the server impl



then I deployed this service on Tomcat, and use wsimport to generate the stubs, but still some errors

D:\test\jaxws-ri\bin>wsimport -extension http://localhost:8081/otasoap/services/LogonManager?wsdl

warning: src-resolve: Cannot resolve the name 'tns2:CategoryBean' to a(n) 'type definition' component.
line ? of http://localhost:8081/otasoap/services/LogonManager?wsdl#types?schema2

error: in message "ServiceBreakDownFault", part "fault" must specify a "element" attribute

The following is the generated WSDL,





























































jitu
Offline
Joined: 2003-06-14
Points: 0

Do you have similar problems with doc/lit? I think the axis generated WSDL has problems:

for e.g.:

shoule be something like

Let us know if the doc/lit works for you.

climber2002
Offline
Joined: 2006-05-08
Points: 0

when I change to doc/lit, the JAVA2WSDL gives the following messages,

[axis-java2wsdl] Java2WSDL com.gemplus.ota.soap.logon.LogonManager
[axis-java2wsdl] Request Message type information has multiple parts than one single wrapped complexType. Use WRAPPED/LITERAL if interoping with some other soap stack becomes a problem
[axis-java2wsdl] - Please register a typemapping/beanmapping for 'com.gemplus.ota.soap.DeniedAccessFault'
[axis-java2wsdl] - Please register a typemapping/beanmapping for 'com.gemplus.ota.soap.ExpiredAccountFault'
[axis-java2wsdl] - Please register a typemapping/beanmapping for 'com.gemplus.ota.soap.ServiceBreakDownFault'
[axis-java2wsdl] Request Message type information has multiple parts than one single wrapped complexType. Use WRAPPED/LITERAL if interoping with some other soap stack becomes a problem
[axis-java2wsdl] - Please register a typemapping/beanmapping for '[Lcom.gemplus.ota.soap.bean.CategoryBean;'

and the output of wsimport is
D:\test\jaxws-ri\bin>wsimport -extension http://localhost:8081/otasoap/services/LogonManager?wsdl

warning: Ingoring operation "logon": more than one part bound to body
warning: Ingoring operation "getAccessRights": more than one part bound to body

and the generated stubs LogonManager has only one method logout, has no logon and getAccessRights methods.

jitu
Offline
Joined: 2003-06-14
Points: 0

axis-java2wsdl] Request Message type information has multiple parts than one single wrapped complexType. Use WRAPPED/LITERAL if interoping with some other soap stack becomes a problem

As axis tool says, can you not specify doc/lit wrapper style.