Jboss-4.0.3rc1 WebService

Source: Internet
Author: User
Tags jboss wsdl

Build.xml
Config.xml
Webservices.xml

Hello.java
* * *
 @author Roson * * 2005-10-10 * *

package helloservice;

Import Java.rmi.Remote;
Import java.rmi.RemoteException;

Public interface Hello extends Remote {public
	
	string SayHello (String name) throws RemoteException;

}

Helloimpl.java
* * *
 @author Roson * * 2005-10-10 * *

package helloservice;

Import java.rmi.RemoteException;

public class Helloimpl implements Hello {public

	String message= "Hello:";
	
	Public String SayHello (string name) throws RemoteException {return
		message+name;
	}

}

Client.java
* * *
 @author roson
 * *
 2005-10-11

/package client;

Import HelloService. Hello;

Import Javax.xml.rpc.Service;
Import javax.xml.rpc.ServiceFactory;
Import Javax.xml.namespace.QName;

Import java.net.*;

public class Client {public

	static void Main (string[] args) throws Exception {
		
		url url=new url ("Http://netone:8 080/webservice/hello?wsdl ");
		QName qname=new QName ("Http://netone.com/Hello", "HelloService");
		
		Servicefactory factory=servicefactory.newinstance ();
		Service Service=factory.createservice (url,qname);
		Hello hello= (Hello) service.getport (hello.class);
		System.out.println (Hello.sayhello ("Rosonsandy"));
	}

First you have to configure path and jboss_home yourself

Generate Mapping.xml
Run Ant generate-mapping
Generate HELLOSERVICE.WSDL
Run Ant Wscompile
The files are then placed in pictures.
Deploying the Ant War
To view the HelloService in JBoss:
http://localhost:8080/ws4ee/
Http://localhost:8080/ws4ee/services

You can run the client. -->run As-->java application in eclipse

Description
With regard to the latest EJB3.0 and WebService collaboration, JBoss will be completed in JBoss5.0.
The ant settings for Wscompile and Wsdeploy can be referenced
Http://java.sun.com/webservices/docs/1.3/jaxrpc/jaxrpc-tools.html
Https://jax-rpc.dev.java.net/whitepaper/1.1/index-part1.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.