You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by sa...@locus.apache.org on 2000/09/01 05:53:14 UTC
cvs commit: xml-soap/java/src/org/apache/soap/util/xml DOM2Writer.java DOMUtils.java DOMWriter.java NSStack.java Serializer.java XMIDeserializer.java XMISerializer.java XMLJavaMappingRegistry.java XercesParserLiaison.java
sanjiva 00/08/31 20:53:13
Modified: java/src/org/apache/soap AttributeHandler.java Body.java
Envelope.java Header.java
java/src/org/apache/soap/encoding SOAPMappingRegistry.java
java/src/org/apache/soap/encoding/literalxml
XMLParameterSerializer.java
java/src/org/apache/soap/encoding/soapenc
ArraySerializer.java BeanSerializer.java
MapSerializer.java ParameterSerializer.java
SoapEncUtils.java VectorSerializer.java
java/src/org/apache/soap/encoding/xmi
XMIParameterSerializer.java
java/src/org/apache/soap/messaging Message.java
java/src/org/apache/soap/rpc Parameter.java RPCMessage.java
Response.java
java/src/org/apache/soap/server DeploymentDescriptor.java
InvokeBSF.java MessageRouter.java RPCRouter.java
SMTP2HTTPBridge.java ServiceManager.java
ServiceManagerClient.java TypeMapping.java
TypeMappingSerializer.java
java/src/org/apache/soap/server/http
MessageRouterServlet.java RPCRouterServlet.java
ServerHTTPUtils.java
java/src/org/apache/soap/transport SOAPTransport.java
java/src/org/apache/soap/transport/http
SOAPHTTPConnection.java
java/src/org/apache/soap/transport/smtp SMTPUtils.java
SOAPSMTPConnection.java
java/src/org/apache/soap/util IOUtils.java
ObjectRegistry.java StringUtils.java
java/src/org/apache/soap/util/net HTTPUtils.java Relay.java
TcpTunnel.java TcpTunnelGui.java
java/src/org/apache/soap/util/xml DOM2Writer.java
DOMUtils.java DOMWriter.java NSStack.java
Serializer.java XMIDeserializer.java
XMISerializer.java XMLJavaMappingRegistry.java
XercesParserLiaison.java
Log:
removed tabs and made sure there were ending newlines at EOF
Revision Changes Path
1.3 +1 -1 xml-soap/java/src/org/apache/soap/AttributeHandler.java
Index: AttributeHandler.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/AttributeHandler.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- AttributeHandler.java 2000/05/30 10:23:50 1.2
+++ AttributeHandler.java 2000/09/01 03:52:39 1.3
@@ -250,4 +250,4 @@
return sw.toString();
}
-}
\ No newline at end of file
+}
1.4 +27 -27 xml-soap/java/src/org/apache/soap/Body.java
Index: Body.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/Body.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- Body.java 2000/09/01 02:36:13 1.3
+++ Body.java 2000/09/01 03:52:39 1.4
@@ -134,36 +134,36 @@
{
for (Enumeration e = bodyEntries.elements(); e.hasMoreElements();)
{
- Object obj = e.nextElement();
- if (obj instanceof Bean)
+ Object obj = e.nextElement();
+ if (obj instanceof Bean)
{
- Bean bodyEntry = (Bean) obj;
-
- if (Serializer.class.isAssignableFrom(bodyEntry.type))
- {
- ((Serializer)bodyEntry.value).marshall(actualEncStyle,
- bodyEntry.type,
- bodyEntry.value,
- null,
- sink,
- nsStack,
- xjmr);
- }
- else
- {
- throw new IllegalArgumentException("Body entries must implement " +
- "the Serializer interface.");
- }
- }
- else if (obj instanceof Element)
+ Bean bodyEntry = (Bean) obj;
+
+ if (Serializer.class.isAssignableFrom(bodyEntry.type))
+ {
+ ((Serializer)bodyEntry.value).marshall(actualEncStyle,
+ bodyEntry.type,
+ bodyEntry.value,
+ null,
+ sink,
+ nsStack,
+ xjmr);
+ }
+ else
+ {
+ throw new IllegalArgumentException("Body entries must implement " +
+ "the Serializer interface.");
+ }
+ }
+ else if (obj instanceof Element)
{
- Utils.marshallNode((Element)obj, sink);
- }
- else
+ Utils.marshallNode((Element)obj, sink);
+ }
+ else
{
- throw new IllegalArgumentException("Unknown type of body entry: '" +
- obj.getClass () + "'");
- }
+ throw new IllegalArgumentException("Unknown type of body entry: '" +
+ obj.getClass () + "'");
+ }
}
}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/Envelope.java
Index: Envelope.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/Envelope.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Envelope.java 2000/05/30 10:23:50 1.2
+++ Envelope.java 2000/09/01 03:52:42 1.3
@@ -311,4 +311,4 @@
return sw.toString();
}
-}
\ No newline at end of file
+}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/Header.java
Index: Header.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/Header.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Header.java 2000/05/30 10:23:51 1.2
+++ Header.java 2000/09/01 03:52:42 1.3
@@ -190,4 +190,4 @@
return sw.toString();
}
-}
\ No newline at end of file
+}
1.10 +10 -10 xml-soap/java/src/org/apache/soap/encoding/SOAPMappingRegistry.java
Index: SOAPMappingRegistry.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/SOAPMappingRegistry.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- SOAPMappingRegistry.java 2000/08/23 20:20:11 1.9
+++ SOAPMappingRegistry.java 2000/09/01 03:52:44 1.10
@@ -122,7 +122,7 @@
try {
Class XMISerializer =
- Class.forName("org.apache.soap.util.xml.XMISerializer");
+ Class.forName("org.apache.soap.util.xml.XMISerializer");
Class XMIParameterSerializer =
Class.forName("org.apache.soap.encoding.xmi.XMIParameterSerializer");
@@ -241,9 +241,9 @@
mapTypes(soapEncURI, byteQName, Byte.class, ser, null);
mapTypes(soapEncURI, byteQName, byte.class, ser, deser);
- mapTypes(soapEncURI, null, Vector.class, vectorSer, null);
- mapTypes(soapEncURI, new QName(Constants.NS_URI_XML_SOAP, "Map"),
- Hashtable.class, mapSer, mapSer);
+ mapTypes(soapEncURI, null, Vector.class, vectorSer, null);
+ mapTypes(soapEncURI, new QName(Constants.NS_URI_XML_SOAP, "Map"),
+ Hashtable.class, mapSer, mapSer);
/*
Map a Java byte array to the SOAP-ENC:base64 subtype.
@@ -272,7 +272,7 @@
{
if (javaType != null
&& (javaType.isArray() || (javaType.equals(Vector.class) ||
- (Enumeration.class.isAssignableFrom(javaType))))
+ (Enumeration.class.isAssignableFrom(javaType))))
&& encodingStyleURI != null
&& encodingStyleURI.equals(soapEncURI))
{
@@ -305,11 +305,11 @@
&& encodingStyleURI != null
&& encodingStyleURI.equals(soapEncURI))
{
- if (javaType.isArray()) {
- return arraySer;
- } else if (Enumeration.class.isAssignableFrom(javaType)) {
- return vectorSer;
- }
+ if (javaType.isArray()) {
+ return arraySer;
+ } else if (Enumeration.class.isAssignableFrom(javaType)) {
+ return vectorSer;
+ }
}
throw e;
}
1.2 +1 -1 xml-soap/java/src/org/apache/soap/encoding/literalxml/XMLParameterSerializer.java
Index: XMLParameterSerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/literalxml/XMLParameterSerializer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- XMLParameterSerializer.java 2000/05/30 10:27:30 1.1
+++ XMLParameterSerializer.java 2000/09/01 03:52:45 1.2
@@ -132,4 +132,4 @@
return new Bean(Parameter.class, parameter);
}
-}
\ No newline at end of file
+}
1.4 +1 -1 xml-soap/java/src/org/apache/soap/encoding/soapenc/ArraySerializer.java
Index: ArraySerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/ArraySerializer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ArraySerializer.java 2000/07/20 14:37:42 1.3
+++ ArraySerializer.java 2000/09/01 03:52:46 1.4
@@ -256,4 +256,4 @@
return Array.newInstance(componentType, length);
}
-}
\ No newline at end of file
+}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/encoding/soapenc/BeanSerializer.java
Index: BeanSerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/BeanSerializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- BeanSerializer.java 2000/05/30 10:23:56 1.2
+++ BeanSerializer.java 2000/09/01 03:52:46 1.3
@@ -252,4 +252,4 @@
"': " + t.getMessage());
}
}
-}
\ No newline at end of file
+}
1.2 +58 -58 xml-soap/java/src/org/apache/soap/encoding/soapenc/MapSerializer.java
Index: MapSerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/MapSerializer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MapSerializer.java 2000/08/23 20:13:01 1.1
+++ MapSerializer.java 2000/09/01 03:52:46 1.2
@@ -88,9 +88,9 @@
throws IllegalArgumentException, IOException
{
if ((src != null) &&
- !(src instanceof Hashtable))
+ !(src instanceof Hashtable))
throw new IllegalArgumentException("Tried to pass a '" +
- src.getClass().toString() + "' to MapSerializer");
+ src.getClass().toString() + "' to MapSerializer");
if (src == null)
{
@@ -112,19 +112,19 @@
sink.write(StringUtils.lineSeparator);
- Hashtable hash = (Hashtable)src;
-
+ Hashtable hash = (Hashtable)src;
+
for (Enumeration e = hash.keys(); e.hasMoreElements(); )
{
Object key = e.nextElement();
- Object value = hash.get(key);
-
- sink.write("<" + STR_ITEM + ">");
- sink.write(StringUtils.lineSeparator);
-
- // ??? Deal with null keys?
- xjmr.marshall(inScopeEncStyle, key.getClass(), key, STR_KEY, sink, nsStack);
- sink.write(StringUtils.lineSeparator);
+ Object value = hash.get(key);
+
+ sink.write("<" + STR_ITEM + ">");
+ sink.write(StringUtils.lineSeparator);
+
+ // ??? Deal with null keys?
+ xjmr.marshall(inScopeEncStyle, key.getClass(), key, STR_KEY, sink, nsStack);
+ sink.write(StringUtils.lineSeparator);
if (value == null)
{
@@ -140,8 +140,8 @@
}
sink.write(StringUtils.lineSeparator);
- sink.write("</" + STR_ITEM + ">");
- sink.write(StringUtils.lineSeparator);
+ sink.write("</" + STR_ITEM + ">");
+ sink.write(StringUtils.lineSeparator);
}
sink.write("</" + context + '>');
@@ -152,54 +152,54 @@
XMLJavaMappingRegistry xjmr)
throws IllegalArgumentException
{
- Element root = (Element)src;
- String name = root.getTagName();
+ Element root = (Element)src;
+ String name = root.getTagName();
- if (SoapEncUtils.isNull(root))
- {
- return new Bean(Hashtable.class, null);
- }
-
- Hashtable hash = new Hashtable();
-
- Element tempEl = DOMUtils.getFirstChildElement(root);
- while (tempEl != null) {
- // got an item
- Element keyEl = DOMUtils.getFirstChildElement(tempEl);
- String tagName = keyEl.getTagName();
-
- if (tagName.compareToIgnoreCase(STR_KEY) != 0)
- throw new IllegalArgumentException("Got <" + tagName +
- "> tag when expecting <" + STR_KEY + ">");
-
- Element valEl = DOMUtils.getNextSiblingElement(keyEl);
- tagName = valEl.getTagName();
- if (tagName.compareToIgnoreCase("value") != 0)
- throw new IllegalArgumentException("Got <" + tagName +
- "> tag when expecting <" + STR_VALUE + ">");
-
- Bean keyBean = unmarshallEl(inScopeEncStyle, xjmr, keyEl);
- Bean valBean = unmarshallEl(inScopeEncStyle, xjmr, valEl);
-
- hash.put(keyBean.value, valBean.value);
-
- tempEl = DOMUtils.getNextSiblingElement(tempEl);
- }
+ if (SoapEncUtils.isNull(root))
+ {
+ return new Bean(Hashtable.class, null);
+ }
+
+ Hashtable hash = new Hashtable();
+
+ Element tempEl = DOMUtils.getFirstChildElement(root);
+ while (tempEl != null) {
+ // got an item
+ Element keyEl = DOMUtils.getFirstChildElement(tempEl);
+ String tagName = keyEl.getTagName();
+
+ if (tagName.compareToIgnoreCase(STR_KEY) != 0)
+ throw new IllegalArgumentException("Got <" + tagName +
+ "> tag when expecting <" + STR_KEY + ">");
+
+ Element valEl = DOMUtils.getNextSiblingElement(keyEl);
+ tagName = valEl.getTagName();
+ if (tagName.compareToIgnoreCase("value") != 0)
+ throw new IllegalArgumentException("Got <" + tagName +
+ "> tag when expecting <" + STR_VALUE + ">");
+
+ Bean keyBean = unmarshallEl(inScopeEncStyle, xjmr, keyEl);
+ Bean valBean = unmarshallEl(inScopeEncStyle, xjmr, valEl);
+
+ hash.put(keyBean.value, valBean.value);
+
+ tempEl = DOMUtils.getNextSiblingElement(tempEl);
+ }
- return new Bean(Hashtable.class, hash);
+ return new Bean(Hashtable.class, hash);
}
- private Bean unmarshallEl(String inScopeEncStyle, XMLJavaMappingRegistry xjmr, Element targetEl) {
- String declEncStyle = DOMUtils.getAttributeNS(targetEl,
- Constants.NS_URI_SOAP_ENV, Constants.ATTR_ENCODING_STYLE);
- String actualEncStyle = declEncStyle != null
- ? declEncStyle
- : inScopeEncStyle;
- QName declItemType = SoapEncUtils.getAttributeValue(targetEl,
- Constants.NS_URI_SCHEMA_XSI, Constants.ATTR_TYPE, STR_ITEM,
- false);
+ private Bean unmarshallEl(String inScopeEncStyle, XMLJavaMappingRegistry xjmr, Element targetEl) {
+ String declEncStyle = DOMUtils.getAttributeNS(targetEl,
+ Constants.NS_URI_SOAP_ENV, Constants.ATTR_ENCODING_STYLE);
+ String actualEncStyle = declEncStyle != null
+ ? declEncStyle
+ : inScopeEncStyle;
+ QName declItemType = SoapEncUtils.getAttributeValue(targetEl,
+ Constants.NS_URI_SCHEMA_XSI, Constants.ATTR_TYPE, STR_ITEM,
+ false);
- return xjmr.unmarshall(actualEncStyle, declItemType, targetEl);
- }
+ return xjmr.unmarshall(actualEncStyle, declItemType, targetEl);
+ }
}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/encoding/soapenc/ParameterSerializer.java
Index: ParameterSerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/ParameterSerializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ParameterSerializer.java 2000/05/30 10:23:56 1.2
+++ ParameterSerializer.java 2000/09/01 03:52:46 1.3
@@ -122,4 +122,4 @@
return new Bean(Parameter.class, parameter);
}
-}
\ No newline at end of file
+}
1.4 +1 -1 xml-soap/java/src/org/apache/soap/encoding/soapenc/SoapEncUtils.java
Index: SoapEncUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/SoapEncUtils.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SoapEncUtils.java 2000/07/20 14:37:42 1.3
+++ SoapEncUtils.java 2000/09/01 03:52:46 1.4
@@ -243,4 +243,4 @@
return null;
}
}
-}
\ No newline at end of file
+}
1.2 +21 -21 xml-soap/java/src/org/apache/soap/encoding/soapenc/VectorSerializer.java
Index: VectorSerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/VectorSerializer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- VectorSerializer.java 2000/07/06 18:14:17 1.1
+++ VectorSerializer.java 2000/09/01 03:52:47 1.2
@@ -86,30 +86,30 @@
nsStack.pushScope();
if ((src != null) &&
- !(src instanceof Vector) &&
- !(src instanceof Enumeration))
+ !(src instanceof Vector) &&
+ !(src instanceof Enumeration))
throw new IllegalArgumentException("Tried to pass a '" +
- src.getClass().toString() + "' to VectorSerializer");
+ src.getClass().toString() + "' to VectorSerializer");
- String lengthStr;
- Enumeration enum;
-
- if (src instanceof Enumeration) {
- /** TODO: Right now we don't include a length on Enumerations,
- * due to efficiency concerns. There should be a way to configure
- * doing the length calculation (at the cost of traversing the
- * Enumeration) for a particular installation/service/call.
- */
- enum = (Enumeration)src;
- lengthStr = "";
- } else {
- Vector v = (Vector)src;
- enum = v.elements();
-
- lengthStr = src != null
+ String lengthStr;
+ Enumeration enum;
+
+ if (src instanceof Enumeration) {
+ /** TODO: Right now we don't include a length on Enumerations,
+ * due to efficiency concerns. There should be a way to configure
+ * doing the length calculation (at the cost of traversing the
+ * Enumeration) for a particular installation/service/call.
+ */
+ enum = (Enumeration)src;
+ lengthStr = "";
+ } else {
+ Vector v = (Vector)src;
+ enum = v.elements();
+
+ lengthStr = src != null
? v.size() + ""
: "";
- }
+ }
// Since a Vector can hold objects....
Class componentType = Object.class;
@@ -173,7 +173,7 @@
XMLJavaMappingRegistry xjmr)
throws IllegalArgumentException
{
- throw new IllegalArgumentException("VectorSerializer used for deserialization");
+ throw new IllegalArgumentException("VectorSerializer used for deserialization");
}
}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/encoding/xmi/XMIParameterSerializer.java
Index: XMIParameterSerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/encoding/xmi/XMIParameterSerializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMIParameterSerializer.java 2000/05/30 10:23:58 1.2
+++ XMIParameterSerializer.java 2000/09/01 03:52:48 1.3
@@ -136,4 +136,4 @@
return new Bean(Parameter.class, parameter);
}
-}
\ No newline at end of file
+}
1.2 +2 -2 xml-soap/java/src/org/apache/soap/messaging/Message.java
Index: Message.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/messaging/Message.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Message.java 2000/09/01 02:39:26 1.1
+++ Message.java 2000/09/01 03:52:49 1.2
@@ -120,8 +120,8 @@
public Envelope receive () throws SOAPException {
if (st == null) {
throw new SOAPException (Constants.FAULT_CODE_CLIENT,
- "Unable to receive without sending on an " +
- "appropriate transport.");
+ "Unable to receive without sending on an " +
+ "appropriate transport.");
}
BufferedReader br = st.receive ();
1.3 +1 -1 xml-soap/java/src/org/apache/soap/rpc/Parameter.java
Index: Parameter.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/rpc/Parameter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Parameter.java 2000/05/30 10:24:00 1.2
+++ Parameter.java 2000/09/01 03:52:50 1.3
@@ -138,4 +138,4 @@
"[value=" + value + "] " +
"[encodingStyleURI=" + encodingStyleURI + "]";
}
-}
\ No newline at end of file
+}
1.4 +4 -4 xml-soap/java/src/org/apache/soap/rpc/RPCMessage.java
Index: RPCMessage.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/rpc/RPCMessage.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- RPCMessage.java 2000/07/20 14:37:43 1.3
+++ RPCMessage.java 2000/09/01 03:52:50 1.4
@@ -376,12 +376,12 @@
if (!isResponse)
{
// I'm on the server side unmarshalling a call.
- DeploymentDescriptor dd = null;
- try
+ DeploymentDescriptor dd = null;
+ try
{
- dd = svcMgr.query(targetObjectURI);
+ dd = svcMgr.query(targetObjectURI);
smr = DeploymentDescriptor.buildSOAPMappingRegistry(dd);
- }
+ }
catch (SOAPException e)
{
throw new IllegalArgumentException("Unable to resolve " +
1.3 +1 -1 xml-soap/java/src/org/apache/soap/rpc/Response.java
Index: Response.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/rpc/Response.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Response.java 2000/05/30 10:24:02 1.2
+++ Response.java 2000/09/01 03:52:50 1.3
@@ -137,4 +137,4 @@
{
return (Response)RPCMessage.extractFromEnvelope(env, null, true, smr);
}
-}
\ No newline at end of file
+}
1.9 +139 -136 xml-soap/java/src/org/apache/soap/server/DeploymentDescriptor.java
Index: DeploymentDescriptor.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/DeploymentDescriptor.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- DeploymentDescriptor.java 2000/09/01 03:03:07 1.8
+++ DeploymentDescriptor.java 2000/09/01 03:52:52 1.9
@@ -145,11 +145,11 @@
}
public void setDefaultSMRClass(String _defaultSMRClass) {
- defaultSMRClass = _defaultSMRClass;
+ defaultSMRClass = _defaultSMRClass;
}
public String getDefaultSMRClass() {
- return defaultSMRClass;
+ return defaultSMRClass;
}
/**
@@ -249,57 +249,60 @@
PrintWriter pw = new PrintWriter (pr);
pw.println ("<isd:service xmlns:isd=\"" +
- Constants.NS_URI_XML_SOAP_DEPLOYMENT + "\" id=\"" + id +
- (serviceType != SERVICE_TYPE_RPC ? " type=\"message" : "") +
- "\">");
+ Constants.NS_URI_XML_SOAP_DEPLOYMENT + "\" id=\"" + id +
+ (serviceType != SERVICE_TYPE_RPC ? " type=\"message" : "") +
+ "\">");
byte pt = providerType;
String[] scopes = {"Request", "Session", "Application"};
pw.print (" <isd:provider type=\"" +
- (pt == DeploymentDescriptor.PROVIDER_JAVA ? "java" : "script") +
- "\" scope=\"" + scopes[scope] + "\" methods=\"");
+ (pt == DeploymentDescriptor.PROVIDER_JAVA ? "java" : "script") +
+ "\" scope=\"" + scopes[scope] + "\" methods=\"");
for (int i = 0; i < methods.length; i++) {
pw.print (methods[i]);
if (i < methods.length-1) {
- pw.print (" ");
+ pw.print (" ");
}
}
pw.println ("\">");
if (pt == DeploymentDescriptor.PROVIDER_JAVA) {
pw.println (" <isd:java class=\"" + providerClass +
- "\" static=\"" + (isStatic ? "true" : "false") + "\"/>");
+ "\" static=\"" + (isStatic ? "true" : "false") + "\"/>");
} else {
pw.print (" <isd:script language=\"" + scriptLanguage);
if (pt == DeploymentDescriptor.PROVIDER_SCRIPT_FILE) {
- pw.println (" source=\"" + scriptFilenameOrString + "\"/>");
+ pw.println (" source=\"" + scriptFilenameOrString + "\"/>");
} else {
- pw.println ("\">");
- pw.println (" <![CDATA[");
- pw.println (scriptFilenameOrString);
- pw.println (" ]]>");
- pw.println (" </isd:script>");
+ pw.println ("\">");
+ pw.println (" <![CDATA[");
+ pw.println (scriptFilenameOrString);
+ pw.println (" ]]>");
+ pw.println (" </isd:script>");
}
}
pw.println (" </isd:provider>");
if (mappings != null) {
- pw.println (" <isd:mappings>");
-
- if (defaultSMRClass != null) pw.print("defaultRegistryClass=\"" + defaultSMRClass + "\">"); else pw.print(">");
+ pw.println (" <isd:mappings");
+ if (defaultSMRClass != null) {
+ pw.print(" defaultRegistryClass=\"" + defaultSMRClass + "\">");
+ } else {
+ pw.print(">");
+ }
for (int i = 0; i < mappings.length; i++) {
- TypeMapping tm = mappings[i];
- pw.print (" <isd:map encodingStyle=\"" + tm.encodingStyle +
- "\" xmlns:x=\"" + tm.elementType.getNamespaceURI () +
- "\" qname=\"x:" + tm.elementType.getLocalPart () +
- "\" javaType=\"" + tm.javaType + "\"");
- if (tm.xml2JavaClassName != null) {
- pw.print (" xml2JavaClassName=\"" + tm.xml2JavaClassName + "\"");
- }
- if (tm.java2XMLClassName != null) {
- pw.print (" java2XMLClassName=\"" + tm.java2XMLClassName + "\"");
- }
- pw.println ("/>");
+ TypeMapping tm = mappings[i];
+ pw.print (" <isd:map encodingStyle=\"" + tm.encodingStyle +
+ "\" xmlns:x=\"" + tm.elementType.getNamespaceURI () +
+ "\" qname=\"x:" + tm.elementType.getLocalPart () +
+ "\" javaType=\"" + tm.javaType + "\"");
+ if (tm.xml2JavaClassName != null) {
+ pw.print (" xml2JavaClassName=\"" + tm.xml2JavaClassName + "\"");
+ }
+ if (tm.java2XMLClassName != null) {
+ pw.print (" java2XMLClassName=\"" + tm.java2XMLClassName + "\"");
+ }
+ pw.println ("/>");
}
pw.println (" </isd:mappings>");
}
@@ -314,12 +317,12 @@
*/
public static DeploymentDescriptor fromXML (Element root) {
if ((root == null) ||
- !root.getNamespaceURI().equals (Constants.NS_URI_XML_SOAP_DEPLOYMENT) ||
- !root.getLocalName().equals ("service")) {
+ !root.getNamespaceURI().equals (Constants.NS_URI_XML_SOAP_DEPLOYMENT) ||
+ !root.getLocalName().equals ("service")) {
throw new IllegalArgumentException ("root is null or document element " +
- "is not {" +
- Constants.NS_URI_XML_SOAP_DEPLOYMENT +
- "}service");
+ "is not {" +
+ Constants.NS_URI_XML_SOAP_DEPLOYMENT +
+ "}service");
}
DeploymentDescriptor dd = new DeploymentDescriptor ();
@@ -329,7 +332,7 @@
String id = DOMUtils.getAttribute (root, "id");
if (id == null) {
throw new IllegalArgumentException ("required 'id' attribute " +
- "missing in deployment descriptor");
+ "missing in deployment descriptor");
}
dd.setID (id);
@@ -337,33 +340,33 @@
String serviceTypeStr = DOMUtils.getAttribute (root, "type");
if (serviceTypeStr != null) {
if (serviceTypeStr.equals ("message")) {
- dd.setServiceType (SERVICE_TYPE_MESSAGE);
+ dd.setServiceType (SERVICE_TYPE_MESSAGE);
} else {
- throw new IllegalArgumentException ("unknown value for 'type' " +
- "attribute: '" + serviceTypeStr +
- "': bad deployment descriptor");
+ throw new IllegalArgumentException ("unknown value for 'type' " +
+ "attribute: '" + serviceTypeStr +
+ "': bad deployment descriptor");
}
}
nl = root.getElementsByTagNameNS (Constants.NS_URI_XML_SOAP_DEPLOYMENT,
- "provider");
+ "provider");
if ((nl == null) || nl.getLength () != 1) {
throw new IllegalArgumentException ("exactly one 'provider' element " +
- "missing in deployment descriptor");
+ "missing in deployment descriptor");
}
e = (Element) nl.item (0);
String typeStr = DOMUtils.getAttribute (e, "type");
String scopeStr = DOMUtils.getAttribute (e, "scope");
String methodsStr = DOMUtils.getAttribute (e, "methods");
if ((typeStr == null) ||
- (!typeStr.equals ("java") && !typeStr.equals ("script")) ||
- (scopeStr == null) ||
- (!scopeStr.equals ("Request") &&
- !scopeStr.equals ("Session") && !scopeStr.equals ("Application")) ||
- (methodsStr == null) || methodsStr.equals ("")) {
+ (!typeStr.equals ("java") && !typeStr.equals ("script")) ||
+ (scopeStr == null) ||
+ (!scopeStr.equals ("Request") &&
+ !scopeStr.equals ("Session") && !scopeStr.equals ("Application")) ||
+ (methodsStr == null) || methodsStr.equals ("")) {
throw new IllegalArgumentException ("invalid value for type or scope " +
- "or methods attribute in provider " +
- "element of deployment descriptor");
+ "or methods attribute in provider " +
+ "element of deployment descriptor");
}
int scope = -1;
@@ -374,49 +377,49 @@
nl = e.getElementsByTagNameNS (Constants.NS_URI_XML_SOAP_DEPLOYMENT,
"java");
if ((nl == null) || nl.getLength () != 1) {
- throw new IllegalArgumentException ("exactly one 'java' element " +
- "missing in deployment " +
- "descriptor");
+ throw new IllegalArgumentException ("exactly one 'java' element " +
+ "missing in deployment " +
+ "descriptor");
}
e = (Element) nl.item (0);
String className = DOMUtils.getAttribute (e, "class");
if (className == null) {
- throw new IllegalArgumentException ("<java> element requires " +
- "'class' attribute");
+ throw new IllegalArgumentException ("<java> element requires " +
+ "'class' attribute");
}
dd.setProviderClass (className);
String isStatic = DOMUtils.getAttribute (e, "static");
boolean isStaticBool = false;
if (isStatic != null) {
- if (isStatic.equals ("false")) {
- isStaticBool = false;
- } else if (isStatic.equals ("true")) {
- isStaticBool = true;
- } else {
- throw new IllegalArgumentException ("'static' attribute of " +
- "<java> element must be " +
- "true or false");
- }
+ if (isStatic.equals ("false")) {
+ isStaticBool = false;
+ } else if (isStatic.equals ("true")) {
+ isStaticBool = true;
+ } else {
+ throw new IllegalArgumentException ("'static' attribute of " +
+ "<java> element must be " +
+ "true or false");
+ }
}
dd.setIsStatic (isStaticBool);
} else {
nl = e.getElementsByTagNameNS (Constants.NS_URI_XML_SOAP_DEPLOYMENT,
- "script");
+ "script");
if ((nl == null) || nl.getLength () != 1) {
- throw new IllegalArgumentException ("exactly one 'script' element " +
- "missing in deployment " +
- "descriptor");
+ throw new IllegalArgumentException ("exactly one 'script' element " +
+ "missing in deployment " +
+ "descriptor");
}
e = (Element) nl.item (0);
dd.setScriptLanguage (DOMUtils.getAttribute (e, "language"));
String source = DOMUtils.getAttribute (e, "source");
if (source != null) {
- dd.setProviderType (DeploymentDescriptor.PROVIDER_SCRIPT_FILE);
- dd.setScriptFilenameOrString (source);
+ dd.setProviderType (DeploymentDescriptor.PROVIDER_SCRIPT_FILE);
+ dd.setScriptFilenameOrString (source);
} else {
- dd.setProviderType (DeploymentDescriptor.PROVIDER_SCRIPT_STRING);
- dd.setScriptFilenameOrString (DOMUtils.getChildCharacterData (e));
+ dd.setProviderType (DeploymentDescriptor.PROVIDER_SCRIPT_STRING);
+ dd.setScriptFilenameOrString (DOMUtils.getChildCharacterData (e));
}
}
@@ -439,39 +442,39 @@
// read the type mappings
nl = root.getElementsByTagNameNS (Constants.NS_URI_XML_SOAP_DEPLOYMENT,
- "mappings");
+ "mappings");
if ((nl == null) || nl.getLength () > 1) {
throw new IllegalArgumentException ("at most one 'mappings' element " +
- "allowed in deployment descriptor");
+ "allowed in deployment descriptor");
}
if (nl.getLength () == 1) {
e = (Element) nl.item (0);
String className = e.getAttribute("defaultRegistryClass");
- if (className != "") {
- dd.setDefaultSMRClass(className);
- }
-
+ if (className != "") {
+ dd.setDefaultSMRClass(className);
+ }
+
nl = e.getElementsByTagNameNS (Constants.NS_URI_XML_SOAP_DEPLOYMENT,
"map");
int nmaps = nl.getLength ();
if (nmaps > 0) {
- TypeMapping[] tms = new TypeMapping[nmaps];
- dd.setMappings (tms);
- for (int i = 0; i < nmaps; i++) {
- e = (Element) nl.item (i);
- String qnameQname = DOMUtils.getAttribute (e, "qname");
- int pos = qnameQname.indexOf (':');
- String prefix = qnameQname.substring (0, pos);
- String localPart = qnameQname.substring (pos+1);
- String nsURI = DOMUtils.getNamespaceURIFromPrefix (e, prefix);
- tms[i] =
- new TypeMapping (DOMUtils.getAttribute (e, "encodingStyle"),
- new QName (nsURI, localPart),
- DOMUtils.getAttribute (e, "javaType"),
- DOMUtils.getAttribute (e, "java2XMLClassName"),
- DOMUtils.getAttribute (e, "xml2JavaClassName"));
- }
+ TypeMapping[] tms = new TypeMapping[nmaps];
+ dd.setMappings (tms);
+ for (int i = 0; i < nmaps; i++) {
+ e = (Element) nl.item (i);
+ String qnameQname = DOMUtils.getAttribute (e, "qname");
+ int pos = qnameQname.indexOf (':');
+ String prefix = qnameQname.substring (0, pos);
+ String localPart = qnameQname.substring (pos+1);
+ String nsURI = DOMUtils.getNamespaceURIFromPrefix (e, prefix);
+ tms[i] =
+ new TypeMapping (DOMUtils.getAttribute (e, "encodingStyle"),
+ new QName (nsURI, localPart),
+ DOMUtils.getAttribute (e, "javaType"),
+ DOMUtils.getAttribute (e, "java2XMLClassName"),
+ DOMUtils.getAttribute (e, "xml2JavaClassName"));
+ }
}
}
@@ -522,55 +525,55 @@
return smr;
} else {
if (dd.getDefaultSMRClass() != null) {
- try {
- smr = (SOAPMappingRegistry)
- (Class.forName(dd.getDefaultSMRClass())).newInstance();
- }
- catch (Exception e) {
- smr = new SOAPMappingRegistry();
- }
+ try {
+ smr = (SOAPMappingRegistry)
+ (Class.forName(dd.getDefaultSMRClass())).newInstance();
+ }
+ catch (Exception e) {
+ smr = new SOAPMappingRegistry();
+ }
}
else {
- smr = new SOAPMappingRegistry ();
+ smr = new SOAPMappingRegistry ();
}
}
if (maps != null) {
for (int i = 0; i < maps.length; i++) {
- TypeMapping tm = maps[i];
- int step = 0;
- try {
- step = 0;
- Class javaType = null;
- if (tm.javaType != null) {
- javaType = Class.forName (tm.javaType);
- }
- step = 1;
- Serializer s = null;
- if (tm.java2XMLClassName != null) {
- Class c = Class.forName (tm.java2XMLClassName);
- s = (Serializer) c.newInstance ();
- }
- step = 2;
- Deserializer d = null;
- if (tm.xml2JavaClassName != null) {
- Class c = Class.forName (tm.xml2JavaClassName);
- d = (Deserializer) c.newInstance ();
- }
- smr.mapTypes (tm.encodingStyle, tm.elementType, javaType, s, d);
- } catch (Exception e2) {
- String m = "deployment error in SOAP service '" + dd.getID () +
- "': ";
- if (step == 0) {
- m += "class name '" + tm.javaType + "' could not be resolved: ";
- } else if (step == 1) {
- m += "class name '" + tm.java2XMLClassName + "' could not be " +
- "resolved as a serializer: ";
- } else {
- m += "class name '" + tm.xml2JavaClassName + "' could not be " +
- "resolved as a deserializer: ";
- }
- throw new IllegalArgumentException (m + e2.getMessage ());
- }
+ TypeMapping tm = maps[i];
+ int step = 0;
+ try {
+ step = 0;
+ Class javaType = null;
+ if (tm.javaType != null) {
+ javaType = Class.forName (tm.javaType);
+ }
+ step = 1;
+ Serializer s = null;
+ if (tm.java2XMLClassName != null) {
+ Class c = Class.forName (tm.java2XMLClassName);
+ s = (Serializer) c.newInstance ();
+ }
+ step = 2;
+ Deserializer d = null;
+ if (tm.xml2JavaClassName != null) {
+ Class c = Class.forName (tm.xml2JavaClassName);
+ d = (Deserializer) c.newInstance ();
+ }
+ smr.mapTypes (tm.encodingStyle, tm.elementType, javaType, s, d);
+ } catch (Exception e2) {
+ String m = "deployment error in SOAP service '" + dd.getID () +
+ "': ";
+ if (step == 0) {
+ m += "class name '" + tm.javaType + "' could not be resolved: ";
+ } else if (step == 1) {
+ m += "class name '" + tm.java2XMLClassName + "' could not be " +
+ "resolved as a serializer: ";
+ } else {
+ m += "class name '" + tm.xml2JavaClassName + "' could not be " +
+ "resolved as a deserializer: ";
+ }
+ throw new IllegalArgumentException (m + e2.getMessage ());
+ }
}
}
dd.setCachedSMR (smr);
1.3 +6 -6 xml-soap/java/src/org/apache/soap/server/InvokeBSF.java
Index: InvokeBSF.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/InvokeBSF.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- InvokeBSF.java 2000/05/30 10:24:04 1.2
+++ InvokeBSF.java 2000/09/01 03:52:52 1.3
@@ -86,14 +86,14 @@
* @exception SOAPException if something goes wrong
*/
public static void init (DeploymentDescriptor dd, Object target,
- String scriptStr) throws SOAPException {
+ String scriptStr) throws SOAPException {
try {
BSFManager mgr = (BSFManager) target;
mgr.exec (dd.getScriptLanguage (), "service script for '" +
- dd.getID () + "'", 0, 0, scriptStr);
+ dd.getID () + "'", 0, 0, scriptStr);
} catch (BSFException e) {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "BSF Error: " + e.getMessage (), e);
+ "BSF Error: " + e.getMessage (), e);
}
}
@@ -110,17 +110,17 @@
* @exception SOAPException if something goes wrong
*/
public static Bean service (DeploymentDescriptor dd, Object target,
- String methodName, Object[] args)
+ String methodName, Object[] args)
throws SOAPException {
try {
BSFManager mgr = (BSFManager) target;
BSFEngine eng = mgr.loadScriptingEngine (dd.getScriptLanguage ());
Object result = eng.call (null, methodName, args);
return new Bean ((result != null) ? result.getClass () : Object.class,
- result);
+ result);
} catch (BSFException e) {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "BSF Error: " + e.getMessage (), e);
+ "BSF Error: " + e.getMessage (), e);
}
}
}
1.2 +12 -12 xml-soap/java/src/org/apache/soap/server/MessageRouter.java
Index: MessageRouter.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/MessageRouter.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MessageRouter.java 2000/09/01 02:44:35 1.1
+++ MessageRouter.java 2000/09/01 03:52:52 1.2
@@ -22,11 +22,11 @@
* Check whether the message is valid - does the service publish it?
*/
public static boolean validMessage (DeploymentDescriptor dd,
- String messageName) {
+ String messageName) {
String[] pubMessages = dd.getMethods ();
for (int i = 0; i < pubMessages.length; i++) {
if (messageName.equals (pubMessages[i])) {
- return true;
+ return true;
}
}
return false;
@@ -37,8 +37,8 @@
* object.
*/
public static void invoke (DeploymentDescriptor dd, Envelope env,
- Object targetObject, String messageName,
- PrintWriter out)
+ Object targetObject, String messageName,
+ PrintWriter out)
throws SOAPException {
byte providerType = dd.getProviderType ();
@@ -47,13 +47,13 @@
Object[] args = new Object[] { env, out };
if (providerType == DeploymentDescriptor.PROVIDER_JAVA) {
- Method m = MethodUtils.getMethod (targetObject, messageName,
- argTypes);
- m.invoke (targetObject, args);
+ Method m = MethodUtils.getMethod (targetObject, messageName,
+ argTypes);
+ m.invoke (targetObject, args);
} else {
- // find the class that provides the BSF services (done
- // this way via reflection to avoid a compile-time dependency on BSF)
- Class bc = Class.forName ("org.apache.soap.server.InvokeBSF");
+ // find the class that provides the BSF services (done
+ // this way via reflection to avoid a compile-time dependency on BSF)
+ Class bc = Class.forName ("org.apache.soap.server.InvokeBSF");
// now invoke the service
Class[] sig = {DeploymentDescriptor.class,
@@ -68,8 +68,8 @@
throw new SOAPException (Constants.FAULT_CODE_SERVER, t.getMessage(), t);
} catch (ClassNotFoundException e) {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "Unable to load BSF: script services " +
- "unsupported with BSF", e);
+ "Unable to load BSF: script services " +
+ "unsupported with BSF", e);
} catch (Throwable t) {
throw new SOAPException (Constants.FAULT_CODE_SERVER, t.getMessage(), t);
}
1.3 +15 -15 xml-soap/java/src/org/apache/soap/server/RPCRouter.java
Index: RPCRouter.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/RPCRouter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- RPCRouter.java 2000/09/01 02:41:20 1.2
+++ RPCRouter.java 2000/09/01 03:52:52 1.3
@@ -20,7 +20,7 @@
*/
public class RPCRouter {
public static Call extractCallFromEnvelope (ServiceManager serviceManager,
- Envelope callEnv)
+ Envelope callEnv)
throws SOAPException {
// determine target object URI by looking in the envelope
Vector bodyEntries = callEnv.getBody ().getBodyEntries ();
@@ -33,7 +33,7 @@
throw new SOAPException (
Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI,
"Unable to determine object id from call: is the method element " +
- "namespaced?");
+ "namespaced?");
}
// now extract the call from the call envelope with the given
@@ -54,7 +54,7 @@
String[] pubMethods = dd.getMethods ();
for (int i = 0; i < pubMethods.length; i++) {
if (callMethodName.equals (pubMethods[i])) {
- return true;
+ return true;
}
}
return false;
@@ -64,7 +64,7 @@
* Do the call on the given target object.
*/
public static Response invoke (DeploymentDescriptor dd,
- Call call, Object targetObject)
+ Call call, Object targetObject)
throws SOAPException {
byte providerType = dd.getProviderType ();
@@ -96,13 +96,13 @@
Bean result = null;
try {
if (providerType == DeploymentDescriptor.PROVIDER_JAVA) {
- Method m = MethodUtils.getMethod (targetObject, call.getMethodName (),
- argTypes);
- result = new Bean (m.getReturnType (), m.invoke (targetObject, args));
+ Method m = MethodUtils.getMethod (targetObject, call.getMethodName (),
+ argTypes);
+ result = new Bean (m.getReturnType (), m.invoke (targetObject, args));
} else {
- // find the class that provides the BSF services (done
- // this way via reflection to avoid a compile-time dependency on BSF)
- Class bc = Class.forName ("org.apache.soap.server.InvokeBSF");
+ // find the class that provides the BSF services (done
+ // this way via reflection to avoid a compile-time dependency on BSF)
+ Class bc = Class.forName ("org.apache.soap.server.InvokeBSF");
// now invoke the service
Class[] sig = {DeploymentDescriptor.class,
@@ -112,15 +112,15 @@
Method m = MethodUtils.getMethod (bc, "service", sig, true);
result = (Bean) m.invoke (null, new Object[] {dd, targetObject,
call.getMethodName (),
- args});
+ args});
}
} catch (InvocationTargetException e) {
Throwable t = e.getTargetException ();
throw new SOAPException (Constants.FAULT_CODE_SERVER, t.getMessage(), t);
} catch (ClassNotFoundException e) {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "Unable to load BSF: script services " +
- "unsupported with BSF", e);
+ "Unable to load BSF: script services " +
+ "unsupported with BSF", e);
} catch (Throwable t) {
throw new SOAPException (Constants.FAULT_CODE_SERVER, t.getMessage(), t);
}
@@ -129,9 +129,9 @@
Parameter ret = null;
if (result.type != void.class) {
ret = new Parameter (RPCConstants.ELEM_RETURN, result.type,
- result.value, null);
+ result.value, null);
}
return new Response (call.getTargetObjectURI (), call.getMethodName (),
- ret, null, null, respEncStyle);
+ ret, null, null, respEncStyle);
}
}
1.3 +38 -38 xml-soap/java/src/org/apache/soap/server/SMTP2HTTPBridge.java
Index: SMTP2HTTPBridge.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/SMTP2HTTPBridge.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SMTP2HTTPBridge.java 2000/05/30 10:24:05 1.2
+++ SMTP2HTTPBridge.java 2000/09/01 03:52:53 1.3
@@ -97,13 +97,13 @@
* @param smtpServer hostname of SMTP server
*/
public SMTP2HTTPBridge (/* POP3 params */
- long pollDelayMillis,
- String popServer, String popLoginName,
- String password,
- /* HTTP params */
- URL httpURL,
- /* SMTP params */
- String smtpServer) {
+ long pollDelayMillis,
+ String popServer, String popLoginName,
+ String password,
+ /* HTTP params */
+ URL httpURL,
+ /* SMTP params */
+ String smtpServer) {
/* set up the pop3 side */
this.pollDelayMillis = pollDelayMillis;
pop3.setPOP3ServerHost (popServer);
@@ -114,9 +114,9 @@
pop3.addMessageListener (
new com.ibm.network.mail.pop3.event.MessageListener () {
public void messageReceived (
- com.ibm.network.mail.pop3.event.MessageEvent me) {
- receiveMessage (me.getMessage ());
- }
+ com.ibm.network.mail.pop3.event.MessageEvent me) {
+ receiveMessage (me.getMessage ());
+ }
}
);
pop3.addStatusListener (new POP3StatusListener ());
@@ -128,14 +128,14 @@
smtp.setSmtpServerHost (smtpServer);
smtp.addStatusListener (new StatusListener () {
public void operationComplete (StatusEvent e) {
- System.err.println ("DONE: " + e.getStatusString ());
- synchronized (waitObject) {
- waitObject.notify ();
- }
+ System.err.println ("DONE: " + e.getStatusString ());
+ synchronized (waitObject) {
+ waitObject.notify ();
+ }
}
public void processStatus (StatusEvent e) {
- System.err.println ("Status update: " + e.getStatusString ());
+ System.err.println ("Status update: " + e.getStatusString ());
}
});
}
@@ -183,15 +183,15 @@
String payload = null;
try {
if (contentLength == -1) { // no content length; read the stream
- payload = IOUtils.getStringFromReader (httpResponse.content);
+ payload = IOUtils.getStringFromReader (httpResponse.content);
} else { // read contentLength chars
- char[] payloadChars = new char[contentLength];
- int offset = 0;
- while (offset < contentLength) {
- offset += httpResponse.content.read (payloadChars, offset,
- contentLength - offset);
- }
- payload = new String (payloadChars);
+ char[] payloadChars = new char[contentLength];
+ int offset = 0;
+ while (offset < contentLength) {
+ offset += httpResponse.content.read (payloadChars, offset,
+ contentLength - offset);
+ }
+ payload = new String (payloadChars);
}
} catch (Exception e) {
e.printStackTrace ();
@@ -207,44 +207,44 @@
MimeMessage msgResponse = new MimeMessage();
msgResponse.setContent (mbpResponse, "");
msgResponse.addHeader (SMTPConstants.SMTP_HEADER_SUBJECT,
- "Re: " + subject);
+ "Re: " + subject);
msgResponse.addHeader (Constants.HEADER_SOAP_ACTION, actionURI);
msgResponse.addHeader (SMTPConstants.SMTP_HEADER_FROM,
- SMTPUtils.getAddressFromAddressHeader (toAddr));
+ SMTPUtils.getAddressFromAddressHeader (toAddr));
String sendTo = SMTPUtils.getAddressFromAddressHeader (fromAddr);
msgResponse.addRecipients (MimeMessage.TO,
new InternetAddress[] {
new InternetAddress (sendTo)
- });
+ });
smtp.sendMessage (msgResponse);
}
public static void main (String[] args) throws Exception {
if (args.length != 6) {
System.err.println ("Usage: java " + SMTP2HTTPBridge.class.getName () +
- " polldelay \\");
+ " polldelay \\");
System.err.println ("\t\t pop3host pop3login pop3passwd httpurl " +
- "smtphostname");
+ "smtphostname");
System.err.println (" where:");
System.err.println (" polldelay number of millisec to " +
- "sleep between polls");
+ "sleep between polls");
System.err.println (" pop3host hostname of the POP3 server");
System.err.println (" pop3login login ID of POP3 account");
System.err.println (" pop3passwd POP3 account password");
System.err.println (" routerURL http URL of SOAP router to " +
- "bridge to");
+ "bridge to");
System.err.println (" smtphostname SMTP server host name");
System.exit (1);
}
SMTP2HTTPBridge sb = new SMTP2HTTPBridge (/* POP3 params */
- Integer.parseInt (args[0]),
- args[1],
- args[2],
- args[3],
- /* HTTP params */
- new URL (args[4]),
- /* SMTP params */
- args[5]);
+ Integer.parseInt (args[0]),
+ args[1],
+ args[2],
+ args[3],
+ /* HTTP params */
+ new URL (args[4]),
+ /* SMTP params */
+ args[5]);
new Thread (sb).start ();
}
}
1.5 +19 -19 xml-soap/java/src/org/apache/soap/server/ServiceManager.java
Index: ServiceManager.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/ServiceManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ServiceManager.java 2000/09/01 03:03:07 1.4
+++ ServiceManager.java 2000/09/01 03:52:53 1.5
@@ -89,17 +89,17 @@
// objects
smsdd.setMappings (new TypeMapping[] {
new TypeMapping (Constants.NS_URI_SOAP_ENC,
- new QName (Constants.NS_URI_XML_SOAP,
- "DeploymentDescriptor"),
- "org.apache.soap.server.DeploymentDescriptor",
- "org.apache.soap.encoding.soapenc.BeanSerializer",
- "org.apache.soap.encoding.soapenc.BeanSerializer"),
+ new QName (Constants.NS_URI_XML_SOAP,
+ "DeploymentDescriptor"),
+ "org.apache.soap.server.DeploymentDescriptor",
+ "org.apache.soap.encoding.soapenc.BeanSerializer",
+ "org.apache.soap.encoding.soapenc.BeanSerializer"),
new TypeMapping (Constants.NS_URI_SOAP_ENC,
- new QName (Constants.NS_URI_XML_SOAP,
- "TypeMapping"),
- "org.apache.soap.server.TypeMapping",
- "org.apache.soap.server.TypeMappingSerializer",
- "org.apache.soap.server.TypeMappingSerializer")});
+ new QName (Constants.NS_URI_XML_SOAP,
+ "TypeMapping"),
+ "org.apache.soap.server.TypeMapping",
+ "org.apache.soap.server.TypeMappingSerializer",
+ "org.apache.soap.server.TypeMappingSerializer")});
// load in a serialized thing
try {
@@ -125,8 +125,8 @@
os.close ();
} catch (Exception e) {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "Error saving services registry: " +
- e.getMessage ());
+ "Error saving services registry: " +
+ e.getMessage ());
};
}
@@ -138,9 +138,9 @@
String id = dd.getID ();
if (id.equals (ServerConstants.SERVICE_MANAGER_SERVICE_NAME)) {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "service management service '" +
- ServerConstants.SERVICE_MANAGER_SERVICE_NAME +
- "' cannot be user deployed");
+ "service management service '" +
+ ServerConstants.SERVICE_MANAGER_SERVICE_NAME +
+ "' cannot be user deployed");
}
dds.put (id, dd);
saveRegistry ();
@@ -160,7 +160,7 @@
saveRegistry ();
} else {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "service '" + id + "' unknown");
+ "service '" + id + "' unknown");
}
return dd;
}
@@ -181,10 +181,10 @@
} else {
DeploymentDescriptor dd = (DeploymentDescriptor) dds.get (id);
if (dd != null) {
- return dd;
+ return dd;
} else {
- throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "service '" + id + "' unknown");
+ throw new SOAPException (Constants.FAULT_CODE_SERVER,
+ "service '" + id + "' unknown");
}
}
}
1.5 +17 -17 xml-soap/java/src/org/apache/soap/server/ServiceManagerClient.java
Index: ServiceManagerClient.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/ServiceManagerClient.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ServiceManagerClient.java 2000/08/01 19:46:25 1.4
+++ ServiceManagerClient.java 2000/09/01 03:52:53 1.5
@@ -86,13 +86,13 @@
// register serializer/deserializer for DeploymentDescriptor.class
// and TypeMapping.class
smr.mapTypes (Constants.NS_URI_SOAP_ENC,
- new QName (Constants.NS_URI_XML_SOAP,
- "DeploymentDescriptor"),
- DeploymentDescriptor.class, bs, (Deserializer) bs);
+ new QName (Constants.NS_URI_XML_SOAP,
+ "DeploymentDescriptor"),
+ DeploymentDescriptor.class, bs, (Deserializer) bs);
bs = new TypeMappingSerializer ();
smr.mapTypes (Constants.NS_URI_SOAP_ENC,
- new QName (Constants.NS_URI_XML_SOAP, "TypeMapping"),
- TypeMapping.class, bs, (Deserializer) bs);
+ new QName (Constants.NS_URI_XML_SOAP, "TypeMapping"),
+ TypeMapping.class, bs, (Deserializer) bs);
}
private Response invokeMethod (String methodName, Parameter param)
@@ -119,7 +119,7 @@
public void deploy (DeploymentDescriptor dd) throws SOAPException {
Parameter p1 = new Parameter ("descriptor", DeploymentDescriptor.class,
- dd, null);
+ dd, null);
invokeMethod ("deploy", p1);
}
@@ -151,11 +151,11 @@
private static void badUsage () {
System.err.println ("Usage: java " +
- ServiceManagerClient.class.getName () +
- " url operation arguments");
+ ServiceManagerClient.class.getName () +
+ " url operation arguments");
System.err.println ("where");
System.err.println ("\turl is the XML-SOAP router's URL whose services" +
- " are managed");
+ " are managed");
System.err.println ("\toperation and arguments are:");
System.err.println ("\t\tdeploy deployment-descriptor-file.xml");
System.err.println ("\t\tlist");
@@ -180,7 +180,7 @@
op = args[1];
if (op.equals ("deploy")) {
if (args.length != 3) {
- badUsage ();
+ badUsage ();
}
FileReader fr = new FileReader (args[2]);
XMLParserLiaison xpl = new XercesParserLiaison ();
@@ -188,24 +188,24 @@
smc.deploy (DeploymentDescriptor.fromXML (doc.getDocumentElement ()));
} else if (op.equals ("undeploy")) {
if (args.length != 3) {
- badUsage ();
+ badUsage ();
}
smc.undeploy (args[2]);
} else if (op.equals ("list")) {
String[] sms = smc.list ();
if (sms != null) {
- System.out.println ("Deployed Services:");
- for (int i = 0; i < sms.length; i++) {
- System.out.println ("\t" + sms[i]);
- }
+ System.out.println ("Deployed Services:");
+ for (int i = 0; i < sms.length; i++) {
+ System.out.println ("\t" + sms[i]);
+ }
}
} else if (op.equals ("query")) {
if (args.length != 3) {
- badUsage ();
+ badUsage ();
}
DeploymentDescriptor dd = smc.query (args[2]);
if (dd != null) {
- dd.toXML (new OutputStreamWriter (System.out));
+ dd.toXML (new OutputStreamWriter (System.out));
}
} else {
badUsage ();
1.3 +1 -1 xml-soap/java/src/org/apache/soap/server/TypeMapping.java
Index: TypeMapping.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/TypeMapping.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TypeMapping.java 2000/05/30 10:24:06 1.2
+++ TypeMapping.java 2000/09/01 03:52:53 1.3
@@ -90,4 +90,4 @@
"java2XMLClassName=" + java2XMLClassName + "," +
"xml2JavaClassName=" + xml2JavaClassName + "]";
}
-}
\ No newline at end of file
+}
1.5 +32 -32 xml-soap/java/src/org/apache/soap/server/TypeMappingSerializer.java
Index: TypeMappingSerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/TypeMappingSerializer.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- TypeMappingSerializer.java 2000/09/01 02:43:56 1.4
+++ TypeMappingSerializer.java 2000/09/01 03:52:53 1.5
@@ -87,14 +87,14 @@
* @param xjmr unused
*/
public void marshall (String inScopeEncStyle, Class javaType, Object src,
- Object context, Writer sink, NSStack nsStack,
- XMLJavaMappingRegistry xjmr)
+ Object context, Writer sink, NSStack nsStack,
+ XMLJavaMappingRegistry xjmr)
throws IllegalArgumentException, IOException {
TypeMapping tm = (TypeMapping) src;
nsStack.pushScope ();
SoapEncUtils.generateStructureHeader (inScopeEncStyle, javaType, context,
- sink, nsStack, xjmr);
+ sink, nsStack, xjmr);
sink.write (StringUtils.lineSeparator);
// these namespaces being defined by the envelope stuff
@@ -102,41 +102,41 @@
String xsdPrefix = nsStack.getPrefixFromURI (Constants.NS_URI_SCHEMA_XSD);
if ((xsiPrefix == null) || (xsdPrefix == null)) {
throw new IllegalArgumentException ("required namespace names '" +
- Constants.NS_URI_SCHEMA_XSI +
- "' and/or '" +
- Constants.NS_URI_SCHEMA_XSD +
- "' is not defined.");
+ Constants.NS_URI_SCHEMA_XSI +
+ "' and/or '" +
+ Constants.NS_URI_SCHEMA_XSD +
+ "' is not defined.");
}
sink.write ("<encodingStyle " + xsiPrefix + ":type=\"" + xsdPrefix +
- ":string\">" + tm.encodingStyle + "</encodingStyle>");
+ ":string\">" + tm.encodingStyle + "</encodingStyle>");
sink.write (StringUtils.lineSeparator);
sink.write ("<elementType-ns " + xsiPrefix + ":type=\"" + xsdPrefix +
- ":string\">" + tm.elementType.getNamespaceURI () +
- "</elementType-ns>");
+ ":string\">" + tm.elementType.getNamespaceURI () +
+ "</elementType-ns>");
sink.write (StringUtils.lineSeparator);
sink.write ("<elementType-lp " + xsiPrefix + ":type=\"" + xsdPrefix +
- ":string\">" + tm.elementType.getLocalPart () +
- "</elementType-lp>");
+ ":string\">" + tm.elementType.getLocalPart () +
+ "</elementType-lp>");
sink.write (StringUtils.lineSeparator);
sink.write ("<javaType " + xsiPrefix + ":type=\"" + xsdPrefix +
- ":string\">" + tm.javaType + "</javaType>");
+ ":string\">" + tm.javaType + "</javaType>");
sink.write (StringUtils.lineSeparator);
if (tm.xml2JavaClassName != null) {
sink.write ("<xml2JavaClassName " + xsiPrefix + ":type=\"" + xsdPrefix +
- ":string\">" + tm.xml2JavaClassName +
- "</xml2JavaClassName>");
+ ":string\">" + tm.xml2JavaClassName +
+ "</xml2JavaClassName>");
sink.write (StringUtils.lineSeparator);
}
if (tm.java2XMLClassName != null) {
sink.write ("<java2XMLClassName " + xsiPrefix + ":type=\"" + xsdPrefix +
- ":string\">" + tm.java2XMLClassName +
- "</java2XMLClassName>");
+ ":string\">" + tm.java2XMLClassName +
+ "</java2XMLClassName>");
sink.write (StringUtils.lineSeparator);
}
@@ -149,7 +149,7 @@
* The deserializer interface.
*/
public Bean unmarshall (String inScopeEncStyle, QName elementType, Node src,
- XMLJavaMappingRegistry xjmr)
+ XMLJavaMappingRegistry xjmr)
throws IllegalArgumentException {
NodeList nl = src.getChildNodes ();
int nKids = nl.getLength ();
@@ -165,33 +165,33 @@
for (int i = 0; i < nKids; i++) {
Node n = nl.item (i);
if (n.getNodeType () != Node.ELEMENT_NODE) {
- continue;
+ continue;
}
Element e = (Element) n;
String tagName = e.getTagName ();
String elData = DOMUtils.getChildCharacterData (e);
if (tagName.equals ("encodingStyle")) {
- encodingStyle = elData;
+ encodingStyle = elData;
} else if (tagName.equals ("elementType-ns")) {
- elTypeNS = elData;
+ elTypeNS = elData;
} else if (tagName.equals ("elementType-lp")) {
- elTypeLP = elData;
+ elTypeLP = elData;
} else if (tagName.equals ("javaType")) {
- javaType = elData;
+ javaType = elData;
} else if (tagName.equals ("java2XMLClassName")) {
- java2XMLClassName = elData;
+ java2XMLClassName = elData;
} else if (tagName.equals ("xml2JavaClassName")) {
- xml2JavaClassName = elData;
+ xml2JavaClassName = elData;
} else {
- throw new IllegalArgumentException ("unknown element '" +
- tagName + "' while " +
- "unmarshalling a TypeMapping");
+ throw new IllegalArgumentException ("unknown element '" +
+ tagName + "' while " +
+ "unmarshalling a TypeMapping");
}
}
return new Bean (TypeMapping.class,
- new TypeMapping (encodingStyle,
- new QName (elTypeNS, elTypeLP),
- javaType,
- java2XMLClassName, xml2JavaClassName));
+ new TypeMapping (encodingStyle,
+ new QName (elTypeNS, elTypeLP),
+ javaType,
+ java2XMLClassName, xml2JavaClassName));
}
}
1.2 +17 -17 xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java
Index: MessageRouterServlet.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/MessageRouterServlet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- MessageRouterServlet.java 2000/09/01 02:45:42 1.1
+++ MessageRouterServlet.java 2000/09/01 03:52:56 1.2
@@ -98,11 +98,11 @@
// content length
ByteArrayOutputStream bytes = new ByteArrayOutputStream (4096) ;
PrintWriter out = new PrintWriter (new OutputStreamWriter (bytes, "UTF8"),
- true) ;
+ true) ;
try {
System.err.println (">>(" + new Date() +
- ") Processing SOAP Message request...");
+ ") Processing SOAP Message request...");
// get the envelope
Envelope msgEnv = ServerHTTPUtils.readEnvelopeFromRequest (req, res);
@@ -112,7 +112,7 @@
Body body = msgEnv.getBody ();
Element e = (Element) body.getBodyEntries().elementAt (0);
if (e == null) {
- res.sendError (res.SC_BAD_REQUEST, "Element's body is empty!");
+ res.sendError (res.SC_BAD_REQUEST, "Element's body is empty!");
}
String targetID = e.getNamespaceURI ();
String messageName = e.getLocalName ();
@@ -120,16 +120,16 @@
// is this a valid message?
DeploymentDescriptor dd = serviceManager.query (targetID);
if (!MessageRouter.validMessage (dd, messageName)) {
- throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "Message '" + messageName + "' unknown to " +
- "service '" + targetID + "'");
+ throw new SOAPException (Constants.FAULT_CODE_SERVER,
+ "Message '" + messageName + "' unknown to " +
+ "service '" + targetID + "'");
}
// get at the target object
Object targetObject = ServerHTTPUtils.getTargetObject (serviceManager,
- dd, targetID,
- this, session,
- context);
+ dd, targetID,
+ this, session,
+ context);
// invoke the method on the target object and give it the output
// stream to write to if needed
@@ -148,18 +148,18 @@
// that if the recepient is expecting to read some XML they'll
// get it. If not, it doesn't hurt.
String faultCode = Constants.FAULT_CODE_SERVER + ".Exception:" +
- t.getClass().getName ();
+ t.getClass().getName ();
String faultString = t.getMessage ();
Throwable pt = t;
status = res.SC_INTERNAL_SERVER_ERROR;
if (t instanceof SOAPException) {
- SOAPException e = (SOAPException) t;
- faultCode = e.getFaultCode ();
- if (faultCode.startsWith (Constants.FAULT_CODE_CLIENT)) {
- status = ServerConstants.SC_BAD_REQUEST;
- }
- Throwable tt = e.getTargetException ();
- pt = (tt == null) ? e : tt;
+ SOAPException e = (SOAPException) t;
+ faultCode = e.getFaultCode ();
+ if (faultCode.startsWith (Constants.FAULT_CODE_CLIENT)) {
+ status = ServerConstants.SC_BAD_REQUEST;
+ }
+ Throwable tt = e.getTargetException ();
+ pt = (tt == null) ? e : tt;
}
// build the fault envelope
1.5 +26 -26 xml-soap/java/src/org/apache/soap/server/http/RPCRouterServlet.java
Index: RPCRouterServlet.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/RPCRouterServlet.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- RPCRouterServlet.java 2000/09/01 02:45:42 1.4
+++ RPCRouterServlet.java 2000/09/01 03:52:57 1.5
@@ -103,20 +103,20 @@
try {
System.err.println (">>(" + new Date() +
- ") Processing SOAP RPC request...");
+ ") Processing SOAP RPC request...");
// extract the call
try {
- Envelope callEnv = ServerHTTPUtils.readEnvelopeFromRequest (req, res);
- call = RPCRouter.extractCallFromEnvelope (serviceManager, callEnv);
- targetID = call.getTargetObjectURI ();
+ Envelope callEnv = ServerHTTPUtils.readEnvelopeFromRequest (req, res);
+ call = RPCRouter.extractCallFromEnvelope (serviceManager, callEnv);
+ targetID = call.getTargetObjectURI ();
} catch (IllegalArgumentException e) {
- String msg = e.getMessage ();
- String faultCode =
- (msg != null && msg.equals (Constants.ERR_MSG_VERSION_MISMATCH))
- ? Constants.FAULT_CODE_VERSION_MISMATCH
- : Constants.FAULT_CODE_CLIENT;
- throw new SOAPException (faultCode, msg, e);
+ String msg = e.getMessage ();
+ String faultCode =
+ (msg != null && msg.equals (Constants.ERR_MSG_VERSION_MISMATCH))
+ ? Constants.FAULT_CODE_VERSION_MISMATCH
+ : Constants.FAULT_CODE_CLIENT;
+ throw new SOAPException (faultCode, msg, e);
}
// get the deployment descriptor for this service (will except if
@@ -125,16 +125,16 @@
// call on a valid method name?
if (!RPCRouter.validCall (dd, call)) {
- throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "Method '" + call.getMethodName () +
- "' is not supported.");
+ throw new SOAPException (Constants.FAULT_CODE_SERVER,
+ "Method '" + call.getMethodName () +
+ "' is not supported.");
}
// get at the target object
Object targetObject = ServerHTTPUtils.getTargetObject (serviceManager,
- dd, targetID,
- this, session,
- context);
+ dd, targetID,
+ this, session,
+ context);
// invoke the method on the target object
resp = RPCRouter.invoke (dd, call, targetObject);
@@ -144,18 +144,18 @@
// that if the recepient is expecting to read some XML they'll
// get it. If not, it doesn't hurt.
String faultCode = Constants.FAULT_CODE_SERVER + ".Exception:" +
- t.getClass().getName ();
+ t.getClass().getName ();
String faultString = t.getMessage ();
Throwable pt = t;
int status = res.SC_INTERNAL_SERVER_ERROR;
if (t instanceof SOAPException) {
- SOAPException e = (SOAPException) t;
- faultCode = e.getFaultCode ();
- if (faultCode.startsWith (Constants.FAULT_CODE_CLIENT)) {
- status = ServerConstants.SC_BAD_REQUEST;
- }
- Throwable tt = e.getTargetException ();
- pt = (tt == null) ? e : tt;
+ SOAPException e = (SOAPException) t;
+ faultCode = e.getFaultCode ();
+ if (faultCode.startsWith (Constants.FAULT_CODE_CLIENT)) {
+ status = ServerConstants.SC_BAD_REQUEST;
+ }
+ Throwable tt = e.getTargetException ();
+ pt = (tt == null) ? e : tt;
}
// build the fault envelope
@@ -178,8 +178,8 @@
try {
Envelope respEnvelope = resp.buildEnvelope ();
SOAPMappingRegistry smr = (call != null
- ? call.getSOAPMappingRegistry ()
- : new SOAPMappingRegistry());
+ ? call.getSOAPMappingRegistry ()
+ : new SOAPMappingRegistry());
respEnvelope.marshall (out, smr);
} catch (Exception e) {
1.2 +70 -70 xml-soap/java/src/org/apache/soap/server/http/ServerHTTPUtils.java
Index: ServerHTTPUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/server/http/ServerHTTPUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ServerHTTPUtils.java 2000/09/01 02:45:42 1.1
+++ ServerHTTPUtils.java 2000/09/01 03:52:57 1.2
@@ -34,8 +34,8 @@
synchronized (context) {
o = context.getAttribute (SERVICE_MANAGER_ID);
if (o == null) {
- o = new ServiceManager ();
- context.setAttribute (SERVICE_MANAGER_ID, o);
+ o = new ServiceManager ();
+ context.setAttribute (SERVICE_MANAGER_ID, o);
}
}
return (ServiceManager) o;
@@ -54,15 +54,15 @@
* error response
*/
static Envelope readEnvelopeFromRequest (HttpServletRequest req,
- HttpServletResponse res)
+ HttpServletResponse res)
throws SOAPException, IOException {
String contentType = req.getContentType ();
int contentLength = req.getContentLength ();
if ((contentType == null) ||
- !contentType.equals (Constants.HEADERVAL_CONTENT_TYPE)) {
+ !contentType.equals (Constants.HEADERVAL_CONTENT_TYPE)) {
res.sendError (res.SC_BAD_REQUEST, "Content type must be: '" +
- Constants.HEADERVAL_CONTENT_TYPE + "'.");
+ Constants.HEADERVAL_CONTENT_TYPE + "'.");
return null;
} else if (contentLength < 0) {
res.sendError (res.SC_BAD_REQUEST, "Content length must be specified.");
@@ -89,7 +89,7 @@
} catch (IllegalArgumentException e) {
String msg = e.getMessage ();
res.sendError (res.SC_BAD_REQUEST, "Error unmarshalling envelope: " +
- msg);
+ msg);
return null;
}
}
@@ -100,11 +100,11 @@
* service, the object's lifecycle is also managed here.
*/
static Object getTargetObject (ServiceManager serviceManager,
- DeploymentDescriptor dd,
- String targetID,
- HttpServlet thisServlet,
- HttpSession session,
- ServletContext context)
+ DeploymentDescriptor dd,
+ String targetID,
+ HttpServlet thisServlet,
+ HttpSession session,
+ ServletContext context)
throws SOAPException {
int scope = dd.getScope ();
byte providerType = dd.getProviderType ();
@@ -128,8 +128,8 @@
scopeLock = context;
} else {
throw new SOAPException (Constants.FAULT_CODE_SERVER,
- "Service uses deprecated object scope " +
- "'page': inform provider of error");
+ "Service uses deprecated object scope " +
+ "'page': inform provider of error");
}
// create the object if necessary
@@ -142,84 +142,84 @@
} else {
// locate (or create) the target object and invoke the method
synchronized (scopeLock) {
- if (scopeLock == session) {
- targetObject = session.getAttribute (targetID);
- } else if (scopeLock == context) {
- targetObject = context.getAttribute (targetID);
- } else {
- targetObject = null;
- }
- if (targetObject == null) {
- try {
- Class c = Class.forName (className);
- if (dd.getIsStatic ()) {
- targetObject = c;
- } else {
- targetObject = c.newInstance ();
- }
- freshObject = true;
- } catch (Exception e) {
- String msg;
- if (providerType == DeploymentDescriptor.PROVIDER_JAVA) {
- msg = "Unable to resolve target object: " + e.getMessage ();
- } else {
- msg = "Unable to load BSF: script services not available " +
- "without BSF: " + e.getMessage ();
- }
- throw new SOAPException (
- Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
- }
- }
- // remember the created instance if the scope is not REQUEST;
- // in that case the object is to be thrown away after handling
- // the request
- if (scopeLock == session) {
- session.setAttribute (targetID, targetObject);
- } else if (scopeLock == context) {
- context.setAttribute (targetID, targetObject);
- }
+ if (scopeLock == session) {
+ targetObject = session.getAttribute (targetID);
+ } else if (scopeLock == context) {
+ targetObject = context.getAttribute (targetID);
+ } else {
+ targetObject = null;
+ }
+ if (targetObject == null) {
+ try {
+ Class c = Class.forName (className);
+ if (dd.getIsStatic ()) {
+ targetObject = c;
+ } else {
+ targetObject = c.newInstance ();
+ }
+ freshObject = true;
+ } catch (Exception e) {
+ String msg;
+ if (providerType == DeploymentDescriptor.PROVIDER_JAVA) {
+ msg = "Unable to resolve target object: " + e.getMessage ();
+ } else {
+ msg = "Unable to load BSF: script services not available " +
+ "without BSF: " + e.getMessage ();
+ }
+ throw new SOAPException (
+ Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
+ }
+ }
+ // remember the created instance if the scope is not REQUEST;
+ // in that case the object is to be thrown away after handling
+ // the request
+ if (scopeLock == session) {
+ session.setAttribute (targetID, targetObject);
+ } else if (scopeLock == context) {
+ context.setAttribute (targetID, targetObject);
+ }
}
}
// if script provider type and first time to it, then load and
// exec the script
if (providerType != DeploymentDescriptor.PROVIDER_JAVA &&
- freshObject) {
+ freshObject) {
// find the class that provides the BSF services (done
// this way via reflection to avoid a static dependency on BSF)
Class bc = null;
try {
- bc = Class.forName (SCRIPT_INVOKER);
+ bc = Class.forName (SCRIPT_INVOKER);
} catch (Exception e) {
- String msg = "Unable to load BSF invoker (" + SCRIPT_INVOKER + ")" +
- ": script services not available without BSF: " + e.getMessage ();
- throw new SOAPException (Constants.FAULT_CODE_SERVER, msg, e);
+ String msg = "Unable to load BSF invoker (" + SCRIPT_INVOKER + ")" +
+ ": script services not available without BSF: " + e.getMessage ();
+ throw new SOAPException (Constants.FAULT_CODE_SERVER, msg, e);
}
- // get the script string to exec
+ // get the script string to exec
String script = dd.getScriptFilenameOrString ();
if (providerType == DeploymentDescriptor.PROVIDER_SCRIPT_FILE) {
- String fileName = context.getRealPath (script);
- try {
- script = IOUtils.getStringFromReader (new FileReader (fileName));
- } catch (Exception e) {
- String msg = "Unable to load script file (" + fileName + ")" +
- ": " + e.getMessage ();
- throw new SOAPException (Constants.FAULT_CODE_SERVER, msg, e);
- }
+ String fileName = context.getRealPath (script);
+ try {
+ script = IOUtils.getStringFromReader (new FileReader (fileName));
+ } catch (Exception e) {
+ String msg = "Unable to load script file (" + fileName + ")" +
+ ": " + e.getMessage ();
+ throw new SOAPException (Constants.FAULT_CODE_SERVER, msg, e);
+ }
}
// exec it
Class[] sig = {DeploymentDescriptor.class,
- Object.class,
- String.class};
+ Object.class,
+ String.class};
try {
- Method m = MethodUtils.getMethod (bc, "init", sig, true);
- m.invoke (null, new Object[] {dd, targetObject, script});
+ Method m = MethodUtils.getMethod (bc, "init", sig, true);
+ m.invoke (null, new Object[] {dd, targetObject, script});
} catch (Exception e) {
- String msg = "Unable to invoke init method of script invoker: " +
- "something is wrong (shouldn't happen)";
- throw new SOAPException (Constants.FAULT_CODE_SERVER, msg, e);
+ String msg = "Unable to invoke init method of script invoker: " +
+ "something is wrong (shouldn't happen)";
+ throw new SOAPException (Constants.FAULT_CODE_SERVER, msg, e);
}
}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/transport/SOAPTransport.java
Index: SOAPTransport.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/transport/SOAPTransport.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SOAPTransport.java 2000/05/30 10:24:12 1.2
+++ SOAPTransport.java 2000/09/01 03:52:59 1.3
@@ -100,4 +100,4 @@
* @return a hashtable containing all the headers
*/
public Hashtable getHeaders ();
-}
\ No newline at end of file
+}
1.3 +4 -4 xml-soap/java/src/org/apache/soap/transport/http/SOAPHTTPConnection.java
Index: SOAPHTTPConnection.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/transport/http/SOAPHTTPConnection.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SOAPHTTPConnection.java 2000/05/30 10:24:14 1.2
+++ SOAPHTTPConnection.java 2000/09/01 03:52:59 1.3
@@ -93,8 +93,8 @@
* @exception SOAPException with appropriate reason code if problem
*/
public void send (URL sendTo, String action, Hashtable headers,
- Envelope env,
- SOAPMappingRegistry smr) throws SOAPException {
+ Envelope env,
+ SOAPMappingRegistry smr) throws SOAPException {
try {
StringWriter payloadSW = new StringWriter ();
env.marshall (payloadSW, smr);
@@ -103,7 +103,7 @@
headers = new Hashtable ();
}
headers.put (Constants.HEADER_SOAP_ACTION,
- (action != null) ? ('\"' + action + '\"') : "");
+ (action != null) ? ('\"' + action + '\"') : "");
HTTPUtils.Response response = HTTPUtils.post (sendTo, headers,
Constants.HEADERVAL_CONTENT_TYPE,
@@ -137,4 +137,4 @@
public Hashtable getHeaders () {
return responseHeaders;
}
-}
\ No newline at end of file
+}
1.3 +2 -2 xml-soap/java/src/org/apache/soap/transport/smtp/SMTPUtils.java
Index: SMTPUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/transport/smtp/SMTPUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SMTPUtils.java 2000/05/30 10:24:18 1.2
+++ SMTPUtils.java 2000/09/01 03:53:00 1.3
@@ -81,9 +81,9 @@
String rest = header.substring (ltIndex + 1);
int rtIndex = rest.indexOf ('>');
if (rtIndex != -1) {
- return rest.substring (0, rtIndex);
+ return rest.substring (0, rtIndex);
} else {
- return null; // malformed?
+ return null; // malformed?
}
} else {
return header;
1.3 +52 -52 xml-soap/java/src/org/apache/soap/transport/smtp/SOAPSMTPConnection.java
Index: SOAPSMTPConnection.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/transport/smtp/SOAPSMTPConnection.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- SOAPSMTPConnection.java 2000/05/30 10:24:18 1.2
+++ SOAPSMTPConnection.java 2000/09/01 03:53:00 1.3
@@ -103,9 +103,9 @@
* @param popPassword password for login
*/
public SOAPSMTPConnection (String fromAddr, String subject,
- String smtpServer, long popPollDelay,
- String popServer, String popLogin,
- String popPassword) {
+ String smtpServer, long popPollDelay,
+ String popServer, String popLogin,
+ String popPassword) {
this.fromAddr = fromAddr;
this.subject = subject;
@@ -115,55 +115,55 @@
new com.ibm.network.mail.smtp.event.StatusListener () {
public void operationComplete (
com.ibm.network.mail.smtp.event.StatusEvent e) {
- System.err.println ("DONE: " + e.getStatusString ());
- synchronized (waitObject) {
- waitObject.notify ();
- }
- }
-
- public void processStatus (
+ System.err.println ("DONE: " + e.getStatusString ());
+ synchronized (waitObject) {
+ waitObject.notify ();
+ }
+ }
+
+ public void processStatus (
com.ibm.network.mail.smtp.event.StatusEvent e) {
- System.err.println ("Status update: " + e.getStatusString ());
- }
+ System.err.println ("Status update: " + e.getStatusString ());
+ }
}
);
// set up receive side
pop3Bean.setPOP3ServerHost (popServer);
pop3Bean.setUserOptions(/* popLoginName */ popLogin,
- /* password */ popPassword,
- /* leaveMessagesOnServer */ false,
- /* rememberPassword */ false);
+ /* password */ popPassword,
+ /* leaveMessagesOnServer */ false,
+ /* rememberPassword */ false);
pop3Bean.addMessageListener (
new com.ibm.network.mail.pop3.event.MessageListener () {
public void messageReceived (
com.ibm.network.mail.pop3.event.MessageEvent me) {
- /* extract the stuff from the POP message received */
- MimeMessage msg = me.getMessage ();
- String subj = msg.getHeader (SMTPConstants.SMTP_HEADER_SUBJECT);
- if (subj != null) {
- responseHeaders.put (SMTPConstants.SMTP_HEADER_SUBJECT, subj);
- }
- String soapAction =
- msg.getHeader (org.apache.soap.Constants.HEADER_SOAP_ACTION);
- if (soapAction != null) {
- responseHeaders.put (org.apache.soap.Constants.HEADER_SOAP_ACTION,
- soapAction);
- }
- String to = msg.getHeader (SMTPConstants.SMTP_HEADER_TO);
- if (to != null) {
- responseHeaders.put (SMTPConstants.SMTP_HEADER_TO, to);
- }
- String from = msg.getHeader (SMTPConstants.SMTP_HEADER_FROM);
- if (from != null) {
- responseHeaders.put (SMTPConstants.SMTP_HEADER_FROM, from);
- }
- MimeBodyPart mbp = (MimeBodyPart) msg.getContent ();
- byte[] ba = (byte[]) mbp.getContent ();
- String baStr = new String (ba);
- responseReader = new BufferedReader (new StringReader (baStr));
- responseReceived = true;
- }
+ /* extract the stuff from the POP message received */
+ MimeMessage msg = me.getMessage ();
+ String subj = msg.getHeader (SMTPConstants.SMTP_HEADER_SUBJECT);
+ if (subj != null) {
+ responseHeaders.put (SMTPConstants.SMTP_HEADER_SUBJECT, subj);
+ }
+ String soapAction =
+ msg.getHeader (org.apache.soap.Constants.HEADER_SOAP_ACTION);
+ if (soapAction != null) {
+ responseHeaders.put (org.apache.soap.Constants.HEADER_SOAP_ACTION,
+ soapAction);
+ }
+ String to = msg.getHeader (SMTPConstants.SMTP_HEADER_TO);
+ if (to != null) {
+ responseHeaders.put (SMTPConstants.SMTP_HEADER_TO, to);
+ }
+ String from = msg.getHeader (SMTPConstants.SMTP_HEADER_FROM);
+ if (from != null) {
+ responseHeaders.put (SMTPConstants.SMTP_HEADER_FROM, from);
+ }
+ MimeBodyPart mbp = (MimeBodyPart) msg.getContent ();
+ byte[] ba = (byte[]) mbp.getContent ();
+ String baStr = new String (ba);
+ responseReader = new BufferedReader (new StringReader (baStr));
+ responseReceived = true;
+ }
}
);
pop3Bean.addStatusListener (new POP3StatusListener ());
@@ -182,8 +182,8 @@
* @exception SOAPException with appropriate reason code if problem
*/
public void send (URL toAddr, String actionURI, Hashtable headers,
- Envelope env,
- SOAPMappingRegistry smr) throws SOAPException {
+ Envelope env,
+ SOAPMappingRegistry smr) throws SOAPException {
MimeMessage msg = new MimeMessage();
MimeBodyPart mbp = new MimeBodyPart ();
@@ -202,9 +202,9 @@
msg.addHeader ("SOAPAction", actionURI);
msg.addHeader ("From", fromAddr);
msg.addRecipients (MimeMessage.TO,
- new InternetAddress[] {
+ new InternetAddress[] {
new InternetAddress (toAddr.getFile ())
- });
+ });
smtpBean.sendMessage (msg);
@@ -230,13 +230,13 @@
responseReceived = false;
while (!responseReceived) {
try {
- if (pop3Bean.isReady ()) {
- System.err.println ("SOAPSMTPConnection: Polling for response ..");
- pop3Bean.receiveMessage ();
- if (responseReceived) {
- break;
- }
- }
+ if (pop3Bean.isReady ()) {
+ System.err.println ("SOAPSMTPConnection: Polling for response ..");
+ pop3Bean.receiveMessage ();
+ if (responseReceived) {
+ break;
+ }
+ }
Thread.sleep (popPollDelay);
} catch (Exception e) {
e.printStackTrace ();
1.3 +1 -2 xml-soap/java/src/org/apache/soap/util/IOUtils.java
Index: IOUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/IOUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- IOUtils.java 2000/05/30 10:24:23 1.2
+++ IOUtils.java 2000/09/01 03:53:03 1.3
@@ -55,7 +55,7 @@
* <http://www.apache.org/>.
*/
-/* $Id: IOUtils.java,v 1.2 2000/05/30 10:24:23 rubys Exp $ */
+/* $Id: IOUtils.java,v 1.3 2000/09/01 03:53:03 sanjiva Exp $ */
package org.apache.soap.util;
@@ -64,7 +64,7 @@
/**
* This file is a collection of input/output utilities.
*
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
* @author Sanjiva Weerawarana
* @author Matthew J. Duftler
*/
@@ -89,4 +89,3 @@
return swOut.toString();
}
}
-
1.3 +3 -3 xml-soap/java/src/org/apache/soap/util/ObjectRegistry.java
Index: ObjectRegistry.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/ObjectRegistry.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- ObjectRegistry.java 2000/05/30 10:24:26 1.2
+++ ObjectRegistry.java 2000/09/01 03:53:03 1.3
@@ -55,7 +55,7 @@
* <http://www.apache.org/>.
*/
-/* $Id: ObjectRegistry.java,v 1.2 2000/05/30 10:24:26 rubys Exp $ */
+/* $Id: ObjectRegistry.java,v 1.3 2000/09/01 03:53:03 sanjiva Exp $ */
package org.apache.soap.util;
@@ -69,7 +69,7 @@
* there, it will cascade to the parent <em>ObjectRegistry</em>.
* All registration is always local. [??]
*
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
* @author Sanjiva Weerawarana
* @author Matthew J. Duftler
*/
@@ -108,4 +108,4 @@
return obj;
}
-}
\ No newline at end of file
+}
1.3 +3 -3 xml-soap/java/src/org/apache/soap/util/StringUtils.java
Index: StringUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/StringUtils.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- StringUtils.java 2000/05/30 10:24:27 1.2
+++ StringUtils.java 2000/09/01 03:53:03 1.3
@@ -55,7 +55,7 @@
* <http://www.apache.org/>.
*/
-/* $Id: StringUtils.java,v 1.2 2000/05/30 10:24:27 rubys Exp $ */
+/* $Id: StringUtils.java,v 1.3 2000/09/01 03:53:03 sanjiva Exp $ */
package org.apache.soap.util;
@@ -68,7 +68,7 @@
/**
* Deals with strings (probably need to elaborate some more).
*
- * @version $Revision: 1.2 $
+ * @version $Revision: 1.3 $
* @author Matthew J. Duftler
*/
public class StringUtils
@@ -458,4 +458,4 @@
{
return IOUtils.getStringFromReader(getContentAsReader(url));
}
-}
\ No newline at end of file
+}
1.5 +26 -26 xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java
Index: HTTPUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/HTTPUtils.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- HTTPUtils.java 2000/07/20 20:58:17 1.4
+++ HTTPUtils.java 2000/09/01 03:53:05 1.5
@@ -87,7 +87,7 @@
public BufferedReader content;
Response (int statusCode, String statusString, Hashtable headers,
- int contentLength, String contentType, BufferedReader content) {
+ int contentLength, String contentType, BufferedReader content) {
this.statusCode = statusCode;
this.statusString = statusString;
this.headers = headers;
@@ -108,7 +108,7 @@
* @param content the body of the post
*/
public static Response post (URL url, Hashtable headers,
- String contentType, String content)
+ String contentType, String content)
throws IllegalArgumentException {
PrintWriter out = null;
BufferedReader in = null;
@@ -124,14 +124,14 @@
in = new BufferedReader (new InputStreamReader (s.getInputStream ()));
} catch (Exception e) {
throw new IllegalArgumentException ("error opening socket: " +
- e.getMessage ());
+ e.getMessage ());
}
/* send it out */
out.print (HTTP_POST + " " + url.getFile() + " HTTP/" + HTTP_VERSION +
- "\r\n");
+ "\r\n");
out.print (HEADER_HOST + ": " + url.getHost () + ':' + url.getPort () +
- "\r\n");
+ "\r\n");
out.print (HEADER_CONTENT_TYPE + ": " + contentType + "\r\n");
out.print (HEADER_CONTENT_LENGTH + ": " + content.length () + "\r\n");
for (Enumeration e = headers.keys (); e.hasMoreElements (); ) {
@@ -153,15 +153,15 @@
statusCode = Integer.parseInt (st.nextToken ());
StringBuffer sb = new StringBuffer ();
while (st.hasMoreTokens ()) {
- sb.append (st.nextToken ());
- if (st.hasMoreTokens ()) {
- sb.append (" ");
- }
+ sb.append (st.nextToken ());
+ if (st.hasMoreTokens ()) {
+ sb.append (" ");
+ }
}
statusString = sb.toString ();
} catch (Exception e) {
throw new IllegalArgumentException ("error parsing HTTP status line: " +
- e.getMessage ());
+ e.getMessage ());
}
/* get the headers */
@@ -171,28 +171,28 @@
try {
String line = null;
while ((line = in.readLine ()) != null) {
- if (line.length () == 0) {
- break;
- }
- int colonIndex = line.indexOf (':');
- String fieldName = line.substring (0, colonIndex);
- String fieldValue = line.substring (colonIndex + 1).trim ();
- if (fieldName.equals (HEADER_CONTENT_LENGTH)) {
- respContentLength = Integer.parseInt (fieldValue);
- } else if (fieldName.equals (HEADER_CONTENT_TYPE)) {
- respContentType = fieldValue;
- } else {
- respHeaders.put (fieldName, fieldValue);
- }
+ if (line.length () == 0) {
+ break;
+ }
+ int colonIndex = line.indexOf (':');
+ String fieldName = line.substring (0, colonIndex);
+ String fieldValue = line.substring (colonIndex + 1).trim ();
+ if (fieldName.equals (HEADER_CONTENT_LENGTH)) {
+ respContentLength = Integer.parseInt (fieldValue);
+ } else if (fieldName.equals (HEADER_CONTENT_TYPE)) {
+ respContentType = fieldValue;
+ } else {
+ respHeaders.put (fieldName, fieldValue);
+ }
}
} catch (Exception e) {
throw new IllegalArgumentException ("error reading HTTP headers: " +
- e.getMessage ());
+ e.getMessage ());
}
/* all done */
return new Response (statusCode, statusString, respHeaders,
- respContentLength, respContentType, in);
+ respContentLength, respContentType, in);
}
-}
\ No newline at end of file
+}
1.3 +8 -8 xml-soap/java/src/org/apache/soap/util/net/Relay.java
Index: Relay.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/Relay.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Relay.java 2000/05/30 10:24:34 1.2
+++ Relay.java 2000/09/01 03:53:05 1.3
@@ -86,19 +86,19 @@
try {
while ((n = in.read (buf)) > 0) {
- out.write (buf, 0, n);
- out.flush ();
- if (ta != null) {
- ta.append (new String (buf, 0, n));
- }
+ out.write (buf, 0, n);
+ out.flush ();
+ if (ta != null) {
+ ta.append (new String (buf, 0, n));
+ }
}
} catch (IOException e) {
} finally {
try {
- in.close ();
- out.close ();
+ in.close ();
+ out.close ();
} catch (IOException e) {
}
}
}
-}
\ No newline at end of file
+}
1.3 +3 -3 xml-soap/java/src/org/apache/soap/util/net/TcpTunnel.java
Index: TcpTunnel.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/TcpTunnel.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TcpTunnel.java 2000/05/30 10:24:34 1.2
+++ TcpTunnel.java 2000/09/01 03:53:06 1.3
@@ -79,7 +79,7 @@
int tunnelport = Integer.parseInt (args[2]);
System.out.println ("TcpTunnel: ready to rock and roll on port " +
- listenport);
+ listenport);
ServerSocket ss = new ServerSocket (listenport);
while (true) {
@@ -90,8 +90,8 @@
Socket st = new Socket (tunnelhost, tunnelport);
System.out.println ("TcpTunnel: tunnelling port " + listenport +
- " to port " + tunnelport + " on host " +
- tunnelhost);
+ " to port " + tunnelport + " on host " +
+ tunnelhost);
// relay the stuff thru
new Relay (sc.getInputStream(), st.getOutputStream(), null).start ();
1.3 +44 -44 xml-soap/java/src/org/apache/soap/util/net/TcpTunnelGui.java
Index: TcpTunnelGui.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/net/TcpTunnelGui.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- TcpTunnelGui.java 2000/05/30 10:24:35 1.2
+++ TcpTunnelGui.java 2000/09/01 03:53:06 1.3
@@ -87,23 +87,23 @@
addWindowListener (new WindowAdapter () {
public void windowClosing (WindowEvent e) {
- System.exit (0);
+ System.exit (0);
}
});
// show info
setTitle ("TCP Tunnel/Monitor: Tunneling localhost:" + listenPort +
- " to " + tunnelHost + ":" + tunnelPort);
+ " to " + tunnelHost + ":" + tunnelPort);
// labels
p = new Panel ();
p.setLayout (new BorderLayout ());
Label l1, l2;
p.add ("West",
- l1 = new Label ("From localhost:" + listenPort, Label.CENTER));
+ l1 = new Label ("From localhost:" + listenPort, Label.CENTER));
p.add ("East",
- l2 = new Label ("From " + tunnelHost + ":" + tunnelPort,
- Label.CENTER));
+ l2 = new Label ("From " + tunnelHost + ":" + tunnelPort,
+ Label.CENTER));
add ("North", p);
// the monitor part
@@ -121,8 +121,8 @@
Button b = new Button ("Clear");
b.addActionListener (new ActionListener () {
public void actionPerformed (ActionEvent e) {
- listenText.setText ("");
- tunnelText.setText ("");
+ listenText.setText ("");
+ tunnelText.setText ("");
}
});
p.add (b);
@@ -166,7 +166,7 @@
public static void main (String args[]) throws IOException {
if (args.length != 3) {
System.err.println ("Usage: java TcpTunnelGui listenport tunnelhost " +
- "tunnelport");
+ "tunnelport");
System.exit (1);
}
@@ -179,42 +179,42 @@
// create the server thread
Thread server = new Thread () {
public void run () {
- ServerSocket ss = null;
- Label status = ttg.getStatus ();
- try {
- ss = new ServerSocket (ttg.getListenPort ());
- } catch (Exception e) {
- e.printStackTrace ();
- System.exit (1);
- }
- while (true) {
- try {
- status.setText ("Listening for connections on port " +
- ttg.getListenPort () + " ...");
- // accept the connection from my client
- Socket sc = ss.accept ();
-
- // connect to the thing I'm tunnelling for
- Socket st = new Socket (ttg.getTunnelHost (),
- ttg.getTunnelPort ());
-
- status.setText ("Tunnelling port " + ttg.getListenPort () +
- " to port " + ttg.getTunnelPort () +
- " on host " + ttg.getTunnelHost () + " ...");
-
- // relay the stuff thru
- new Relay (sc.getInputStream (), st.getOutputStream (),
- ttg.getListenText ()).start ();
- new Relay (st.getInputStream (), sc.getOutputStream (),
- ttg.getTunnelText ()).start ();
-
- // that's it .. they're off; now I go back to my stuff.
- } catch (Exception ee) {
- status.setText ("Ouch! [See console for details]: " +
- ee.getMessage ());
- ee.printStackTrace ();
- }
- }
+ ServerSocket ss = null;
+ Label status = ttg.getStatus ();
+ try {
+ ss = new ServerSocket (ttg.getListenPort ());
+ } catch (Exception e) {
+ e.printStackTrace ();
+ System.exit (1);
+ }
+ while (true) {
+ try {
+ status.setText ("Listening for connections on port " +
+ ttg.getListenPort () + " ...");
+ // accept the connection from my client
+ Socket sc = ss.accept ();
+
+ // connect to the thing I'm tunnelling for
+ Socket st = new Socket (ttg.getTunnelHost (),
+ ttg.getTunnelPort ());
+
+ status.setText ("Tunnelling port " + ttg.getListenPort () +
+ " to port " + ttg.getTunnelPort () +
+ " on host " + ttg.getTunnelHost () + " ...");
+
+ // relay the stuff thru
+ new Relay (sc.getInputStream (), st.getOutputStream (),
+ ttg.getListenText ()).start ();
+ new Relay (st.getInputStream (), sc.getOutputStream (),
+ ttg.getTunnelText ()).start ();
+
+ // that's it .. they're off; now I go back to my stuff.
+ } catch (Exception ee) {
+ status.setText ("Ouch! [See console for details]: " +
+ ee.getMessage ());
+ ee.printStackTrace ();
+ }
+ }
}
};
server.start ();
1.4 +1 -1 xml-soap/java/src/org/apache/soap/util/xml/DOM2Writer.java
Index: DOM2Writer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/DOM2Writer.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- DOM2Writer.java 2000/07/20 14:36:06 1.3
+++ DOM2Writer.java 2000/09/01 03:53:08 1.4
@@ -390,4 +390,4 @@
return (str.toString());
}
-}
\ No newline at end of file
+}
1.2 +2 -2 xml-soap/java/src/org/apache/soap/util/xml/DOMUtils.java
Index: DOMUtils.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/DOMUtils.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DOMUtils.java 2000/07/20 14:36:06 1.1
+++ DOMUtils.java 2000/09/01 03:53:08 1.2
@@ -220,7 +220,7 @@
* @return the namespace URI or null if not found
*/
public static String getNamespaceURIFromPrefix (Node context,
- String prefix) {
+ String prefix) {
short nodeType = context.getNodeType ();
Node tempNode = null;
@@ -262,4 +262,4 @@
return null;
}
-}
\ No newline at end of file
+}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/util/xml/DOMWriter.java
Index: DOMWriter.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/DOMWriter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DOMWriter.java 2000/05/30 10:24:41 1.2
+++ DOMWriter.java 2000/09/01 03:53:10 1.3
@@ -287,4 +287,4 @@
return (str.toString());
}
-}
\ No newline at end of file
+}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/util/xml/NSStack.java
Index: NSStack.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/NSStack.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- NSStack.java 2000/05/30 10:24:43 1.2
+++ NSStack.java 2000/09/01 03:53:10 1.3
@@ -131,7 +131,7 @@
String uniquePrefix = getPrefixFromURI (URI);
if (uniquePrefix == null) {
do {
- uniquePrefix = nsPrefixPrefix + nsPrefixCount++;
+ uniquePrefix = nsPrefixPrefix + nsPrefixCount++;
} while (getURIFromPrefix (uniquePrefix) != null);
addNSDeclaration (uniquePrefix, URI);
}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/util/xml/Serializer.java
Index: Serializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/Serializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Serializer.java 2000/05/30 10:24:44 1.2
+++ Serializer.java 2000/09/01 03:53:10 1.3
@@ -73,4 +73,4 @@
Object context, Writer sink, NSStack nsStack,
XMLJavaMappingRegistry xjmr)
throws IllegalArgumentException, IOException;
-}
\ No newline at end of file
+}
1.3 +3 -3 xml-soap/java/src/org/apache/soap/util/xml/XMIDeserializer.java
Index: XMIDeserializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/XMIDeserializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMIDeserializer.java 2000/05/30 10:24:45 1.2
+++ XMIDeserializer.java 2000/09/01 03:53:10 1.3
@@ -99,7 +99,7 @@
}catch(IOException e){
e.printStackTrace(System.err);
}
-
+
Iterator it = objects.iterator();
@@ -110,7 +110,7 @@
else
throw new IllegalArgumentException("Unable to unmarshall XMI-encoded " +
"object.");
-
+
}
-}
\ No newline at end of file
+}
1.3 +4 -4 xml-soap/java/src/org/apache/soap/util/xml/XMISerializer.java
Index: XMISerializer.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/XMISerializer.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMISerializer.java 2000/05/30 10:24:45 1.2
+++ XMISerializer.java 2000/09/01 03:53:11 1.3
@@ -95,7 +95,7 @@
return;
}
else if( javaType ==java.lang.String.class )
- {
+ {
sink.write("<java.lang.String value='" + src + "' />");
return;
}
@@ -118,9 +118,9 @@
while( (left = tmpin.available())> 0 )
{
- len = tmpin.read(readinto, 0, Math.min(left, XMISerializer.CONV_BSIZE));
- String convert = new String(readinto, 0, len);
- sink.write(convert);
+ len = tmpin.read(readinto, 0, Math.min(left, XMISerializer.CONV_BSIZE));
+ String convert = new String(readinto, 0, len);
+ sink.write(convert);
}
tmpout.close();
1.3 +1 -1 xml-soap/java/src/org/apache/soap/util/xml/XMLJavaMappingRegistry.java
Index: XMLJavaMappingRegistry.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/XMLJavaMappingRegistry.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XMLJavaMappingRegistry.java 2000/05/30 10:24:46 1.2
+++ XMLJavaMappingRegistry.java 2000/09/01 03:53:11 1.3
@@ -226,4 +226,4 @@
{
return javaType != null ? StringUtils.getClassName(javaType) : "null";
}
-}
\ No newline at end of file
+}
1.3 +1 -1 xml-soap/java/src/org/apache/soap/util/xml/XercesParserLiaison.java
Index: XercesParserLiaison.java
===================================================================
RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/util/xml/XercesParserLiaison.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- XercesParserLiaison.java 2000/05/30 10:24:46 1.2
+++ XercesParserLiaison.java 2000/09/01 03:53:11 1.3
@@ -102,4 +102,4 @@
{
return new DocumentImpl();
}
-}
\ No newline at end of file
+}