[JBossWS] - Re: Unmarshalling Exception with Web Service Array Input
by sumitsu
I'd prefer to retain the 2.1 SLSB if I can... is there a reason that Array-type inputs should not work under JAX-RPC with the server/JBossWS config I described? Please let me know if you see anything obviously wrong with my WSDL/code/artifacts... I could not find many other references to this Exception in the forum.
If it helps, here is an extract from my mapping.xml file, also (currently) generated by wscompile:
| <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
| <java-wsdl-mapping xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
| version="1.1" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd">
| <package-mapping>
| <package-type>com.business.WebService.messageProcessing</package-type>
| <namespaceURI>InboundWebService</namespaceURI>
| </package-mapping>
| <package-mapping>
| <package-type>com.business.WebService.messageProcessing</package-type>
| <namespaceURI>InboundWebService</namespaceURI>
| </package-mapping>
| <java-xml-type-mapping>
| <java-type>com.business.WebService.dto.ServiceStatus</java-type>
| <root-type-qname xmlns:typeNS="InboundWebService">typeNS:ServiceStatus</root-type-qname>
| <qname-scope>complexType</qname-scope>
| <variable-mapping>
| <java-variable-name>code</java-variable-name>
| <xml-element-name>code</xml-element-name>
| </variable-mapping>
| <variable-mapping>
| <java-variable-name>subject</java-variable-name>
| <xml-element-name>subject</xml-element-name>
| </variable-mapping>
| </java-xml-type-mapping>
| <java-xml-type-mapping>
| <java-type>com.business.WebService.dto.CustomField</java-type>
| <root-type-qname xmlns:typeNS="InboundWebService">typeNS:CustomField</root-type-qname>
| <qname-scope>complexType</qname-scope>
| <variable-mapping>
| <java-variable-name>name</java-variable-name>
| <xml-element-name>name</xml-element-name>
| </variable-mapping>
| <variable-mapping>
| <java-variable-name>value</java-variable-name>
| <xml-element-name>value</xml-element-name>
| </variable-mapping>
| </java-xml-type-mapping>
| <java-xml-type-mapping>
| <java-type>com.business.WebService.dto.ServiceRequest</java-type>
| <root-type-qname xmlns:typeNS="InboundWebService">typeNS:ServiceRequest</root-type-qname>
| <qname-scope>complexType</qname-scope>
| <variable-mapping>
| <java-variable-name>customFields</java-variable-name>
| <xml-element-name>customFields</xml-element-name>
| </variable-mapping>
| </java-xml-type-mapping>
| <service-interface-mapping>
| <service-interface>com.business.WebService.messageProcessing.LiaisonB2BWebServiceInterface</service-interface>
| <wsdl-service-name xmlns:serviceNS="InboundWebService">serviceNS:LiaisonB2BWebServiceInterface</wsdl-service-name>
| <port-mapping>
| <port-name>MessageEndPointPort</port-name>
| <java-port-name>MessageEndPointPort</java-port-name>
| </port-mapping>
| </service-interface-mapping>
| <service-endpoint-interface-mapping>
| <service-endpoint-interface>com.business.WebService.messageProcessing.MessageEndPoint</service-endpoint-interface>
| <wsdl-port-type xmlns:portTypeNS="InboundWebService">portTypeNS:MessageEndPoint</wsdl-port-type>
| <wsdl-binding xmlns:bindingNS="InboundWebService">bindingNS:MessageEndPointBinding</wsdl-binding>
| <service-endpoint-method-mapping>
| <java-method-name>processMessage</java-method-name>
| <wsdl-operation>processMessage</wsdl-operation>
| <method-param-parts-mapping>
| <param-position>0</param-position>
| <param-type>com.business.WebService.dto.ServiceRequest</param-type>
| <wsdl-message-mapping>
| <wsdl-message xmlns:wsdlMsgNS="InboundWebService">wsdlMsgNS:MessageEndPoint_processMessage</wsdl-message>
| <wsdl-message-part-name>ServiceRequest</wsdl-message-part-name>
| <parameter-mode>IN</parameter-mode>
| </wsdl-message-mapping>
| </method-param-parts-mapping>
| <wsdl-return-value-mapping>
| <method-return-value>com.business.WebService.dto.ServiceStatus</method-return-value>
| <wsdl-message xmlns:wsdlMsgNS="InboundWebService">wsdlMsgNS:MessageEndPoint_processMessageResponse</wsdl-message>
| <wsdl-message-part-name>result</wsdl-message-part-name>
| </wsdl-return-value-mapping>
| </service-endpoint-method-mapping>
| </service-endpoint-interface-mapping>
| </java-wsdl-mapping>
|
Thanks again.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092096#4092096
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092096
17 years
[JBossWS] - Re: Unmarshalling Exception with Web Service Array Input
by sumitsu
Thanks for the response. My endpoint interface looks like this:
| package com.business.WebService.messageProcessing;
|
| public interface MessageEndPoint extends Remote
| {
| public ServiceStatus processMessage(ServiceRequest sReq) throws RemoteException;
| }
|
and the implementation class (the part relevant to the web service) looks like:
| package com.business.WebService.messageProcessing;
|
| public class MessageBean implements SessionBean {
|
| private static final String RESPONSECODE_OK = "OK";
|
| private SessionContext sessionCtxt;
|
| private ServiceStatus buildResponseOK(String str1, String str2, String str3) {
| ServiceStatus ss = new ServiceStatus();
|
| ss.setCode(RESPONSECODE_OK);
| ss.setSubject(str3);
|
| return ss;
| }
|
| public ServiceStatus processMessage(ServiceRequest sReq) throws RemoteException {
| CustomField[] custFields;
|
| custFields = sReq.getCustomFields();
|
| ... business logic ...
|
| return buildResponseOK("abc", "def", "ghi");
| }
|
| public void ejbCreate() throws EJBException, RemoteException { }
| public void ejbRemove() throws EJBException, RemoteException { }
| public void ejbActivate() throws EJBException, RemoteException { }
| public void ejbPassivate() throws EJBException, RemoteException { }
| public void setSessionContext(SessionContext sessionCtxt) throws EJBException, RemoteException {
| this.sessionCtxt = sessionCtxt;
| }
|
| public MessageBean() {
| }
| }
|
I'm using a 2.0-spec EJB as my endpoint, and when I try to run wsprovide, it complains about an annotation @WebService not being present:
| org.jboss.ws.WSException: Cannot obtain @WebService annotation from: com.liaison.InboundWebService.messageProcessing.MessageEndPoint
|
Does JAX-WS require an EJB 3.0 endpoind, or iss there a way to make it work with 2.0 EJBs?
Thanks again.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092043#4092043
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092043
17 years
[JBossWS] - XMLSchema, WSDL and wsconsume tool
by mleite
Hi,
i have created a WSDL file that is based on a XMLSchema file.
In that XMLSchema file i have defined some rules related to
simpleTypes, like that:
<xs:simpleType name="gender">
| <xs:restriction base="xs:string">
| <xs:enumeration value="M" />
| <xs:enumeration value="F" />
| </xs:restriction>
| </xs:simpleType>
|
With this simpleType i have created a complexType, like that:
<xs:complexType name="customer">
| <xs:sequence>
| <xs:element name="name" type="xs:string" />
| <xs:element name="dateOfBirth" type="xs:date" />
| <xs:element name="gender" type="gender" />
| </xs:sequence>
| </xs:complexType>
|
Thus, i use wsconsume tool to generate the classes based on that WSDL.
It works fine, i package and deploy my app and it is successfully published on Jboss.
After deploy and publish my app, i need to use the wsconsume tool again to create the WS client. But, when i access the URL http://myhost:myport/appName/something?wsdl to see the WSDL on-line generated, the simpleType defined previously with restrictions doesn't appear correctly, i mean it doesn't appear with the restrictions defined on XMLSchema. In that WSDL i can see the complexType customer type defined, but the element "gender" is only a xs:string type without restrictions.
Is it like that or am i forgetting something?
________________________
Best regards,
Marcelo
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4092009#4092009
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4092009
17 years