You are viewing a plain text version of this content. The canonical link for it is here.
Posted to yoko-commits@incubator.apache.org by br...@apache.org on 2006/08/04 17:00:41 UTC
svn commit: r428779 - in /incubator/yoko/trunk:
bindings/src/main/java/org/apache/yoko/bindings/corba/
bindings/src/main/java/org/apache/yoko/bindings/corba/extensions/
bindings/src/test/java/org/apache/yoko/bindings/corba/
distribution/src/main/sample...
Author: bravi
Date: Fri Aug 4 10:00:40 2006
New Revision: 428779
URL: http://svn.apache.org/viewvc?rev=428779&view=rev
Log:
[YOKO-112] - Added the yoko client-server bank demo & also some fixes to the corba binding for handling the out parameters & faults. Removed the dependency on prefix for matching the corba types from the typemap.
Added:
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/README.txt (with props)
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/build.xml (with props)
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/soap/
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/soap/client/
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/soap/server/
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/client/
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/client/Client.java (with props)
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/BankImpl.java (with props)
incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/Server.java (with props)
incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.idl
incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.wsdl (with props)
Modified:
incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingImpl.java
incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaClientBinding.java
incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaServerBinding.java
incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java
incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/extensions/CorbaOperationExtensionHelper.java
incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaBindingImplTest.java
Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingImpl.java?rev=428779&r1=428778&r2=428779&view=diff
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingImpl.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaBindingImpl.java Fri Aug 4 10:00:40 2006
@@ -22,7 +22,6 @@
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.lang.reflect.Constructor;
-import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Collection;
@@ -202,39 +201,8 @@
}
// Handle the parameters that are given for the operation
- int numParams = callback.getParamsLength();
Object[] args = objContext.getMessageObjects();
- List<ParamType> paramTypes = opElement.getParam();
- for (int i = 0; i < numParams; ++i) {
- WebParam param = callback.getWebParam(i);
- Object partValue = args[i];
- if (param.mode() != WebParam.Mode.IN) {
- partValue = ((Holder) args[i]).value;
- }
-
- QName elName = new QName(param.targetNamespace(), param.name());
-
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
- writer.write(partValue, elName, evtWriter);
-
- ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
- XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
- CorbaObjectHolder obj = readCorbaObject(evtReader,
- paramTypes.get(i).getIdltype(),
- false);
-
- CorbaStreamable streamable = new CorbaStreamable(obj, elName);
- ModeType paramMode = paramTypes.get(i).getMode();
- if (paramMode.value().equals("in")) {
- streamable.setMode(org.omg.CORBA.ARG_IN.value);
- } else if (paramMode.value().equals("inout")) {
- streamable.setMode(org.omg.CORBA.ARG_INOUT.value);
- } else if (paramMode.value().equals("out")) {
- streamable.setMode(org.omg.CORBA.ARG_OUT.value);
- }
- corbaCtx.getMessage().addStreamableArgument(streamable);
- }
+ addParams(callback, opElement, corbaCtx, args, inputFactory, outputFactory, writer);
// Check to see if we have an input or output message and handle the return type
// appropriately
@@ -249,15 +217,12 @@
CorbaObjectHolder obj = readCorbaObject(evtReader,
opElement.getReturn().getIdltype(),
false);
-
CorbaStreamable streamable = new CorbaStreamable(obj, callback.getWebResultQName());
corbaCtx.getMessage().setStreamableReturn(streamable);
} else if (isInputMessage && callback.getWebResult() != null) {
QName retName = callback.getWebResultQName();
QName retIdlType = opElement.getReturn().getIdltype();
- TypeCode retTC = CorbaUtils.getTypeCode(orb, retIdlType, typeMaps);
-
- CorbaObjectHolder obj = new CorbaObjectHolder(retName, retIdlType, retTC, null);
+ CorbaObjectHolder obj = createCorbaObjectHolder(retIdlType, retName);
CorbaStreamable streamable = new CorbaStreamable(obj, retName);
corbaCtx.getMessage().setStreamableReturn(streamable);
}
@@ -267,6 +232,66 @@
}
}
+ private void addParams(DataBindingCallback callback,
+ OperationType opElement,
+ CorbaMessageContext corbaCtx,
+ Object[] args,
+ XMLInputFactory inputFactory,
+ XMLOutputFactory outputFactory,
+ DataWriter<XMLEventWriter> writer) throws java.lang.Exception {
+ int numParams = callback.getParamsLength();
+ List<ParamType> paramTypes = opElement.getParam();
+ for (int i = 0; i < numParams; ++i) {
+ WebParam param = callback.getWebParam(i);
+ Object partValue = args[i];
+ if (param.mode() != WebParam.Mode.IN) {
+ partValue = ((Holder) args[i]).value;
+ }
+
+ QName elName = new QName(param.targetNamespace(), param.name());
+
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
+ writer.write(partValue, elName, evtWriter);
+
+ ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
+ XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
+ QName idlType = paramTypes.get(i).getIdltype();
+ CorbaObjectHolder obj;
+ boolean skipRead = false;
+ if (isServer) {
+ if (param.mode() == WebParam.Mode.IN) {
+ skipRead = true;
+ }
+ } else if (param.mode() == WebParam.Mode.OUT) {
+ skipRead = true;
+ }
+ if (skipRead) {
+ obj = createCorbaObjectHolder(idlType, elName);
+ } else {
+ obj = readCorbaObject(evtReader,
+ idlType,
+ false);
+ }
+ CorbaStreamable streamable = new CorbaStreamable(obj, elName);
+ ModeType paramMode = paramTypes.get(i).getMode();
+ if (paramMode.value().equals("in")) {
+ streamable.setMode(org.omg.CORBA.ARG_IN.value);
+ } else if (paramMode.value().equals("inout")) {
+ streamable.setMode(org.omg.CORBA.ARG_INOUT.value);
+ } else if (paramMode.value().equals("out")) {
+ streamable.setMode(org.omg.CORBA.ARG_OUT.value);
+ }
+ corbaCtx.getMessage().addStreamableArgument(streamable);
+ }
+ }
+
+ private CorbaObjectHolder createCorbaObjectHolder(QName idlType, QName elName) {
+ NamedType typeDef = CorbaUtils.getCorbaType(idlType, typeMaps);
+ TypeCode tc = CorbaUtils.getTypeCode(orb, idlType, typeMaps);
+ return new CorbaObjectHolder(elName, idlType, tc, typeDef);
+ }
+
public void marshalFault(ObjectMessageContext objContext,
MessageContext mc,
DataBindingCallback callback) {
@@ -313,7 +338,7 @@
// REVISIT: Note that this assumes that exception names need to be unique. We should make
// sure that this is really the case.
RaisesType raises = i.next();
- if (raises.getException().getLocalPart().equals(faultInfo.getClass().getSimpleName())) {
+ if (raises.getException().getLocalPart().equals(elName.getLocalPart())) {
exIdlType = raises.getException();
}
}
@@ -356,18 +381,28 @@
outputFactory.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, Boolean.TRUE);
for (int i = 0; i < numParams; ++i) {
- ByteArrayOutputStream outStream = new ByteArrayOutputStream();
- XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
- writeCorbaObject(streamables[i].getObject(), evtWriter, null);
- evtWriter.flush();
-
WebParam param = callback.getWebParam(i);
- QName elName = new QName(param.targetNamespace(), param.name());
-
- ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
- XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
- Object obj = reader.read(elName, i, evtReader);
+ Object obj = null;
+ boolean skipRead = false;
+ if (isServer) {
+ if (param.mode() == WebParam.Mode.OUT) {
+ skipRead = true;
+ }
+ } else if (param.mode() == WebParam.Mode.IN) {
+ skipRead = true;
+ }
+ if (!skipRead) {
+ QName elName = new QName(param.targetNamespace(), param.name());
+ ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+ XMLEventWriter evtWriter = outputFactory.createXMLEventWriter(outStream);
+
+ writeCorbaObject(streamables[i].getObject(), evtWriter, null);
+ evtWriter.flush();
+ ByteArrayInputStream inStream = new ByteArrayInputStream(outStream.toByteArray());
+ XMLEventReader evtReader = inputFactory.createXMLEventReader(inStream);
+ obj = reader.read(elName, i, evtReader);
+ }
if (param.mode() != WebParam.Mode.IN) {
args[i].getClass().getField("value").set(args[i], obj);
} else {
@@ -425,8 +460,8 @@
}
try {
- Field exField = exWrapperCls.getDeclaredField("exception");
- Class<?> exCls = exField.getType();
+ Method faultInfoMethod = exWrapperCls.getMethod("getFaultInfo");
+ Class<?> exCls = faultInfoMethod.getReturnType();
Object yokoEx = exCls.newInstance();
CorbaExceptionHandler.unmarshalCorbaException(exObject, yokoEx);
@@ -736,7 +771,7 @@
|| objType instanceof Union
|| objType instanceof Array
|| objType instanceof Sequence) {
- LOG.info("Writing a complex type");
+ LOG.info("Writing a complex type : " + obj.getIdlType());
List<CorbaObjectHolder> members = obj.getNestedObjects();
for (int i = 0; i < members.size(); ++i) {
writeCorbaObject(members.get(i), writer, factory);
Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaClientBinding.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaClientBinding.java?rev=428779&r1=428778&r2=428779&view=diff
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaClientBinding.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaClientBinding.java Fri Aug 4 10:00:40 2006
@@ -118,7 +118,7 @@
throw new CorbaBindingException("Address not a valid CORBA address");
}
- target = orb.string_to_object(address.getLocation());
+ target = CorbaUtils.importObjectReference(orb, address.getLocation());
} catch (java.lang.Exception ex) {
LOG.log(Level.SEVERE, "Could not resolve target object");
throw new WSDLException(WSDLException.OTHER_ERROR, "Could not resolve target object", ex);
@@ -335,7 +335,7 @@
Exception ex = null;
for (Iterator i = typeMaps.iterator(); i.hasNext();) {
CorbaTypeMap tm = (CorbaTypeMap)i.next();
- if (tm.getPrefix().equals(exIdlType.getPrefix())) {
+ if (tm.getTargetNamespace().equals(exIdlType.getNamespaceURI())) {
ex = (Exception)tm.getType(exIdlType.getLocalPart());
break;
}
Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaServerBinding.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaServerBinding.java?rev=428779&r1=428778&r2=428779&view=diff
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaServerBinding.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaServerBinding.java Fri Aug 4 10:00:40 2006
@@ -163,8 +163,7 @@
}
// to match the ORB, file must have complete path information, therefore we add
// a '/' prefix to the address
- iorFile = "/" + iorFile;
-
+ //iorFile = "/" + iorFile;
CorbaUtils.exportObjectReferenceToFile(obj, orb, iorFile);
} else if (location.startsWith("corbaloc")) {
// Try add the key to the boot manager. This is required for a corbaloc
Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java?rev=428779&r1=428778&r2=428779&view=diff
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/CorbaUtils.java Fri Aug 4 10:00:40 2006
@@ -83,15 +83,15 @@
// this means it is not a primitive type
CorbaTypeMap currentMap = null;
for (int i = 0; i < typeMaps.size(); ++i) {
- if (typeMaps.get(i).getPrefix().equals(type.getPrefix())) {
+ if (typeMaps.get(i).getTargetNamespace().equals(type.getNamespaceURI())) {
currentMap = typeMaps.get(i);
break;
}
}
if (currentMap == null) {
- throw new CorbaBindingException("Unable to locate typemap for prefix \""
- + type.getPrefix() + "\"");
+ throw new CorbaBindingException("Unable to locate typemap for namespace \""
+ + type.getNamespaceURI() + "\"");
}
CorbaType obj = currentMap.getType(type.getLocalPart());
@@ -261,7 +261,7 @@
CorbaTypeMap currentMap = null;
for (int i = 0; i < typeMaps.size(); ++i) {
currentMap = typeMaps.get(i);
- if (currentMap.getPrefix().equals(idlType.getPrefix())) {
+ if (currentMap.getTargetNamespace().equals(idlType.getNamespaceURI())) {
// elements in the typemap should also be NamedTypes
return (NamedType) currentMap.getType(idlType.getLocalPart());
}
@@ -286,7 +286,7 @@
if (!isPrimitiveIdlType(memberType) && memberType != null) {
for (int i = 0; i < typeMaps.size(); ++i) {
- if (typeMaps.get(i).getPrefix().equals(memberType.getPrefix())) {
+ if (typeMaps.get(i).getTargetNamespace().equals(memberType.getNamespaceURI())) {
type = (NamedType) typeMaps.get(i).getType(memberType.getLocalPart());
break;
}
@@ -305,7 +305,7 @@
if (!isPrimitiveIdlType(memberType) && memberType != null) {
for (int i = 0; i < typeMaps.size(); ++i) {
- if (typeMaps.get(i).getPrefix().equals(memberType.getPrefix())) {
+ if (typeMaps.get(i).getTargetNamespace().equals(memberType.getNamespaceURI())) {
type = (NamedType)typeMaps.get(i).getType(memberType.getLocalPart());
break;
}
@@ -319,7 +319,7 @@
if (!isPrimitiveIdlType(arrayIdlType) && arrayIdlType != null) {
for (int i = 0; i < typeMaps.size(); ++i) {
- if (typeMaps.get(i).getPrefix().equals(arrayIdlType.getPrefix())) {
+ if (typeMaps.get(i).getTargetNamespace().equals(arrayIdlType.getNamespaceURI())) {
type = (NamedType)typeMaps.get(i).getType(arrayIdlType.getLocalPart());
break;
}
@@ -442,6 +442,48 @@
out.println(ref);
out.flush();
file.close();
+ }
+
+ public static org.omg.CORBA.Object importObjectReference(ORB orb,
+ String url) {
+ org.omg.CORBA.Object result;
+
+ if (url.startsWith("file:")) {
+ return importObjectReferenceFromFile(orb, url.substring(5));
+ } else if ((url.equals("ior:")) || (url.equals("IOR:"))) {
+ throw new RuntimeException("Proxy not initialized. URL contains a invalid ior");
+ }
+
+ try {
+ result = orb.string_to_object(url.trim());
+ } catch (java.lang.Exception ex) {
+ throw new RuntimeException(ex);
+ }
+
+ return result;
+ }
+
+ public static org.omg.CORBA.Object importObjectReferenceFromFile(ORB orb,
+ String url) {
+ org.omg.CORBA.Object result;
+
+ try {
+ java.io.File file = new java.io.File(url);
+ if (!file.exists()) {
+ throw new RuntimeException("Could not find file "
+ + url
+ + " to read the object reference");
+ }
+ java.io.BufferedReader reader = new java.io.BufferedReader(new java.io.FileReader(file));
+ String ior = reader.readLine();
+ if (ior == null) {
+ throw new RuntimeException("Invalid object reference found in file " + url);
+ }
+ result = orb.string_to_object(ior.trim());
+ } catch (java.lang.Exception ex) {
+ throw new RuntimeException(ex);
+ }
+ return result;
}
static {
Modified: incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/extensions/CorbaOperationExtensionHelper.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/extensions/CorbaOperationExtensionHelper.java?rev=428779&r1=428778&r2=428779&view=diff
==============================================================================
--- incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/extensions/CorbaOperationExtensionHelper.java (original)
+++ incubator/yoko/trunk/bindings/src/main/java/org/apache/yoko/bindings/corba/extensions/CorbaOperationExtensionHelper.java Fri Aug 4 10:00:40 2006
@@ -82,11 +82,7 @@
} else if (paramAttrNode.getNodeName().equals("mode")) {
param.setMode(ModeType.fromValue(paramAttrNode.getNodeValue()));
} else if (paramAttrNode.getNodeName().equals("idltype")) {
- String idlType = paramAttrNode.getNodeValue();
- int seperatorIndex = idlType.indexOf(':');
- String prefix = idlType.substring(0, seperatorIndex);
- String localPart = idlType.substring(seperatorIndex + 1, idlType.length());
- param.setIdltype(new QName(def.getNamespace(prefix), localPart, prefix));
+ param.setIdltype(getIdlTypeName(def, paramAttrNode, currentNode));
}
}
opType.getParam().add(param);
@@ -97,11 +93,7 @@
for (int j = 0; j < retAttributes.getLength(); ++j) {
Node retAttrNode = retAttributes.item(j);
if (retAttrNode.getNodeName().equals("idltype")) {
- String idlType = retAttrNode.getNodeValue();
- int seperatorIndex = idlType.indexOf(':');
- String prefix = idlType.substring(0, seperatorIndex);
- String localPart = idlType.substring(seperatorIndex + 1, idlType.length());
- ret.setIdltype(new QName(def.getNamespace(prefix), localPart, prefix));
+ ret.setIdltype(getIdlTypeName(def, retAttrNode, currentNode));
}
}
opType.setReturn(ret);
@@ -112,11 +104,7 @@
for (int j = 0; j < raiseAttributes.getLength(); ++j) {
Node raiseAttrNode = raiseAttributes.item(j);
if (raiseAttrNode.getNodeName().equals("exception")) {
- String idlType = raiseAttrNode.getNodeValue();
- int seperatorIndex = idlType.indexOf(':');
- String prefix = idlType.substring(0, seperatorIndex);
- String localPart = idlType.substring(seperatorIndex + 1, idlType.length());
- raises.setException(new QName(def.getNamespace(prefix), localPart, prefix));
+ raises.setException(getIdlTypeName(def, raiseAttrNode, currentNode));
}
}
opType.getRaises().add(raises);
@@ -124,5 +112,17 @@
// anything else we are not interested in at the moment
}
return opType;
+ }
+
+ private QName getIdlTypeName(Definition def, Node node, Node parent) {
+ String type = node.getNodeValue();
+ int seperatorIndex = type.indexOf(':');
+ String prefix = null;
+ if (seperatorIndex != -1) {
+ prefix = type.substring(0, seperatorIndex);
+ }
+ String localPart = type.substring(seperatorIndex + 1, type.length());
+ String nsURI = parent.lookupNamespaceURI(prefix);
+ return new QName(nsURI, localPart);
}
}
Modified: incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaBindingImplTest.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaBindingImplTest.java?rev=428779&r1=428778&r2=428779&view=diff
==============================================================================
--- incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaBindingImplTest.java (original)
+++ incubator/yoko/trunk/bindings/src/test/java/org/apache/yoko/bindings/corba/CorbaBindingImplTest.java Fri Aug 4 10:00:40 2006
@@ -119,7 +119,7 @@
manager.registerBinding(CorbaConstants.NU_WSDL_CORBA, corbaBF);
EndpointReferenceType endpoint = testUtils.getEndpointReference();
- CorbaBindingImpl bindingImpl = new CorbaBindingImpl(bus, endpoint, orb, false);
+ CorbaBindingImpl bindingImpl = new CorbaBindingImpl(bus, endpoint, orb, true);
corbaContext.put(ObjectMessageContext.MESSAGE_INPUT, true);
QName paramName = new QName("param1");
@@ -142,10 +142,11 @@
Object[] arguments = objContext.getMessageObjects();
assertNotNull(arguments);
assertTrue(arguments.length == 1);
-
+
Object o = arguments[0];
assertTrue(o instanceof String);
String param1 = (String)o;
assertTrue(param1.equals("TestString"));
+
}
}
Added: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/README.txt
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank/README.txt?rev=428779&view=auto
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank/README.txt (added)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank/README.txt Fri Aug 4 10:00:40 2006
@@ -0,0 +1,101 @@
+Bank Demo
+================
+
+Prerequisites
+=============
+
+If your environment already includes yoko.jar on the
+CLASSPATH, and the JDK and ant bin directories on the PATH
+it is not necessary to run the environment script described in
+the samples directory README. If your environment is not
+properly configured, or if you are planning on using wsdl2idl/idl2wsdl,
+javac, and java to build and run the demos, you must include the yoko.jar
+in the CLASSPATH. Also set YOKO_HOME to the installation directory.
+
+Demo Use Cases
+==============
+
+This demo allows the user to run three use cases.
+
+- Case 1: Web services client & Web services server.
+
+ In this use case, a Web services client talks to a Web services server
+through the IIOP protocol. Both the client and the server are implemented using
+the celtix Web services framework and the IIOP protocol is enabled by installing
+the Yoko CORBA binding into celtix.
+
+ Note: celtix is _not_ part of the Yoko product, but a celtix kit is bundled
+with Yoko for convenience of testing and running the Web services demos.
+
+- Case 2: SOAP web services client & Web services server through a Router.
+
+ In this use case, a Celtix Soap client talks to a Web services server through the
+router.
+
+This use case illustrates how a Web service can be made accessible to SOAP clients.
+
+
+Building the Demo
+=================
+
+To build the demo code, perform the following steps:
+
+1. Open a command prompt and move into the directory <YOKO_HOME>/samples/ws/bank
+
+2. From the samples/ws/bank directory, enter the following command (UNIX or Windows):
+
+ ant
+
+ This command uses the celtix wsdl2java utility to generate the server & client code.
+
+
+Running the Demo - Use Case 1
+=============================
+
+To run the demo for the first use case, perform the following steps:
+
+1. Open a command prompt and move into the directory <YOKO_HOME>/samples/ws/bank
+
+2. Enter the following command to start the server (on a single command line):
+
+ UNIX (must use forward slashes):
+
+ java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-core-1.0-incubating-M1-SNAPSHOT.jar
+ -Dceltix.config.file=file:$YOKO_HOME/samples/ws/etc/corba_bus_config.xml
+ -classpath $CLASSPATH:build/classes yoko.server.Server &
+
+ Windows (may use either forward or back slashes):
+
+ start java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-core-1.0-incubating-M1-SNAPSHOT.jar
+ -Dceltix.config.file=file:/%YOKO_HOME%\samples\ws\etc\corba_bus_config.xml
+ -classpath %CLASSPATH%;build\classes yoko.server.Server
+
+ The server process starts in the background. We have to set the Xbootclasspath,
+ because the ORB classes in Yoko conflict with the JDK ORB classes.
+
+3. Enter the following command to start the client:
+
+ UNIX:
+
+ java -Xbootclasspath/p:$YOKO_HOME/lib/yoko-core-1.0-incubating-M1-SNAPSHOT.jar
+ -Dceltix.config.file=file:$YOKO_HOME/samples/ws/etc/corba_bus_config.xml
+ -classpath $CLASSPATH:build/classes yoko.client.Client
+
+ Windows:
+
+ java -Xbootclasspath/p:%YOKO_HOME%\lib\yoko-core-1.0-incubating-M1-SNAPSHOT.jar
+ -Dceltix.config.file=file:/%YOKO_HOME%\samples\ws\etc\corba_bus_config.xml
+ -classpath %CLASSPATH%;build\classes yoko.client.Client
+
+4. After running the client, use the kill command to terminate the server process (UNIX) or
+ type Ctrl-C in the server's command window (Windows).
+
+
+Cleanup
+=======
+
+To remove the code generated from the WSDL file and the .class
+files, either delete the build directory and its contents or run:
+
+ ant clean
+
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/README.txt
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/README.txt
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/build.xml
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank/build.xml?rev=428779&view=auto
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank/build.xml (added)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank/build.xml Fri Aug 4 10:00:40 2006
@@ -0,0 +1,98 @@
+<?xml version="1.0"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<project name="Bank demo" default="build" basedir=".">
+
+ <property environment="env"/>
+ <property name="build.dir" location ="${basedir}/build"/>
+ <property name="build.src.dir" location ="${basedir}/build/src"/>
+ <property name="build.classes.dir" location ="${build.dir}/classes"/>
+
+ <!-- Determine yoko.home, either from the environment variable YOKO_HOME
+ - or using ../..
+ -->
+ <condition property="yoko.home" value="${env.YOKO_HOME}">
+ <isset property="env.YOKO_HOME"/>
+ </condition>
+ <property name="yoko.home" location="../../.."/>
+
+ <path id="yoko.classpath">
+ <pathelement location="${build.classes.dir}"/>
+ <pathelement location="${yoko.home}/lib/yoko.jar"/>
+ </path>
+
+ <target name="build" depends="generate.server.code, generate.client.code">
+ <javac destdir="${build.classes.dir}" debug="true">
+ <src path="${basedir}/src"/>
+ <src path="${build.src.dir}"/>
+ <classpath>
+ <path refid="yoko.classpath"/>
+ <pathelement path="${thirdparty.classpath}"/>
+ </classpath>
+ </javac>
+ </target>
+
+ <target name="generate.server.code">
+ <echo level="info" message="Generating server code using wsdl2java..."/>
+ <wsdl2java file="../resources/bank.wsdl" package="bank.server" />
+ </target>
+
+ <target name="generate.client.code">
+ <echo level="info" message="Generating client code using wsdl2java..."/>
+ <wsdl2java file="../resources/bank.wsdl" package="bank.client" />
+ </target>
+
+ <target name="clean">
+ <delete dir="${build.classes.dir}"/>
+ <delete dir="${build.src.dir}"/>
+ </target>
+
+ <!-- move this to a common place, once we have more demos that use this -->
+ <macrodef name="wsdl2corba">
+ <attribute name="file"/>
+ <attribute name="extraArgs" default=""/>
+ <sequential>
+ <java failonerror="true" classname="org.apache.yoko.tools.WSDLToIDL" fork="yes">
+ <classpath>
+ <path refid="yoko.classpath" />
+ </classpath>
+ <arg line="@{extraArgs} -d ${basedir} -corba @{file}"/>
+ </java>
+ </sequential>
+ </macrodef>
+
+ <macrodef name="wsdl2java">
+ <attribute name="srcdestdir" default="${build.src.dir}"/>
+ <attribute name="destdir" default="${build.classes.dir}"/>
+ <attribute name="file"/>
+ <attribute name="bindingfile" default=""/>
+ <attribute name="package" default="NOT_SPECIFIED"/>
+ <attribute name="extraArgs" default=""/>
+ <sequential>
+ <mkdir dir="@{srcdestdir}"/>
+ <mkdir dir="@{destdir}"/>
+ <java failonerror="true" classname="org.objectweb.celtix.tools.WSDLToJava" fork="yes">
+ <classpath>
+ <path refid="yoko.classpath" />
+ </classpath>
+ <arg line="-p @{package} @{extraArgs} -d @{srcdestdir} @{file}"/>
+ </java>
+ </sequential>
+ </macrodef>
+</project>
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/build.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/build.xml
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/build.xml
------------------------------------------------------------------------------
svn:mime-type = text/xml
Added: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/client/Client.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/client/Client.java?rev=428779&view=auto
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/client/Client.java (added)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/client/Client.java Fri Aug 4 10:00:40 2006
@@ -0,0 +1,86 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+package yoko.client;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import javax.xml.namespace.QName;
+
+import bank.client.Account;
+import bank.client.AccountAlreadyExistsException;
+import bank.client.AccountNotFoundException;
+import bank.client.Bank;
+import bank.client.BankCORBAService;
+
+public final class Client {
+
+ private static final QName SERVICE_NAME = new QName("http://schemas.apache.org/yoko/idl/bank", "BankCORBAService");
+
+ private Client() {
+ }
+
+ public static void main(String args[]) throws Exception {
+ URL wsdlUrl = new URL("file:./../resources/bank.wsdl");
+
+ BankCORBAService ss = new BankCORBAService(wsdlUrl, SERVICE_NAME);
+ Bank port = ss.getBankCORBAPort();
+
+
+ System.out.print("Invoking createAccount for Mr. John... ");
+ javax.xml.ws.Holder<Account> account = new javax.xml.ws.Holder<Account>(new Account());
+ try {
+ if (port.createAccount("John", account)) {
+ System.out.println("success");
+ } else {
+ System.out.println("failure (Unknown)");
+ }
+ } catch (AccountAlreadyExistsException ex) {
+ System.out.println("failure (" + ex.getMessage() + " : " + ex.getFaultInfo().getName() + ")");
+ }
+
+ Account bankAccount = account.value;
+ if (bankAccount != null) {
+ System.out.println("Created Account : " + bankAccount);
+ }
+
+ System.out.println("Getting Mr. John's account...");
+ try {
+ bankAccount = port.getAccount("John");
+ if (bankAccount != null) {
+ System.out.println("success");
+ } else {
+ System.out.println("failure");
+ }
+ } catch (AccountNotFoundException ex) {
+ System.out.println("failure (" + ex.getMessage() + " : " + ex.getFaultInfo().getName() + ")");
+ }
+
+ System.out.println("Getting an non-existent account (Ms. Helen)...");
+ try {
+ bankAccount = port.getAccount("Helen");
+ } catch (AccountNotFoundException ex) {
+ System.out.println("Caught the expected AccountNotFoundException(" + ex.getFaultInfo().getName() + ")");
+ }
+
+ System.exit(0);
+ }
+
+}
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/client/Client.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/client/Client.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/BankImpl.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/BankImpl.java?rev=428779&view=auto
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/BankImpl.java (added)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/BankImpl.java Fri Aug 4 10:00:40 2006
@@ -0,0 +1,76 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+package yoko.server;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.logging.Logger;
+import javax.jws.WebMethod;
+import javax.jws.WebResult;
+
+import bank.server.Account;
+import bank.server.AccountAlreadyExistsException;
+import bank.server.AccountAlreadyExistsExceptionType;
+import bank.server.AccountNotFoundException;
+import bank.server.AccountNotFoundExceptionType;
+import bank.server.Bank;
+
+@javax.jws.WebService(name = "Bank", serviceName = "BankCORBAService",
+ targetNamespace = "http://schemas.apache.org/yoko/idl/bank",
+ wsdlLocation = "file:./../resources/bank.wsdl")
+
+public class BankImpl implements Bank {
+
+ private static final Logger LOG =
+ Logger.getLogger(BankImpl.class.getPackage().getName());
+
+ Map<String,Account> accounts = new HashMap<String,Account>();
+
+ public boolean createAccount(String name, javax.xml.ws.Holder<Account> account)
+ throws AccountAlreadyExistsException {
+ LOG.info("Executing operation createAccount");
+ boolean result = false;
+ if (accounts.get(name) == null) {
+ account.value = new Account();
+ account.value.setName(name);
+ account.value.setBalance(100);
+ accounts.put(name, account.value);
+ result = true;
+ } else {
+ AccountAlreadyExistsExceptionType ex = new AccountAlreadyExistsExceptionType();
+ ex.setName(name);
+ throw new AccountAlreadyExistsException("Account Already Exists", ex);
+ }
+ return result;
+ }
+
+ public Account getAccount(String name) throws AccountNotFoundException {
+ LOG.info("Executing operation getAccount");
+ Account result = accounts.get(name);
+ if (result == null) {
+ AccountNotFoundExceptionType ex = new AccountNotFoundExceptionType();
+ ex.setName(name);
+ throw new AccountNotFoundException("Account Not Found", ex);
+ }
+ LOG.info("getAccount return : " + result);
+ return result;
+ }
+
+}
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/BankImpl.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/BankImpl.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/Server.java
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/Server.java?rev=428779&view=auto
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/Server.java (added)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/Server.java Fri Aug 4 10:00:40 2006
@@ -0,0 +1,44 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+package yoko.server;
+
+import javax.xml.ws.Endpoint;
+
+public class Server {
+
+ protected Server() throws Exception {
+ System.out.println("Starting Server");
+
+ Object implementor = new BankImpl();
+ String address = "file:./bank.ref";
+ Endpoint endpoint = Endpoint.create("http://schemas.apache.org/yoko/bindings/corba",
+ implementor);
+ endpoint.publish(address);
+ }
+
+ public static void main(String args[]) throws Exception {
+ new Server();
+ System.out.println("Server ready...");
+
+ Thread.sleep(5 * 60 * 1000);
+ System.out.println("Server exiting");
+ System.exit(0);
+ }
+}
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/Server.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/bank/src/yoko/server/Server.java
------------------------------------------------------------------------------
svn:keywords = Rev Date
Added: incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.idl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.idl?rev=428779&view=auto
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.idl (added)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.idl Fri Aug 4 10:00:40 2006
@@ -0,0 +1,47 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+*/
+
+module yoko {
+
+ //change this to an interface once we support corba:object & wsa references.
+ struct Account {
+ string name;
+ long balance;
+ };
+
+ exception AccountNotFoundException {
+ string name;
+ };
+
+ exception AccountAlreadyExistsException {
+ string name;
+ };
+
+ interface Bank {
+ Account
+ getAccount(
+ in string name
+ ) raises (AccountNotFoundException);
+
+ boolean
+ createAccount(
+ in string name, out Account account
+ ) raises (AccountAlreadyExistsException);
+ };
+};
Added: incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.wsdl
URL: http://svn.apache.org/viewvc/incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.wsdl?rev=428779&view=auto
==============================================================================
--- incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.wsdl (added)
+++ incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.wsdl Fri Aug 4 10:00:40 2006
@@ -0,0 +1,192 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+-->
+<wsdl:definitions targetNamespace="http://schemas.apache.org/yoko/idl/bank" xmlns:tns="http://schemas.apache.org/yoko/idl/bank" xmlns:corba="http://schemas.apache.org/yoko/bindings/corba" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
+ <corba:typeMapping targetNamespace="http://schemas.apache.org/yoko/idl/bank/typemap">
+ <corba:struct xmlns:ns4="http://schemas.apache.org/yoko/idl/bank" xmlns="http://schemas.apache.org/yoko/idl/bank/typemap" repositoryID="IDL:Account:1.0" name="Account" type="ns4:Account">
+ <corba:member name="name" idltype="corba:string" />
+ <corba:member name="balance" idltype="corba:long" />
+ </corba:struct>
+ <corba:exception xmlns:ns4="http://schemas.apache.org/yoko/idl/bank" xmlns="http://schemas.apache.org/yoko/idl/bank/typemap" repositoryID="IDL:AccountNotFoundException:1.0" name="AccountNotFoundException" type="ns4:AccountNotFoundExceptionType">
+ <corba:member name="name" idltype="corba:string" />
+ </corba:exception>
+ <corba:exception xmlns:ns4="http://schemas.apache.org/yoko/idl/bank" xmlns="http://schemas.apache.org/yoko/idl/bank/typemap" repositoryID="IDL:AccountAlreadyExistsException:1.0" name="AccountAlreadyExistsException" type="ns4:AccountAlreadyExistsExceptionType">
+ <corba:member name="name" idltype="corba:string" />
+ </corba:exception>
+ </corba:typeMapping>
+ <wsdl:types>
+ <xs:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://schemas.apache.org/yoko/idl/bank" xmlns="http://schemas.apache.org/yoko/idl/bank" xmlns:xs="http://www.w3.org/2001/XMLSchema">
+ <xs:complexType name="Account">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ <xs:element name="balance" type="xs:int">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="AccountNotFoundException" type="AccountNotFoundExceptionType">
+ </xs:element>
+ <xs:complexType name="AccountNotFoundExceptionType">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="AccountAlreadyExistsException" type="AccountAlreadyExistsExceptionType">
+ </xs:element>
+ <xs:complexType name="AccountAlreadyExistsExceptionType">
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ <xs:element name="getAccountResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="return" type="Account">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="getAccount">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="createAccountResponse">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="return" type="xs:boolean">
+ </xs:element>
+ <xs:element name="account" type="Account">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="createAccount">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element name="name" type="xs:string">
+ </xs:element>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ </xs:schema>
+ </wsdl:types>
+ <wsdl:message name="createAccount">
+ <wsdl:part name="inparameter" element="tns:createAccount"/>
+ </wsdl:message>
+ <wsdl:message name="createAccountResponse">
+ <wsdl:part name="outparameter" element="tns:createAccountResponse"/>
+ </wsdl:message>
+ <wsdl:message name="getAccount">
+ <wsdl:part name="inparameter" element="tns:getAccount"/>
+ </wsdl:message>
+ <wsdl:message name="AccountAlreadyExistsException">
+ <wsdl:part name="exception" element="tns:AccountAlreadyExistsException"/>
+ </wsdl:message>
+ <wsdl:message name="AccountNotFoundException">
+ <wsdl:part name="exception" element="tns:AccountNotFoundException"/>
+ </wsdl:message>
+ <wsdl:message name="getAccountResponse">
+ <wsdl:part name="outparameter" element="tns:getAccountResponse"/>
+ </wsdl:message>
+ <wsdl:portType name="Bank">
+ <wsdl:operation name="getAccount">
+ <wsdl:input name="getAccountRequest" message="tns:getAccount"/>
+ <wsdl:output name="getAccountResponse" message="tns:getAccountResponse"/>
+ <wsdl:fault name="AccountNotFoundException" message="tns:AccountNotFoundException"/>
+ </wsdl:operation>
+ <wsdl:operation name="createAccount">
+ <wsdl:input name="createAccountRequest" message="tns:createAccount"/>
+ <wsdl:output name="createAccountResponse" message="tns:createAccountResponse"/>
+ <wsdl:fault name="AccountAlreadyExistsException" message="tns:AccountAlreadyExistsException"/>
+ </wsdl:operation>
+ </wsdl:portType>
+ <wsdl:binding name="BankSOAPBinding" type="tns:Bank">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
+ <wsdl:operation name="getAccount">
+ <soap:operation soapAction="" style="document" />
+ <wsdl:input name="getAccountRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="getAccountResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AccountNotFoundException">
+ <soap:fault name="AccountNotFoundException" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="createAccount">
+ <soap:operation name="createAccount" />
+ <wsdl:input name="createAccountRequest">
+ <soap:body use="literal"/>
+ </wsdl:input>
+ <wsdl:output name="createAccountResponse">
+ <soap:body use="literal"/>
+ </wsdl:output>
+ <wsdl:fault name="AccountAlreadyExistsException">
+ <soap:fault name="AccountAlreadyExistsException" use="literal"/>
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:binding name="BankCORBABinding" type="tns:Bank">
+ <corba:binding repositoryID="IDL:yoko/Bank:1.0" />
+ <wsdl:operation name="getAccount">
+ <corba:operation name="getAccount">
+ <corba:param mode="in" name="name" idltype="corba:string" />
+ <corba:return xmlns="http://schemas.apache.org/yoko/idl/bank/typemap" name="return" idltype="Account" />
+ <corba:raises xmlns="http://schemas.apache.org/yoko/idl/bank/typemap" exception="AccountNotFoundException" />
+ </corba:operation>
+ <wsdl:input name="getAccountRequest">
+ </wsdl:input>
+ <wsdl:output name="getAccountResponse">
+ </wsdl:output>
+ <wsdl:fault name="AccountNotFoundException">
+ </wsdl:fault>
+ </wsdl:operation>
+ <wsdl:operation name="createAccount">
+ <corba:operation name="createAccount">
+ <corba:param mode="in" name="name" idltype="corba:string" />
+ <corba:param xmlns="http://schemas.apache.org/yoko/idl/bank/typemap" mode="out" name="account" idltype="Account" />
+ <corba:return name="return" idltype="corba:boolean" />
+ <corba:raises xmlns="http://schemas.apache.org/yoko/idl/bank/typemap" exception="AccountAlreadyExistsException" />
+ </corba:operation>
+ <wsdl:input name="createAccountRequest">
+ </wsdl:input>
+ <wsdl:output name="createAccountResponse">
+ </wsdl:output>
+ <wsdl:fault name="AccountAlreadyExistsException">
+ </wsdl:fault>
+ </wsdl:operation>
+ </wsdl:binding>
+ <wsdl:service name="BankSOAPService">
+ <wsdl:port name="BankSOAPPort" binding="tns:BankSOAPBinding">
+ <soap:address location="http://localhost:10000/bank/BankSOAPService" />
+ </wsdl:port>
+ </wsdl:service>
+ <wsdl:service name="BankCORBAService">
+ <wsdl:port name="BankCORBAPort" binding="tns:BankCORBABinding">
+ <corba:address location="file:./bank.ref" />
+ </wsdl:port>
+ </wsdl:service>
+</wsdl:definitions>
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.wsdl
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.wsdl
------------------------------------------------------------------------------
svn:keywords = Rev Date
Propchange: incubator/yoko/trunk/distribution/src/main/samples/ws/resources/bank.wsdl
------------------------------------------------------------------------------
svn:mime-type = text/xml