The instructions describe how to develop this in Oracle JDeveloper 10g and deploy to Oracle Application Server 10g, but they are mostly compatible with Oracle JDeveloper 11g and Oracle WebLogic Server 11g.
1. Open JDeveloper (e.g., double-click on c:\jdev\jdeveloper.exe)
2. Create a new application WebServiceStubs:
a. Right-click on Applications
b. Click on New Application and then OK
c. Enter CustomerRegistration for the project name and then OK3. Create a Java class:
a. Right-click on CustomerRegistration
b. Click on New
c. Choose Java Class under General and then OK
d. Enter CustomerRegistration for the class and package names for now (should be pre-populated) and then OK4. Edit CustomerRegistration.java and add the following code:
package customerregistration;5. Create a J2EE Web Service from the Java class:
public class CustomerRegistration {
public String RespondName(String name) {
String outputString = "Hello " + name;
return (outputString);
}
}
a. Right-click on CustomerRegistration.java
b. Choose Create J2EE Web Service
c. Choose J2EE 1.4 (JAX-RPC) Web Service and then OK
d. Enter "RegisterCustomer" as the Web Service Name and then click Finish6. Deploy the service:
a. Click on File --> Save All
b. Right-click on WebServices.deploy and 'Deploy to' your application server
c. Click on OK whenever prompted7. Navigate to the web service and test (using a tool such as SoapUI):
http://dev.ipnweb.com:7777/WebServiceStubs-CustomerRegistration-context-root/RegisterCustomerSoapHttpPort8. Example of SOAP message:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:typ="http://customerregistration/types/">
<soapenv:Header/>
<soapenv:Body>
<typ:RespondNameElement>
<typ:name>World</typ:name>
</typ:RespondNameElement>
</soapenv:Body>
</soapenv:Envelope>
No comments:
Post a Comment