[JBossWS] - webservices development/deployment in jboss 4.0.5 and jboss
by ssuyamboo
Hi,
I tried the following webservice ,
package com.javasrc.webservices.age;
public class AgeServlet {
public String age( String name, Integer age ) {
return name + " is " + age + " years old!";
}
}
SEI is ,
package com.javasrc.webservices.age;
import java.rmi.Remote;
import java.rmi.RemoteException;
public interface Age extends Remote {
public String age( String name, Integer age ) throws RemoteException;
}
web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<servlet-name>AgeServlet</servlet-name>
<servlet-class>com.javasrc.webservices.age.AgeServlet</servlet-class>
<servlet-mapping>
<servlet-name>AgeServlet</servlet-name>
<url-pattern>/Age</url-pattern>
</servlet-mapping>
</web-app>
used this config file
<?xml version="1.0" encoding="UTF-8"?>
to generate wsdl and mapping file using Webservices Developer Pack which runs on jre 1.5 and my jboss server runs on java 1.4
my directory structure looks like ,
age.war
/WEB-INF
/classes
mapping.xml
web.xml
webservices.xml
/wsdl
AgeService.wsdl
When I opened up mapping and webservices.xml in jboss IDE 2 Beta , it showed some schema errors.
cvc-id.3: A field of identity constraint 'port-component-name-key' matched element 'webservice-description', but this element does not have a simple type.
I resolved this by removing ,
'http://java.sun.com/xml/ns/j2ee from the following
<?xml version='1.0' encoding='UTF-8'?><java-wsdl-mapping version='1.1' xmlns='http://java.sun.com/xml/ns/j2ee' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xsi:schemaLocation='http://java.sun.com/xml/ns/j2ee http://www.ibm.com/webservices/xsd/j2ee_jaxrpc_mapping_1_1.xsd'>.
And then published using jboss IDE Beta. Though I see the webservice in the console http://localhost:8080/jbossws/services , I couldn't invoke the webservice using client program in which I was thrown with error 500.
How do I resolve this ? Any help would be greatly appreciated.
Is the jbossws is a suggested environment to develop webservices?
Thanks
Sundar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046824#4046824
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046824
18 years, 11 months
[JBoss Seam] - View and Business logic: 2x calling method for #{bean.items}
by miloslav.vlach
I have problem with this:
I have one action with one method: find
this method starts with log message "finding" and prepare data for the view. After this method prepare data, the view should be displayed. But when I call the page in log appear the log from getItems method. But this method shloud be called after the business logic ends.
Can somebody tell me where is the problem? When I call this action at first, all work ok. But the second request invoke first the getItems method.
| <ui:repeat var="i" value="#{searchResult.items}">
| <h:outputText value="#{i.date}" /> <h:outputText value="#{i.pi.position}" /> <h:outputText value="#{i.pi.page}" /> (#{i.pi.phrase})<br/>
| </ui:repeat>
|
| public String find() {
| log.info("finding: #0, #1", searchEntity.getKeyword(), searchEntity.getUrl());
|
| ....
| log.info("search finished");
|
| log.info("session object: #0", searchResult);
|
| log.info("adding results to the session variable");
| if (searchResult != null) {
| Date d = new Date();
|
| searchResult.add(d, ...);
| searchResult.add(d, ...);
| }
| log.info("results added");
| return null;
| }
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046822#4046822
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046822
18 years, 11 months