[JBossWS] - Error passing Complex Types as parameters in Web Service
by nandanT
Hi,
I have created a simple Hello World Web Service.
I have created a POJO HelloParam
The method exposed in the web service "sayHello" takes HelloParam object as parameter.
The WSDL is generated and is deployed successfully over JBoss.
But when I run the client, I get the following error:
Exception in thread "main" org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://ejb3webservice.wipro.com/}helloParam
Following are the classes that I have created:
| package com.wipro.ejb3webservice;
|
| import java.io.Serializable;
|
| public class HelloParam implements Serializable{
| /**
| *
| */
| private static final long serialVersionUID = 5446103626304202057L;
| String firstName;
| String lastName;
|
| /**
| * @return the firstName
| */
| public String getFirstName() {
| return firstName;
| }
| /**
| * @param firstName the firstName to set
| */
| public void setFirstName(String firstName) {
| this.firstName = firstName;
| }
| /**
| * @return the lastName
| */
| public String getLastName() {
| return lastName;
| }
| /**
| * @param lastName the lastName to set
| */
| public void setLastName(String lastName) {
| this.lastName = lastName;
| }
| /**
| * @param firstName
| * @param lastName
| */
| public HelloParam(String firstName, String lastName) {
| super();
| this.firstName = firstName;
| this.lastName = lastName;
| }
| /**
| *
| */
| public HelloParam() {
|
| }
| }
|
The interface that is exposed as webservice is :
package com.wipro.ejb3webservice;
|
| import java.rmi.Remote;
|
| import javax.jws.WebService;
| import javax.jws.soap.SOAPBinding;
| import javax.jws.soap.SOAPBinding.Style;
|
|
| @WebService
| @SOAPBinding(style = Style.RPC)
| public interface HelloWorld extends Remote {
| public void sayHello(HelloParam helloParam);
| }
And the implementation of the interfaces is:
package com.wipro.ejb3webservice;
|
| import javax.ejb.Remote;
| import javax.ejb.Stateless;
| import javax.jws.WebMethod;
| import javax.jws.WebParam;
| import javax.jws.WebService;
|
|
| @Stateless
| @Remote(HelloWorld.class)
| @WebService(name="HelloWorldName" ,serviceName="HelloWorldImplService",endpointInterface = "com.wipro.ejb3webservice.HelloWorld")
| public class HelloWorldImpl implements HelloWorld {
|
| @WebMethod
| public void sayHello(
| @WebParam(name="helloParam" )
| HelloParam helloParam)
| {
| System.out.println("first name" + helloParam.getFirstName()+"last name--"+ helloParam.getLastName());
|
| }
| }
The WSDL file genereated is:
<?xml version="1.0" encoding="UTF-8"?>
| <definitions name="HelloWorldImplService" targetNamespace="http://ejb3webservice.wipro.com/" xmlns:tns="http://ejb3webservice.wipro.com/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns="http://schemas.xmlsoap.org/wsdl/">
| <types>
| <xs:schema targetNamespace="http://ejb3webservice.wipro.com/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
| <xs:complexType name="helloParam">
| <xs:sequence>
| <xs:element minOccurs="0" name="firstName" type="xs:string"/>
| <xs:element minOccurs="0" name="lastName" type="xs:string"/>
| </xs:sequence>
| </xs:complexType>
| </xs:schema>
| </types>
| <message name="HelloWorld_sayHelloResponse">
| </message>
| <message name="HelloWorld_sayHello">
| <part name="arg0" type="tns:helloParam">
| </part>
| </message>
| <portType name="HelloWorld">
| <operation name="sayHello" parameterOrder="arg0">
| <input message="tns:HelloWorld_sayHello">
| </input>
| <output message="tns:HelloWorld_sayHelloResponse">
| </output>
| </operation>
| </portType>
| <binding name="HelloWorldBinding" type="tns:HelloWorld">
| <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
| <operation name="sayHello">
| <soap:operation soapAction=""/>
| <input>
| <soap:body use="literal" namespace="http://ejb3webservice.wipro.com/"/>
| </input>
| <output>
| <soap:body use="literal" namespace="http://ejb3webservice.wipro.com/"/>
| </output>
| </operation>
| </binding>
| <service name="HelloWorldImplService">
| <port name="HelloWorldNamePort" binding="tns:HelloWorldBinding">
| <soap:address location="http://localhost:8080/Ejb3Webservice/HelloWorldImpl"/>
| </port>
| </service>
| </definitions>
|
Can any one help me on this issue.
Its very urgent.
Thanks and Regards
-Nandan
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172210#4172210
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172210
17 years, 8 months
[Security & JAAS/JBoss] - Re: Dynamic login config broken in JBoss 5 Beta4
by javidjamae
OK, I just tried this out on CR1, using the same code that I got to work on Beta4, and it doesn't seem to work. Did something change again?
Here is the service:
| <server>
| <mbean code="org.jboss.security.auth.login.DynamicLoginConfig"
| name="jboss:service=DynamicLoginConfig">
| <attribute name="AuthConfig">dynamic-login-config.xml</attribute>
| <depends optional-attribute-name="LoginConfigService">jboss.security:service=XMLLoginConfig</depends>
| <depends optional-attribute-name="SecurityManagerService">jboss.security:service=JaasSecurityManager</depends>
| </mbean>
| </server>
|
Here is the dynamic-login-config.xml file (in my WEB-INF/classes directory) so it should be accessible by the VFS Classloader:
| <policy>
|
| <application-policy name = "simple-security-domain">
| <authentication>
| <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule" flag = "required">
| <module-option name="usersProperties">myusers.properties</module-option>
| <module-option name="rolesProperties">myroles.properties</module-option>
| </login-module>
| </authentication>
| </application-policy>
|
| </policy>
|
And here is the error:
| 18:10:05,711 ERROR [AbstractKernelController] Error installing to Start: name=jb
| oss:service=DynamicLoginConfig state=Create mode=Manual requiredState=Installed
| org.jboss.deployment.DeploymentException: Failed to find authConf as resource: d
| ynamic-login-config.xml
| at org.jboss.security.auth.login.DynamicLoginConfig.startService(Dynamic
| LoginConfig.java:236)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanS
| upport.java:376)
| at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMB
| eanSupport.java:322)
| at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
| at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
| sorImpl.java:25)
| at java.lang.reflect.Method.invoke(Method.java:585)
| at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatch
| er.java:157)
| at org.jboss.mx.server.Invocation.dispatch(Invocation.java:96)
| at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
| at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.
| java:264)
| at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:668)
| at org.jboss.system.microcontainer.ServiceProxy.invoke(ServiceProxy.java
| :189)
| at $Proxy35.start(Unknown Source)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installActio
| n(StartStopLifecycleAction.java:42)
| at org.jboss.system.microcontainer.StartStopLifecycleAction.installActio
| n(StartStopLifecycleAction.java:37)
| at org.jboss.dependency.plugins.action.SimpleControllerContextAction.sim
| pleInstallAction(SimpleControllerContextAction.java:62)
| at org.jboss.dependency.plugins.action.AccessControllerContextAction.ins
| tall(AccessControllerContextAction.java:71)
| at org.jboss.dependency.plugins.AbstractControllerContextActions.install
| (AbstractControllerContextActions.java:51)
| at org.jboss.dependency.plugins.AbstractControllerContext.install(Abstra
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4172202#4172202
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4172202
17 years, 8 months