If you invoke WS using SEI through jaxws-rt, you might encounter an issue where your PERM space is filled with instances of com/sun/xml/ws/client/WSServiceDelegate$DelegatingLoader and you get a wonderful OutOfMemory PERMGEN error.
Looking at the code in
http://grepcode.com/file/repo1.maven.org/maven2/com.sun.xml.ws/jaxws-rt/2.2.8/com/sun/xml/ws/client/WSServiceDelegate.java?av=f we see that each invokation to createEndpointIFBaseProxy will instantiate a new DelegatingLoader(loader1, loader2); (which is an inner class).... createEndpointIFBaseProxy is called for each getPort call...
This inner class was not there in previous versions of the library.
So you might want to try an older version of the library ... or to apply some caching trick so as to avoid a getPort call for every WS invokation (if the WS is always the same, it seems to me that you don't need to go through all the work of creating a new Proxy for each call.... )
Showing posts with label webservices. Show all posts
Showing posts with label webservices. Show all posts
Tuesday, September 15, 2015
Sunday, March 20, 2011
JAX-RS, RestEasy, Restful WS
A great tutorial from Luciano:
http://blog.aestasit.com/develop-restful-services-like-a-ninja-part-1/
http://blog.aestasit.com/develop-restful-services-like-a-ninja-%E2%80%93-part-2/
JAX-RS = Java API for RESTful Web Services
here http://www.ibm.com/developerworks/webservices/library/wa-jaxrs/index.html general presentation of JAX-RS
The Resteasy doc is here (don't expect complete examples, only code snippets are provided)
http://docs.jboss.org/resteasy/docs/1.0.1.GA/userguide/html/
the annotations are in javax.ws.rs package
Path(value="/contacts")
@GET
@Consumes
@Produces
@Provider
@QueryParam
@HeaderParam
@MatrixParam
@CookieParam
(see the rest on the javadoc...)
Here a decent example (better than the official doc anyway)
http://blog.aestasit.com/develop-restful-services-like-a-ninja-part-1/
http://blog.aestasit.com/develop-restful-services-like-a-ninja-%E2%80%93-part-2/
JAX-RS = Java API for RESTful Web Services
here http://www.ibm.com/developerworks/webservices/library/wa-jaxrs/index.html general presentation of JAX-RS
The Resteasy doc is here (don't expect complete examples, only code snippets are provided)
http://docs.jboss.org/resteasy/docs/1.0.1.GA/userguide/html/
the annotations are in javax.ws.rs package
Path(value="/contacts")
@GET
@Consumes
@Produces
@Provider
@QueryParam
@HeaderParam
@MatrixParam
@CookieParam
(see the rest on the javadoc...)
Here a decent example (better than the official doc anyway)
Labels:
REST,
Resteasy,
webservices
Monday, May 31, 2010
JRules exposed via Web Services
Typically you have a RuleApp, which contains several RuleSets.
When you produce a RuleSet, you can write several BusinessRules in it.
Here http://publib.boulder.ibm.com/infocenter/brjrules/v7r0m2/index.jsp?topic=/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global800.html it says:
The decision service automatically generates a Web Services Description Language (WSDL) file for each deployed ruleset archive
In our example, helloWorldRuleApp contains helloWorldRuleApp,
and helloWorldRuleApp contains 2 BusinessRule: greetingsItalian and greetingsEnglish.
They will return respectively Buongiorno and Good morning!.
JRules exposes them automatically via Web Services, the endpoint looks like:
http://localhost:8080/DecisionService/ws/helloWorldRuleApp/1.0/greetingsRuleset/1.0
This will fire all the Rules inside the greetingsRuleset.
The result will be:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.ilog.com/rules/DecisionService">
<soapenv:Body>
<DecisionServiceResponse xmlns="http://www.ilog.com/rules/DecisionService">
<ilog.rules.outputString>Buongiorno
Good morning!</ilog.rules.outputString>
<ilog.rules.firedRulesCount>2</ilog.rules.firedRulesCount>
</DecisionServiceResponse>
</soapenv:Body>
</soapenv:Envelope>
that is:
ilog.rules.outputString is the output of all the Rules invoked
ilog.rules.firedRulesCount is the count of the rules fired
The WSDL associated to the Web Service is:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.ilog.com/rules/DecisionService" xmlns:tns="http://www.ilog.com/rules/DecisionService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.ilog.com/rules/DecisionService" xmlns:param="http://www.ilog.com/rules/param" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsd:import namespace="http://www.ilog.com/rules/param"/>
<xsd:element name="DecisionServiceRequest">
<xsd:complexType>
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DecisionServiceResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ilog.rules.outputString" type="xsd:string"/>
<xsd:element name="ilog.rules.firedRulesCount" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DecisionServiceException">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="exception" nillable="false" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema targetNamespace="http://www.ilog.com/rules/param" xmlns:ns0="http://www.ilog.com/rules/param"/>
</wsdl:types>
<wsdl:message name="DecisionServiceSoapResponse">
<wsdl:part name="parameters" element="tns:DecisionServiceResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="DecisionServiceSoapFault">
<wsdl:part name="fault" element="tns:DecisionServiceException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="DecisionServiceSoapRequest">
<wsdl:part name="parameters" element="tns:DecisionServiceRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="DecisionServiceJRulesPVHelloWorld">
<wsdl:operation name="executeDecisionService">
<wsdl:input message="tns:DecisionServiceSoapRequest">
</wsdl:input>
<wsdl:output message="tns:DecisionServiceSoapResponse">
</wsdl:output>
<wsdl:fault name="DecisionServiceSoapFault" message="tns:DecisionServiceSoapFault">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DecisionServiceSOAP" type="tns:DecisionServiceJRulesPVHelloWorld">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="executeDecisionService">
<soap:operation soapAction="executeDecisionService" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DecisionServiceSoapFault">
<soap:fault name="DecisionServiceSoapFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DecisionServiceJRulesPVHelloWorld">
<wsdl:port name="DecisionServiceSOAPesp50ws17206.crb.acme.net" binding="tns:DecisionServiceSOAP">
<soap:address location="http://localhost:8080/DecisionService/ws/helloWorldRuleApp/1.0/greetingsRuleset/1.0"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Let's watch an example where you pass an XML parameter (thank you David Selman for your excellent presentation, but next time can you ask a beautiful girl to show her face instead of yours :O)? We are all men in this business and seing a girl once in a while would help...):
In fact it's all about invoking a Web Service, the video shows how to do it with a Eclipse Plugin and Axis2 Java generated code.
The way I see it is that there is a DecisionService servlet serving all RuleApps and acting as a Proxy to the Rules Engine.
When you produce a RuleSet, you can write several BusinessRules in it.
Here http://publib.boulder.ibm.com/infocenter/brjrules/v7r0m2/index.jsp?topic=/com.ibm.websphere.ilog.jrules.doc/Content/Business_Rules/Documentation/_pubskel/JRules/ps_JRules_Global800.html it says:
The decision service automatically generates a Web Services Description Language (WSDL) file for each deployed ruleset archive
In our example, helloWorldRuleApp contains helloWorldRuleApp,
and helloWorldRuleApp contains 2 BusinessRule: greetingsItalian and greetingsEnglish.
They will return respectively Buongiorno and Good morning!.
JRules exposes them automatically via Web Services, the endpoint looks like:
http://localhost:8080/DecisionService/ws/helloWorldRuleApp/1.0/greetingsRuleset/1.0
This will fire all the Rules inside the greetingsRuleset.
The result will be:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ds="http://www.ilog.com/rules/DecisionService">
<soapenv:Body>
<DecisionServiceResponse xmlns="http://www.ilog.com/rules/DecisionService">
<ilog.rules.outputString>Buongiorno
Good morning!</ilog.rules.outputString>
<ilog.rules.firedRulesCount>2</ilog.rules.firedRulesCount>
</DecisionServiceResponse>
</soapenv:Body>
</soapenv:Envelope>
that is:
ilog.rules.outputString is the output of all the Rules invoked
ilog.rules.firedRulesCount is the count of the rules fired
The WSDL associated to the Web Service is:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.ilog.com/rules/DecisionService" xmlns:tns="http://www.ilog.com/rules/DecisionService" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/">
<wsdl:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="http://www.ilog.com/rules/DecisionService" xmlns:param="http://www.ilog.com/rules/param" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsd:import namespace="http://www.ilog.com/rules/param"/>
<xsd:element name="DecisionServiceRequest">
<xsd:complexType>
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DecisionServiceResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ilog.rules.outputString" type="xsd:string"/>
<xsd:element name="ilog.rules.firedRulesCount" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="DecisionServiceException">
<xsd:complexType>
<xsd:sequence>
<xsd:element maxOccurs="1" minOccurs="1" name="exception" nillable="false" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<xsd:schema targetNamespace="http://www.ilog.com/rules/param" xmlns:ns0="http://www.ilog.com/rules/param"/>
</wsdl:types>
<wsdl:message name="DecisionServiceSoapResponse">
<wsdl:part name="parameters" element="tns:DecisionServiceResponse">
</wsdl:part>
</wsdl:message>
<wsdl:message name="DecisionServiceSoapFault">
<wsdl:part name="fault" element="tns:DecisionServiceException">
</wsdl:part>
</wsdl:message>
<wsdl:message name="DecisionServiceSoapRequest">
<wsdl:part name="parameters" element="tns:DecisionServiceRequest">
</wsdl:part>
</wsdl:message>
<wsdl:portType name="DecisionServiceJRulesPVHelloWorld">
<wsdl:operation name="executeDecisionService">
<wsdl:input message="tns:DecisionServiceSoapRequest">
</wsdl:input>
<wsdl:output message="tns:DecisionServiceSoapResponse">
</wsdl:output>
<wsdl:fault name="DecisionServiceSoapFault" message="tns:DecisionServiceSoapFault">
</wsdl:fault>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="DecisionServiceSOAP" type="tns:DecisionServiceJRulesPVHelloWorld">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="executeDecisionService">
<soap:operation soapAction="executeDecisionService" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="DecisionServiceSoapFault">
<soap:fault name="DecisionServiceSoapFault" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="DecisionServiceJRulesPVHelloWorld">
<wsdl:port name="DecisionServiceSOAPesp50ws17206.crb.acme.net" binding="tns:DecisionServiceSOAP">
<soap:address location="http://localhost:8080/DecisionService/ws/helloWorldRuleApp/1.0/greetingsRuleset/1.0"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Let's watch an example where you pass an XML parameter (thank you David Selman for your excellent presentation, but next time can you ask a beautiful girl to show her face instead of yours :O)? We are all men in this business and seing a girl once in a while would help...):
In fact it's all about invoking a Web Service, the video shows how to do it with a Eclipse Plugin and Axis2 Java generated code.
The way I see it is that there is a DecisionService servlet serving all RuleApps and acting as a Proxy to the Rules Engine.
Labels:
jrules,
webservices
Sunday, May 2, 2010
What is actually posted when you invoke a Web Service?
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "helloAction"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: localhost:7001
Content-Length: 412
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://com/testws/ws" xmlns:java="java:com.testws.data">
<soapenv:Header>
<someHeadersHere/>
</soapenv:Header>
<soapenv:Body>
<ws:hello>
<ws:emp>
<java:Age>34</java:Age>
<java:Name>Ciao</java:Name>
</ws:emp>
</ws:hello>
</soapenv:Body>
</soapenv:Envelope>
Labels:
webservices
Tuesday, March 16, 2010
Web Services Monitoring
I am investigating on existing open source products to monitor web services, at a minimum to detect if there are changes in their WSDL, being able to navigate in their data type schemas, ping them to check if they are available...
given the high number of Web Services we are going to deal with, it's worth to have some sort of registry.
I am testing this
Hyperic http://www.hyperic.com/ this seems to be excellent, but it seems not specific to Web Service (still investigating)
Membrane http://www.membrane-soa.org/
and of course more in general NAGIOS for IT infrastructure monitoring: http://www.nagios.org/
I know of Amberpoint, which seems to be quite good, but it's not opensource.
Please shout if you have already done some investigation on this topic
thanks
given the high number of Web Services we are going to deal with, it's worth to have some sort of registry.
I am testing this
Hyperic http://www.hyperic.com/ this seems to be excellent, but it seems not specific to Web Service (still investigating)
Membrane http://www.membrane-soa.org/
and of course more in general NAGIOS for IT infrastructure monitoring: http://www.nagios.org/
I know of Amberpoint, which seems to be quite good, but it's not opensource.
Please shout if you have already done some investigation on this topic
thanks
Labels:
monitoring,
webservices
Thursday, February 11, 2010
Automating clientgen from Java
package com.acme.integration.tools;
import java.io.File;
import java.util.List;
import weblogic.wsee.tools.WsBuildException;
import weblogic.wsee.tools.clientgen.jaxws.ClientGenImpl;
public class ClientGenTool {
public final static String wls_hostname = "10.10.10.20";
public final static String wls_port = "7001";
public final static String process_name = "/processes/GetPrepaidAccountBalanceProcess";
public final static String clientclass_dir = "output/clientclass";
public static void main(String[] args) throws WsBuildException {
ClientGenTool clientGenTool = new ClientGenTool();
clientGenTool.clientgen();
}
public void clientgen() throws WsBuildException {
String wsdl = "http://" + wls_hostname + ":" + wls_port + "/ACME_INTEG_WEB" + process_name + ".jpd?WSDL";
System.out.println("using wsdl " + wsdl);
File destDir = new File(clientclass_dir);
String packageName = "examples.webservices" + process_name.replace("/", ".");
ClientGenImpl cgi = new ClientGenImpl();
cgi.setWsdl(wsdl);
cgi.setDestDir(destDir);
cgi.setPackageName(packageName);
cgi.execute();
}
}
this will generate the client classes.... it makes our life a lot easier when you have hundreds of Web Services to test....
remember to add tools.jar to the classpath, otherwise the javac compiler will not work.
import java.io.File;
import java.util.List;
import weblogic.wsee.tools.WsBuildException;
import weblogic.wsee.tools.clientgen.jaxws.ClientGenImpl;
public class ClientGenTool {
public final static String wls_hostname = "10.10.10.20";
public final static String wls_port = "7001";
public final static String process_name = "/processes/GetPrepaidAccountBalanceProcess";
public final static String clientclass_dir = "output/clientclass";
public static void main(String[] args) throws WsBuildException {
ClientGenTool clientGenTool = new ClientGenTool();
clientGenTool.clientgen();
}
public void clientgen() throws WsBuildException {
String wsdl = "http://" + wls_hostname + ":" + wls_port + "/ACME_INTEG_WEB" + process_name + ".jpd?WSDL";
System.out.println("using wsdl " + wsdl);
File destDir = new File(clientclass_dir);
String packageName = "examples.webservices" + process_name.replace("/", ".");
ClientGenImpl cgi = new ClientGenImpl();
cgi.setWsdl(wsdl);
cgi.setDestDir(destDir);
cgi.setPackageName(packageName);
cgi.execute();
}
}
this will generate the client classes.... it makes our life a lot easier when you have hundreds of Web Services to test....
remember to add tools.jar to the classpath, otherwise the javac compiler will not work.
Labels:
clientgen,
webservices
Monday, February 8, 2010
WebLogic: invoking web services and clientgen
From your Web Service (or JPD process), generate the WSDL (say HelloWorldSyncContract.WSDL).
In Workshop, Right Click on the WSDL, and do "clientgen": this will generate a HelloWorldSyncContract.jar file.
Put the jar file in the lib directory of your Test project.
You are now ready to code tests.... once you sort our all the NoClassDefFound that you will get... you need to add some 10 modules to your classpath:
Here is a list of modules:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Oracle WebLogic Server v10.3 JRE"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="src" path=".apt_src">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.bea.workshop.wls.j2eelib/wls-commonslogging-bridge-war/exact/1.0"/>
<classpathentry kind="lib" path="lib/CompanyDBWS.jar"/>
<classpathentry kind="lib" path="C:/beaosb/workshop_10.3/weblogic-beehive/lib/controls/weblogic-webservice-control.jar"/>
<classpathentry kind="lib" path="C:/beaosb/workshop_10.3/weblogic-beehive/lib/controls/runtime/weblogic-controls.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/org.apache.beehive_1.0.2.2/apache-beehive-svn-snapshot/lib/controls/beehive-controls.jar"/>
<classpathentry kind="lib" path="C:/beaosb/wlserver_10.3/server/lib/wseeclient.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.descriptor_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.descriptor.j2ee_1.1.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/glassfish.jaxws.rt_2.1.3.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.weblogic.saaj_1.3.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.xml.staxb.runtime_1.3.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.weblogic.workmanager_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.utils.classloaders_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.utils.full_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.logging_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.management.core.binding_2.3.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.management.core_2.3.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.i18n_1.4.0.0.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
I have struggled with JavaClassFinder (precious tool!) to find out all these libraries.
Anyway we have 2 ways:
the JAX-WS
http://download-llnw.oracle.com/docs/cd/E12840_01/wls/docs103/webserv/client.html
and the RPC way
http://download-llnw.oracle.com/docs/cd/E12840_01/wls/docs103/webserv_rpc/client.html
You can learn from WebLogic examples file:///C:/beawli/wlserver_10.3/samples/server/docs/core/index.html
Later note: in fact WebLogic already gives you all the jars you need in the famous
In Workshop, Right Click on the WSDL, and do "clientgen": this will generate a HelloWorldSyncContract.jar file.
Put the jar file in the lib directory of your Test project.
You are now ready to code tests.... once you sort our all the NoClassDefFound that you will get... you need to add some 10 modules to your classpath:
Here is a list of modules:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Oracle WebLogic Server v10.3 JRE"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
<classpathentry kind="src" path=".apt_src">
<attributes>
<attribute name="optional" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.bea.workshop.wls.j2eelib/wls-commonslogging-bridge-war/exact/1.0"/>
<classpathentry kind="lib" path="lib/CompanyDBWS.jar"/>
<classpathentry kind="lib" path="C:/beaosb/workshop_10.3/weblogic-beehive/lib/controls/weblogic-webservice-control.jar"/>
<classpathentry kind="lib" path="C:/beaosb/workshop_10.3/weblogic-beehive/lib/controls/runtime/weblogic-controls.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/org.apache.beehive_1.0.2.2/apache-beehive-svn-snapshot/lib/controls/beehive-controls.jar"/>
<classpathentry kind="lib" path="C:/beaosb/wlserver_10.3/server/lib/wseeclient.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.descriptor_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.descriptor.j2ee_1.1.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/glassfish.jaxws.rt_2.1.3.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.weblogic.saaj_1.3.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.xml.staxb.runtime_1.3.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.weblogic.workmanager_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.utils.classloaders_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.utils.full_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.logging_1.4.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.management.core.binding_2.3.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.management.core_2.3.0.0.jar"/>
<classpathentry kind="lib" path="C:/beaosb/modules/com.bea.core.i18n_1.4.0.0.jar"/>
<classpathentry kind="output" path="build/classes"/>
</classpath>
I have struggled with JavaClassFinder (precious tool!) to find out all these libraries.
Anyway we have 2 ways:
the JAX-WS
http://download-llnw.oracle.com/docs/cd/E12840_01/wls/docs103/webserv/client.html
and the RPC way
http://download-llnw.oracle.com/docs/cd/E12840_01/wls/docs103/webserv_rpc/client.html
You can learn from WebLogic examples file:///C:/beawli/wlserver_10.3/samples/server/docs/core/index.html
Later note: in fact WebLogic already gives you all the jars you need in the famous
wseeclient.zip See herehttp://download.oracle.com/docs/cd/E12840_01/wls/docs103/webserv/client.html#wp229351So.... read carefully documentation before you start chasing things around...
Labels:
clientgen,
webservices
Monday, December 14, 2009
WebLogic WebServices, a quick tutorial
JAX-WS = Java API for XML-based Web Services
is replacing JAX-RPC
it supports SOAP 1.2,
JAXB 2.1(Java Architecture for XML Binding)
attachments with MTOM
EJB 3.0
WS-Security WSS 1.1
A Java Web Service (JWS) contains a @WebService annotation
@WebMethod for each method
@WebParam and @WebResult
@SOAPBinding
these annotations belong to the javax.jws package.
You use the jwsc Ant task to compile it
The WS is available at:
http://host:port/HelloWorldImpl/HelloWorldService?WSDL
HelloWorldImpl=contextPath
HelloWorldService=serviceUri
You can create a Web Service from an existing WSDL file, "the golden WSDL". Use wsdlc to generate the JWS artifacts.
A WSDL is made of:
service has a port, qualified by an address and a
binding (soap, http) which contains a portType, specifying the input and output parameters
message
all these parameters are expressed in the @WebService tag
ClientGenTask is a Ant task which "generates, from an existing WSDL file, the client component files that client applications use to invoke both WebLogic and non-WebLogic Web Services"
http://download.oracle.com/docs/cd/E13222_01/wls/docs92/webserv/anttasks.html#wp1039270
Different styles of binding are possible:
http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
RPC literal, RPC encoded
Document literal, Document encoded
More on how to use annotations:
http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-ws-annotations/doc/how-to-ws-annotations.html
Some useful tutorials:
http://netbeans.org/kb/trails/web.html
is replacing JAX-RPC
it supports SOAP 1.2,
JAXB 2.1(Java Architecture for XML Binding)
attachments with MTOM
EJB 3.0
WS-Security WSS 1.1
A Java Web Service (JWS) contains a @WebService annotation
@WebMethod for each method
@WebParam and @WebResult
@SOAPBinding
these annotations belong to the javax.jws package.
You use the jwsc Ant task to compile it
The WS is available at:
http://host:port/HelloWorldImpl/HelloWorldService?WSDL
HelloWorldImpl=contextPath
HelloWorldService=serviceUri
You can create a Web Service from an existing WSDL file, "the golden WSDL". Use wsdlc to generate the JWS artifacts.
A WSDL is made of:
service has a port, qualified by an address and a
binding (soap, http) which contains a portType, specifying the input and output parameters
message
all these parameters are expressed in the @WebService tag
ClientGenTask is a Ant task which "generates, from an existing WSDL file, the client component files that client applications use to invoke both WebLogic and non-WebLogic Web Services"
http://download.oracle.com/docs/cd/E13222_01/wls/docs92/webserv/anttasks.html#wp1039270
Different styles of binding are possible:
http://www.ibm.com/developerworks/webservices/library/ws-whichwsdl/
RPC literal, RPC encoded
Document literal, Document encoded
More on how to use annotations:
http://www.oracle.com/technology/tech/java/oc4j/1013/how_to/how-to-ws-annotations/doc/how-to-ws-annotations.html
Some useful tutorials:
http://netbeans.org/kb/trails/web.html
Labels:
webservices
Subscribe to:
Posts (Atom)