Updated Branches: refs/heads/ode-1.3.6.x 61ea379c0 -> f55603d45
http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/java/com/intalio/ws/timeservice/GetUTCTimeResponse.java ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/java/com/intalio/ws/timeservice/GetUTCTimeResponse.java b/axis2-war/src/test/java/com/intalio/ws/timeservice/GetUTCTimeResponse.java new file mode 100644 index 0000000..99f4eff --- /dev/null +++ b/axis2-war/src/test/java/com/intalio/ws/timeservice/GetUTCTimeResponse.java @@ -0,0 +1,497 @@ + +/** + * GetUTCTimeResponse.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:34 EDT) + */ + + package com.intalio.ws.timeservice; + + + /** + * GetUTCTimeResponse bean class + */ + + public class GetUTCTimeResponse + implements org.apache.axis2.databinding.ADBBean{ + + public static final javax.xml.namespace.QName MY_QNAME = new javax.xml.namespace.QName( + "http://ws.intalio.com/TimeService/", + "getUTCTimeResponse", + "ns1"); + + + + private static java.lang.String generatePrefix(java.lang.String namespace) { + if(namespace.equals("http://ws.intalio.com/TimeService/")){ + return "ns1"; + } + return org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + + + /** + * field for GetUTCTimeResult + */ + + + protected java.lang.String localGetUTCTimeResult ; + + /* This tracker boolean wil be used to detect whether the user called the set method + * for this attribute. It will be used to determine whether to include this field + * in the serialized XML + */ + protected boolean localGetUTCTimeResultTracker = false ; + + + /** + * Auto generated getter method + * @return java.lang.String + */ + public java.lang.String getGetUTCTimeResult(){ + return localGetUTCTimeResult; + } + + + + /** + * Auto generated setter method + * @param param GetUTCTimeResult + */ + public void setGetUTCTimeResult(java.lang.String param){ + + if (param != null){ + //update the setting tracker + localGetUTCTimeResultTracker = true; + } else { + localGetUTCTimeResultTracker = false; + + } + + this.localGetUTCTimeResult=param; + + + } + + + /** + * isReaderMTOMAware + * @return true if the reader supports MTOM + */ + public static boolean isReaderMTOMAware(javax.xml.stream.XMLStreamReader reader) { + boolean isReaderMTOMAware = false; + + try{ + isReaderMTOMAware = java.lang.Boolean.TRUE.equals(reader.getProperty(org.apache.axiom.om.OMConstants.IS_DATA_HANDLERS_AWARE)); + }catch(java.lang.IllegalArgumentException e){ + isReaderMTOMAware = false; + } + return isReaderMTOMAware; + } + + + /** + * + * @param parentQName + * @param factory + * @return org.apache.axiom.om.OMElement + */ + public org.apache.axiom.om.OMElement getOMElement ( + final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory) throws org.apache.axis2.databinding.ADBException{ + + + + org.apache.axiom.om.OMDataSource dataSource = + new org.apache.axis2.databinding.ADBDataSource(this,MY_QNAME){ + + public void serialize(org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + GetUTCTimeResponse.this.serialize(MY_QNAME,factory,xmlWriter); + } + }; + return new org.apache.axiom.om.impl.llom.OMSourcedElementImpl( + MY_QNAME,factory,dataSource); + + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + serialize(parentQName,factory,xmlWriter,false); + } + + public void serialize(final javax.xml.namespace.QName parentQName, + final org.apache.axiom.om.OMFactory factory, + org.apache.axis2.databinding.utils.writer.MTOMAwareXMLStreamWriter xmlWriter, + boolean serializeType) + throws javax.xml.stream.XMLStreamException, org.apache.axis2.databinding.ADBException{ + + + + + java.lang.String prefix = null; + java.lang.String namespace = null; + + + prefix = parentQName.getPrefix(); + namespace = parentQName.getNamespaceURI(); + + if ((namespace != null) && (namespace.trim().length() > 0)) { + java.lang.String writerPrefix = xmlWriter.getPrefix(namespace); + if (writerPrefix != null) { + xmlWriter.writeStartElement(namespace, parentQName.getLocalPart()); + } else { + if (prefix == null) { + prefix = generatePrefix(namespace); + } + + xmlWriter.writeStartElement(prefix, parentQName.getLocalPart(), namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + } else { + xmlWriter.writeStartElement(parentQName.getLocalPart()); + } + + if (serializeType){ + + + java.lang.String namespacePrefix = registerPrefix(xmlWriter,"http://ws.intalio.com/TimeService/"); + if ((namespacePrefix != null) && (namespacePrefix.trim().length() > 0)){ + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + namespacePrefix+":getUTCTimeResponse", + xmlWriter); + } else { + writeAttribute("xsi","http://www.w3.org/2001/XMLSchema-instance","type", + "getUTCTimeResponse", + xmlWriter); + } + + + } + if (localGetUTCTimeResultTracker){ + namespace = "http://ws.intalio.com/TimeService/"; + if (! namespace.equals("")) { + prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + xmlWriter.writeStartElement(prefix,"getUTCTimeResult", namespace); + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } else { + xmlWriter.writeStartElement(namespace,"getUTCTimeResult"); + } + + } else { + xmlWriter.writeStartElement("getUTCTimeResult"); + } + + + if (localGetUTCTimeResult==null){ + // write the nil attribute + + throw new org.apache.axis2.databinding.ADBException("getUTCTimeResult cannot be null!!"); + + }else{ + + + xmlWriter.writeCharacters(localGetUTCTimeResult); + + } + + xmlWriter.writeEndElement(); + } + xmlWriter.writeEndElement(); + + + } + + /** + * Util method to write an attribute with the ns prefix + */ + private void writeAttribute(java.lang.String prefix,java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (xmlWriter.getPrefix(namespace) == null) { + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + + } + + xmlWriter.writeAttribute(namespace,attName,attValue); + + } + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeAttribute(java.lang.String namespace,java.lang.String attName, + java.lang.String attValue,javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException{ + if (namespace.equals("")) + { + xmlWriter.writeAttribute(attName,attValue); + } + else + { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace,attName,attValue); + } + } + + + /** + * Util method to write an attribute without the ns prefix + */ + private void writeQNameAttribute(java.lang.String namespace, java.lang.String attName, + javax.xml.namespace.QName qname, javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + java.lang.String attributeNamespace = qname.getNamespaceURI(); + java.lang.String attributePrefix = xmlWriter.getPrefix(attributeNamespace); + if (attributePrefix == null) { + attributePrefix = registerPrefix(xmlWriter, attributeNamespace); + } + java.lang.String attributeValue; + if (attributePrefix.trim().length() > 0) { + attributeValue = attributePrefix + ":" + qname.getLocalPart(); + } else { + attributeValue = qname.getLocalPart(); + } + + if (namespace.equals("")) { + xmlWriter.writeAttribute(attName, attributeValue); + } else { + registerPrefix(xmlWriter, namespace); + xmlWriter.writeAttribute(namespace, attName, attributeValue); + } + } + /** + * method to handle Qnames + */ + + private void writeQName(javax.xml.namespace.QName qname, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + java.lang.String namespaceURI = qname.getNamespaceURI(); + if (namespaceURI != null) { + java.lang.String prefix = xmlWriter.getPrefix(namespaceURI); + if (prefix == null) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + xmlWriter.writeCharacters(prefix + ":" + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } else { + // i.e this is the default namespace + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + + } else { + xmlWriter.writeCharacters(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qname)); + } + } + + private void writeQNames(javax.xml.namespace.QName[] qnames, + javax.xml.stream.XMLStreamWriter xmlWriter) throws javax.xml.stream.XMLStreamException { + + if (qnames != null) { + // we have to store this data until last moment since it is not possible to write any + // namespace data after writing the charactor data + java.lang.StringBuffer stringToWrite = new java.lang.StringBuffer(); + java.lang.String namespaceURI = null; + java.lang.String prefix = null; + + for (int i = 0; i < qnames.length; i++) { + if (i > 0) { + stringToWrite.append(" "); + } + namespaceURI = qnames[i].getNamespaceURI(); + if (namespaceURI != null) { + prefix = xmlWriter.getPrefix(namespaceURI); + if ((prefix == null) || (prefix.length() == 0)) { + prefix = generatePrefix(namespaceURI); + xmlWriter.writeNamespace(prefix, namespaceURI); + xmlWriter.setPrefix(prefix,namespaceURI); + } + + if (prefix.trim().length() > 0){ + stringToWrite.append(prefix).append(":").append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } else { + stringToWrite.append(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(qnames[i])); + } + } + xmlWriter.writeCharacters(stringToWrite.toString()); + } + + } + + + /** + * Register a namespace prefix + */ + private java.lang.String registerPrefix(javax.xml.stream.XMLStreamWriter xmlWriter, java.lang.String namespace) throws javax.xml.stream.XMLStreamException { + java.lang.String prefix = xmlWriter.getPrefix(namespace); + + if (prefix == null) { + prefix = generatePrefix(namespace); + + while (xmlWriter.getNamespaceContext().getNamespaceURI(prefix) != null) { + prefix = org.apache.axis2.databinding.utils.BeanUtil.getUniquePrefix(); + } + + xmlWriter.writeNamespace(prefix, namespace); + xmlWriter.setPrefix(prefix, namespace); + } + + return prefix; + } + + + + /** + * databinding method to get an XML representation of this object + * + */ + public javax.xml.stream.XMLStreamReader getPullParser(javax.xml.namespace.QName qName) + throws org.apache.axis2.databinding.ADBException{ + + + + java.util.ArrayList elementList = new java.util.ArrayList(); + java.util.ArrayList attribList = new java.util.ArrayList(); + + if (localGetUTCTimeResultTracker){ + elementList.add(new javax.xml.namespace.QName("http://ws.intalio.com/TimeService/", + "getUTCTimeResult")); + + if (localGetUTCTimeResult != null){ + elementList.add(org.apache.axis2.databinding.utils.ConverterUtil.convertToString(localGetUTCTimeResult)); + } else { + throw new org.apache.axis2.databinding.ADBException("getUTCTimeResult cannot be null!!"); + } + } + + return new org.apache.axis2.databinding.utils.reader.ADBXMLStreamReaderImpl(qName, elementList.toArray(), attribList.toArray()); + + + + } + + + + /** + * Factory class that keeps the parse method + */ + public static class Factory{ + + + + + /** + * static method to create the object + * Precondition: If this object is an element, the current or next start element starts this object and any intervening reader events are ignorable + * If this object is not an element, it is a complex type and the reader is at the event just after the outer start element + * Postcondition: If this object is an element, the reader is positioned at its end element + * If this object is a complex type, the reader is positioned at the end element of its outer element + */ + public static GetUTCTimeResponse parse(javax.xml.stream.XMLStreamReader reader) throws java.lang.Exception{ + GetUTCTimeResponse object = + new GetUTCTimeResponse(); + + int event; + java.lang.String nillableValue = null; + java.lang.String prefix =""; + java.lang.String namespaceuri =""; + try { + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + + if (reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance","type")!=null){ + java.lang.String fullTypeName = reader.getAttributeValue("http://www.w3.org/2001/XMLSchema-instance", + "type"); + if (fullTypeName!=null){ + java.lang.String nsPrefix = null; + if (fullTypeName.indexOf(":") > -1){ + nsPrefix = fullTypeName.substring(0,fullTypeName.indexOf(":")); + } + nsPrefix = nsPrefix==null?"":nsPrefix; + + java.lang.String type = fullTypeName.substring(fullTypeName.indexOf(":")+1); + + if (!"getUTCTimeResponse".equals(type)){ + //find namespace for the prefix + java.lang.String nsUri = reader.getNamespaceContext().getNamespaceURI(nsPrefix); + return (GetUTCTimeResponse)com.intalio.ws.timeservice.ExtensionMapper.getTypeObject( + nsUri,type,reader); + } + + + } + + + } + + + + + // Note all attributes that were handled. Used to differ normal attributes + // from anyAttributes. + java.util.Vector handledAttributes = new java.util.Vector(); + + + + + reader.next(); + + + while (!reader.isStartElement() && !reader.isEndElement()) reader.next(); + + if (reader.isStartElement() && new javax.xml.namespace.QName("http://ws.intalio.com/TimeService/","getUTCTimeResult").equals(reader.getName())){ + + java.lang.String content = reader.getElementText(); + + object.setGetUTCTimeResult( + org.apache.axis2.databinding.utils.ConverterUtil.convertToString(content)); + + reader.next(); + + } // End of if for expected property start element + + else { + + } + + while (!reader.isStartElement() && !reader.isEndElement()) + reader.next(); + + if (reader.isStartElement()) + // A start element we are not expecting indicates a trailing invalid property + throw new org.apache.axis2.databinding.ADBException("Unexpected subelement " + reader.getLocalName()); + + + + + } catch (javax.xml.stream.XMLStreamException e) { + throw new java.lang.Exception(e); + } + + return object; + } + + }//end of factory class + + + + } + + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/java/com/intalio/ws/timeservice/TimeServiceMessageReceiverInOut.java ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/java/com/intalio/ws/timeservice/TimeServiceMessageReceiverInOut.java b/axis2-war/src/test/java/com/intalio/ws/timeservice/TimeServiceMessageReceiverInOut.java new file mode 100644 index 0000000..8032d92 --- /dev/null +++ b/axis2-war/src/test/java/com/intalio/ws/timeservice/TimeServiceMessageReceiverInOut.java @@ -0,0 +1,263 @@ + +/** + * TimeServiceMessageReceiverInOut.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) + */ + package com.intalio.ws.timeservice; + + /** + * TimeServiceMessageReceiverInOut message receiver + */ + + public class TimeServiceMessageReceiverInOut extends org.apache.axis2.receivers.AbstractInOutMessageReceiver{ + + + public void invokeBusinessLogic(org.apache.axis2.context.MessageContext msgContext, org.apache.axis2.context.MessageContext newMsgContext) + throws org.apache.axis2.AxisFault{ + + try { + + // get the implementation class for the Web Service + Object obj = getTheImplementationObject(msgContext); + + TimeServiceSkeleton skel = (TimeServiceSkeleton)obj; + //Out Envelop + org.apache.axiom.soap.SOAPEnvelope envelope = null; + //Find the axisOperation that has been set by the Dispatch phase. + org.apache.axis2.description.AxisOperation op = msgContext.getOperationContext().getAxisOperation(); + if (op == null) { + throw new org.apache.axis2.AxisFault("Operation is not located, if this is doclit style the SOAP-ACTION should specified via the SOAP Action to use the RawXMLProvider"); + } + + java.lang.String methodName; + if((op.getName() != null) && ((methodName = org.apache.axis2.util.JavaUtils.xmlNameToJavaIdentifier(op.getName().getLocalPart())) != null)){ + + + + if("getCityTime".equals(methodName)){ + + com.intalio.ws.timeservice.GetCityTimeResponse getCityTimeResponse1 = null; + com.intalio.ws.timeservice.GetCityTime wrappedParam = + (com.intalio.ws.timeservice.GetCityTime)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.intalio.ws.timeservice.GetCityTime.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + getCityTimeResponse1 = + + + skel.getCityTime(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), getCityTimeResponse1, false); + } else + + if("getUTCTime".equals(methodName)){ + + com.intalio.ws.timeservice.GetUTCTimeResponse getUTCTimeResponse3 = null; + com.intalio.ws.timeservice.GetUTCTime wrappedParam = + (com.intalio.ws.timeservice.GetUTCTime)fromOM( + msgContext.getEnvelope().getBody().getFirstElement(), + com.intalio.ws.timeservice.GetUTCTime.class, + getEnvelopeNamespaces(msgContext.getEnvelope())); + + getUTCTimeResponse3 = + + + skel.getUTCTime(wrappedParam) + ; + + envelope = toEnvelope(getSOAPFactory(msgContext), getUTCTimeResponse3, false); + + } else { + throw new java.lang.RuntimeException("method not found"); + } + + + newMsgContext.setEnvelope(envelope); + } + } + catch (java.lang.Exception e) { + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + // + private org.apache.axiom.om.OMElement toOM(com.intalio.ws.timeservice.GetCityTime param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.intalio.ws.timeservice.GetCityTime.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.intalio.ws.timeservice.GetCityTimeResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.intalio.ws.timeservice.GetCityTimeResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.intalio.ws.timeservice.GetUTCTime param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.intalio.ws.timeservice.GetUTCTime.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.om.OMElement toOM(com.intalio.ws.timeservice.GetUTCTimeResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault { + + + try{ + return param.getOMElement(com.intalio.ws.timeservice.GetUTCTimeResponse.MY_QNAME, + org.apache.axiom.om.OMAbstractFactory.getOMFactory()); + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + + + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.intalio.ws.timeservice.GetCityTimeResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.intalio.ws.timeservice.GetCityTimeResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.intalio.ws.timeservice.GetCityTimeResponse wrapgetCityTime(){ + com.intalio.ws.timeservice.GetCityTimeResponse wrappedElement = new com.intalio.ws.timeservice.GetCityTimeResponse(); + return wrappedElement; + } + + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory, com.intalio.ws.timeservice.GetUTCTimeResponse param, boolean optimizeContent) + throws org.apache.axis2.AxisFault{ + try{ + org.apache.axiom.soap.SOAPEnvelope emptyEnvelope = factory.getDefaultEnvelope(); + + emptyEnvelope.getBody().addChild(param.getOMElement(com.intalio.ws.timeservice.GetUTCTimeResponse.MY_QNAME,factory)); + + + return emptyEnvelope; + } catch(org.apache.axis2.databinding.ADBException e){ + throw org.apache.axis2.AxisFault.makeFault(e); + } + } + + private com.intalio.ws.timeservice.GetUTCTimeResponse wrapgetUTCTime(){ + com.intalio.ws.timeservice.GetUTCTimeResponse wrappedElement = new com.intalio.ws.timeservice.GetUTCTimeResponse(); + return wrappedElement; + } + + + + /** + * get the default envelope + */ + private org.apache.axiom.soap.SOAPEnvelope toEnvelope(org.apache.axiom.soap.SOAPFactory factory){ + return factory.getDefaultEnvelope(); + } + + + private java.lang.Object fromOM( + org.apache.axiom.om.OMElement param, + java.lang.Class type, + java.util.Map extraNamespaces) throws org.apache.axis2.AxisFault{ + + try { + + if (com.intalio.ws.timeservice.GetCityTime.class.equals(type)){ + + return com.intalio.ws.timeservice.GetCityTime.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.intalio.ws.timeservice.GetCityTimeResponse.class.equals(type)){ + + return com.intalio.ws.timeservice.GetCityTimeResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.intalio.ws.timeservice.GetUTCTime.class.equals(type)){ + + return com.intalio.ws.timeservice.GetUTCTime.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + if (com.intalio.ws.timeservice.GetUTCTimeResponse.class.equals(type)){ + + return com.intalio.ws.timeservice.GetUTCTimeResponse.Factory.parse(param.getXMLStreamReaderWithoutCaching()); + + + } + + } catch (java.lang.Exception e) { + throw org.apache.axis2.AxisFault.makeFault(e); + } + return null; + } + + + + + + /** + * A utility method that copies the namepaces from the SOAPEnvelope + */ + private java.util.Map getEnvelopeNamespaces(org.apache.axiom.soap.SOAPEnvelope env){ + java.util.Map returnMap = new java.util.HashMap(); + java.util.Iterator namespaceIterator = env.getAllDeclaredNamespaces(); + while (namespaceIterator.hasNext()) { + org.apache.axiom.om.OMNamespace ns = (org.apache.axiom.om.OMNamespace) namespaceIterator.next(); + returnMap.put(ns.getPrefix(),ns.getNamespaceURI()); + } + return returnMap; + } + + private org.apache.axis2.AxisFault createAxisFault(java.lang.Exception e) { + org.apache.axis2.AxisFault f; + Throwable cause = e.getCause(); + if (cause != null) { + f = new org.apache.axis2.AxisFault(e.getMessage(), cause); + } else { + f = new org.apache.axis2.AxisFault(e.getMessage()); + } + + return f; + } + + }//end of class + \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/java/com/intalio/ws/timeservice/TimeServiceSkeleton.java ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/java/com/intalio/ws/timeservice/TimeServiceSkeleton.java b/axis2-war/src/test/java/com/intalio/ws/timeservice/TimeServiceSkeleton.java new file mode 100644 index 0000000..14c38db --- /dev/null +++ b/axis2-war/src/test/java/com/intalio/ws/timeservice/TimeServiceSkeleton.java @@ -0,0 +1,40 @@ +/** + * TimeServiceSkeleton.java + * + * This file was auto-generated from WSDL + * by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) + */ +package com.intalio.ws.timeservice; + +/** + * TimeServiceSkeleton java skeleton for the axisService + */ +public class TimeServiceSkeleton { + + /** + * Auto generated method signature + * + * @param getCityTime + */ + + public com.intalio.ws.timeservice.GetCityTimeResponse getCityTime( + com.intalio.ws.timeservice.GetCityTime getCityTime) { + GetCityTimeResponse r = new GetCityTimeResponse(); + r.setGetCityTimeResult("2010-01-30T13:45:34"); + return r; + } + + /** + * Auto generated method signature + * + * @param getUTCTime + */ + + public com.intalio.ws.timeservice.GetUTCTimeResponse getUTCTime( + com.intalio.ws.timeservice.GetUTCTime getUTCTime) { + GetUTCTimeResponse r = new GetUTCTimeResponse(); + r.setGetUTCTimeResult("2010-02-31T14:46:34"); + return r; + } + +} http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java b/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java index ea1b800..e5a57f6 100644 --- a/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java +++ b/axis2-war/src/test/java/org/apache/ode/axis2/Axis2TestBase.java @@ -19,17 +19,38 @@ package org.apache.ode.axis2; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URI; +import java.net.URISyntaxException; +import java.net.URL; +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; + +import javax.servlet.ServletException; +import javax.wsdl.WSDLException; +import javax.xml.namespace.QName; + import org.apache.axis2.AxisFault; import org.apache.axis2.context.ConfigurationContextFactory; +import org.apache.axis2.deployment.DeploymentEngine; +import org.apache.axis2.deployment.repository.util.ArchiveReader; import org.apache.axis2.description.AxisOperation; import org.apache.axis2.description.AxisService; import org.apache.axis2.description.Parameter; import org.apache.axis2.description.WSDL11ToAxisServiceBuilder; import org.apache.axis2.engine.AxisServer; import org.apache.axis2.engine.MessageReceiver; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.commons.lang.StringUtils; import org.apache.ode.axis2.hooks.ODEAxisService; import org.apache.ode.axis2.util.Axis2UriResolver; import org.apache.ode.axis2.util.Axis2WSDLLocator; @@ -39,24 +60,6 @@ import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.DataProvider; - -import javax.servlet.ServletException; -import javax.wsdl.WSDLException; -import javax.xml.namespace.QName; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.URI; -import java.net.URISyntaxException; -import java.net.URL; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Iterator; -import java.util.List; - /** * @author Matthieu Riou <[email protected]> */ @@ -167,7 +170,7 @@ public abstract class Axis2TestBase { @BeforeMethod protected void setUp() throws Exception { System.out.println("##### Running "+getClass().getName()); - log.debug("##### Running "+getClass().getName()); + log.info("##### Running "+getClass().getName()); /** * 1. If no settings are given from buildr, the test runs with the default config directory. * 2. If no settings are given from buildr and if the test implements ODEConfigDirAware, the test runs with @@ -205,6 +208,8 @@ public abstract class Axis2TestBase { } startServer(); + + DeploymentEngine.buildServiceGroup(getClass().getResourceAsStream("/test-services.xml"), Thread.currentThread().getContextClassLoader(), "testGroup", server.getConfigurationContext(), new ArchiveReader(), new HashMap()); } @AfterMethod http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestCleanSuccess_All/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestCleanSuccess_All/TimeService.wsdl b/axis2-war/src/test/resources/TestCleanSuccess_All/TimeService.wsdl index e0badda..485350b 100644 --- a/axis2-war/src/test/resources/TestCleanSuccess_All/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestCleanSuccess_All/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> -</wsdl:definitions> \ No newline at end of file +</wsdl:definitions> http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestCleanSuccess_Correlations/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestCleanSuccess_Correlations/TimeService.wsdl b/axis2-war/src/test/resources/TestCleanSuccess_Correlations/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestCleanSuccess_Correlations/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestCleanSuccess_Correlations/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestCleanSuccess_Events/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestCleanSuccess_Events/TimeService.wsdl b/axis2-war/src/test/resources/TestCleanSuccess_Events/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestCleanSuccess_Events/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestCleanSuccess_Events/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestCleanSuccess_Instance/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestCleanSuccess_Instance/TimeService.wsdl b/axis2-war/src/test/resources/TestCleanSuccess_Instance/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestCleanSuccess_Instance/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestCleanSuccess_Instance/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestCleanSuccess_MessageCorrEvents/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestCleanSuccess_MessageCorrEvents/TimeService.wsdl b/axis2-war/src/test/resources/TestCleanSuccess_MessageCorrEvents/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestCleanSuccess_MessageCorrEvents/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestCleanSuccess_MessageCorrEvents/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestCleanSuccess_Messages/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestCleanSuccess_Messages/TimeService.wsdl b/axis2-war/src/test/resources/TestCleanSuccess_Messages/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestCleanSuccess_Messages/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestCleanSuccess_Messages/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestCleanSuccess_None/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestCleanSuccess_None/TimeService.wsdl b/axis2-war/src/test/resources/TestCleanSuccess_None/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestCleanSuccess_None/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestCleanSuccess_None/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestCleanSuccess_Variables/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestCleanSuccess_Variables/TimeService.wsdl b/axis2-war/src/test/resources/TestCleanSuccess_Variables/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestCleanSuccess_Variables/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestCleanSuccess_Variables/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestProcessCronCleanup/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestProcessCronCleanup/TimeService.wsdl b/axis2-war/src/test/resources/TestProcessCronCleanup/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestProcessCronCleanup/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestProcessCronCleanup/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/TestSystemCronCleanup_exclude/TimeService.wsdl ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/TestSystemCronCleanup_exclude/TimeService.wsdl b/axis2-war/src/test/resources/TestSystemCronCleanup_exclude/TimeService.wsdl index e0badda..a4a1fca 100644 --- a/axis2-war/src/test/resources/TestSystemCronCleanup_exclude/TimeService.wsdl +++ b/axis2-war/src/test/resources/TestSystemCronCleanup_exclude/TimeService.wsdl @@ -18,7 +18,7 @@ ~ under the License. --> <wsdl:definitions - xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" + xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.intalio.com/TimeService/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" @@ -97,7 +97,7 @@ <wsdl:service name="TimeService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">A sample Time service</wsdl:documentation> <wsdl:port name="TimeServiceSoap" binding="tns:TimeServiceSoap"> - <soap:address location="http://ws.intalio.com/TimeService/" /> + <soap:address location="http://localhost:8888/axis2/processes/TimeService/" /> </wsdl:port> </wsdl:service> </wsdl:definitions> \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ode/blob/d13a05f8/axis2-war/src/test/resources/test-services.xml ---------------------------------------------------------------------- diff --git a/axis2-war/src/test/resources/test-services.xml b/axis2-war/src/test/resources/test-services.xml new file mode 100644 index 0000000..6d51449 --- /dev/null +++ b/axis2-war/src/test/resources/test-services.xml @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- This file was auto-generated from WSDL --> +<!-- by the Apache Axis2 version: 1.5.1 Built on : Oct 19, 2009 (10:59:00 EDT) --> +<serviceGroup> + <service name="TimeService"> + <messageReceivers> + <messageReceiver mep="http://www.w3.org/ns/wsdl/in-out" class="com.intalio.ws.timeservice.TimeServiceMessageReceiverInOut"/> + </messageReceivers> + <parameter name="ServiceClass">com.intalio.ws.timeservice.TimeServiceSkeleton</parameter> + <parameter name="useOriginalwsdl">true</parameter> + <parameter name="modifyUserWSDLPortAddress">true</parameter> + <operation name="getCityTime" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://ws.intalio.com/TimeService/"> + <actionMapping>http://ws.intalio.com/TimeService/getCityTime</actionMapping> + <outputActionMapping>http://ws.intalio.com/TimeService/TimeServiceSoap/getCityTimeResponse</outputActionMapping> + </operation> + <operation name="getUTCTime" mep="http://www.w3.org/ns/wsdl/in-out" namespace="http://ws.intalio.com/TimeService/"> + <actionMapping>http://ws.intalio.com/TimeService/getUTCTime</actionMapping> + <outputActionMapping>http://ws.intalio.com/TimeService/TimeServiceSoap/getUTCTimeResponse</outputActionMapping> + </operation> + </service> +</serviceGroup>
