[jboss-user] [JBossWS] - Re: Jsr181 typenamespace specification.
fdifonzo
do-not-reply at jboss.com
Thu Jan 17 07:21:45 EST 2008
Hi,
Unfortunately annotation on my custom type doesn't take any effect (I'm using jboss 4.2.2).
My custom type looks like this now:
package mycompany.exception;
|
| import java.io.Serializable;
|
| import javax.xml.bind.annotation.XmlAccessType;
| import javax.xml.bind.annotation.XmlAccessorType;
| import javax.xml.bind.annotation.XmlElement;
| import javax.xml.bind.annotation.XmlRootElement;
| import javax.xml.bind.annotation.XmlType;
|
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "AlreadyExistsDeviceException", namespace="http://mycompany/types", propOrder = {
| "errorMessage"
| })
| public class AlreadyExistsDeviceException extends Exception
| implements Serializable {
| @XmlElement(required = true, nillable = true)
| private String errorMessage;
|
|
| public AlreadyExistsDeviceException(String errorMsg) {
|
| super(errorMsg);
|
| this.errorMessage = errorMsg;
|
| }
|
| public String getErrorMessage() {
|
| return errorMessage;
|
| }
|
| }
While my endpoint looks like the following:
package mycompany;
| .....
| .....
|
| @Stateless
| @Remote(WEBServiceRemote.class)
| @WebService(name = "EndPointInterface", targetNamespace = "http://mycompany", serviceName = "MyServiceWEBService")
| @SOAPBinding(style = SOAPBinding.Style.RPC)
| @XmlSeeAlso({mycompany.exception.AlreadyExistsDeviceException.class)
| public class WEBServiceBean implements WEBServiceRemote, CodeControl {
|
|
| @WebMethod
| public void addDevice(String id, String type, String path) throws AlreadyExistsDeviceException {
| ......
| ......
| }
|
| }
Using wsdl-tool I get a wsdl looking ike this:
| .....
| .....
| <types>
| .....
| .....
| <schema targetNamespace='http://mycompany/types' xmlns='http://www.w3.org/2001/XMLSchema' xmlns:ns2='http://lang.java/' xmlns:ns3='
| http://annotation.lang.java/' xmlns:ns4='http://reflect.lang.java/' xmlns:ns5='http://security.java/' xmlns:ns6='http://cert.security.java/' xmlns:ns7='http
| ://www.w3.org/2001/XMLSchema' xmlns:ns8='http://util.java/' xmlns:ns9='http://net.java/' xmlns:soap11-enc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:
| tns='http://webservice.ztc.alliedtelesyn.com/types' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'>
| <import namespace='http://annotation.lang.java/'/>
| <import namespace='http://cert.security.java/'/>
| <import namespace='http://net.java/'/>
| <import namespace='http://util.java/'/>
| <import namespace='http://www.w3.org/2001/XMLSchema'/>
| <import namespace='http://reflect.lang.java/'/>
| <import namespace='http://lang.java/'/>
| <import namespace='http://security.java/'/>
| <complexType name='AlreadyExistsDeviceException'>
| <sequence>
| <element name='errorMessage' nillable='true' type='string'/>
| </sequence>
| </complexType>
| .....
| .....
| </types>
| .......
| .......
|
While using annotation approach, I'm continuing getting the following wsdl:
....
| ....
| <types>
| .....
| .....
| <xs:complexType name="AlreadyExistsDeviceException">
| <xs:sequence>
| <xs:element minOccurs="0" name="errorMessage" type="xs:string"/>
| <xs:element minOccurs="0" name="message" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| .....
| .....
| </types>
| ....
| ....
Note that there's no namespace in the latter. Is there a way to discover what wrong is on my code? I set log4j debug level to TRACE but I haven't seen any Error.
Any help will be really appreciated.
Thanks a lot, Fabrizio
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4120839#4120839
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4120839
More information about the jboss-user
mailing list