Re: Nil problem - one more step

2002-06-27 Thread Sam Ruby

Costin Manolache wrote:
> 
> After updating apacheSOAP to the latest version - it
> seems it detects nil corectly, and it has another problem.
> 
> What apacheSOAP sends is:
> 
> 
> What Axis sends:
> 
> 
> ApacheSOAP doesn't accept this input, since the type is missing
> ( xsd:string ) - so it fails with:
> 
> No mapping found for ':name' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'.;
> targetException=java.lang.IllegalArgumentException: No mapping found for
> ':name' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.]
> 
>   at org.apache.soap.rpc.Call.invoke(Call.java:296)

So, provide a mapping for :name to String.  For an example of how to do 
so, take a look at 
http://cvs.apache.org/viewcvs.cgi/xml-soap/java/samples/interop/DeploymentDescriptor.xml

Note: the syntax by which you do this with Apache SOAP is invalid XML. 
This means that you can't browse this example using modern browsers 
(e.g. IE6 or Mozilla 1.0) or use Xerces 2.0.  However, this error is not 
caught by Crimson or Xerces 1.x.

For more details, see 
http://marc.theaimsgroup.com/?l=soap-dev&m=101283660613843&w=2

> I have no idea who is right and who is wrong, but it's very
> scarry.

Per the SOAP specification, xsi:type is optional.  However, in April, I 
did add the code to Axis to add this information.

- Sam Ruby


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: xml-soap/java/samples/multiref - New directory

2002-06-27 Thread snichol

snichol 2002/06/27 19:28:30

  xml-soap/java/samples/multiref - New directory

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




cvs commit: xml-soap/java/src/org/apache/soap/rpc SOAPContext.java

2002-06-27 Thread snichol

snichol 2002/06/27 19:33:17

  Modified:java/docs changes.html intro.html
   java/src/org/apache/soap Body.java
   java/src/org/apache/soap/encoding/soapenc
BeanSerializer.java ParameterSerializer.java
SoapEncUtils.java
   java/src/org/apache/soap/rpc SOAPContext.java
  Added:   java/samples/multiref CircularBean.java
DeploymentDescriptor.xml GetCircularBean.java
MultiRefService.java README testit.cmd testit.sh
   java/src/org/apache/soap/encoding/soapenc
BeanMultiRefSerializer.java MultiRefContext.java
  Log:
  Enhance multi-reference deserialization by only deserializing
  the object once, regardless of the number of references.  Provide
  initial support for multi-reference serialization.  The new
  BeanMultiRefSerializer is the only serializer for which
  multi-reference serialization is supported.  Added a sample to
  demonstrate serialization and deserialization of a cyclic graph
  of beans.
  
  Revision  ChangesPath
  1.30  +7 -0  xml-soap/java/docs/changes.html
  
  Index: changes.html
  ===
  RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
  retrieving revision 1.29
  retrieving revision 1.30
  diff -u -r1.29 -r1.30
  --- changes.html  26 Jun 2002 11:39:52 -  1.29
  +++ changes.html  28 Jun 2002 02:33:16 -  1.30
  @@ -39,6 +39,13 @@
 namespace URI for SOAP-ENC to imply a type.  For now, just
 support SOAP-ENC:Array.  This allows interop with .NET arrays
 without a type mapping.
  +  Enhance multi-reference deserialization by only deserializing
  +  the object once, regardless of the number of references.  Provide
  +  initial support for multi-reference serialization.  The new
  +  BeanMultiRefSerializer is the only serializer for which
  +  multi-reference serialization is supported.  Added a sample to
  +  demonstrate serialization and deserialization of a cyclic graph
  +  of beans.
   
 
   
  
  
  
  1.11  +0 -1  xml-soap/java/docs/intro.html
  
  Index: intro.html
  ===
  RCS file: /home/cvs/xml-soap/java/docs/intro.html,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- intro.html2 May 2002 19:09:14 -   1.10
  +++ intro.html28 Jun 2002 02:33:16 -  1.11
  @@ -95,7 +95,6 @@
   checking
   root attribute
   actor attribute and SOAP intermediaries
  -does not use multi-ref accessors during serialization
   
   
   The following limitations on SOAP Messages with Attachments
  
  
  
  1.1  xml-soap/java/samples/multiref/CircularBean.java
  
  Index: CircularBean.java
  ===
  /*
   * The Apache Software License, Version 1.1
   *
   *
   * Copyright (c) 2000 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *notice, this list of conditions and the following disclaimer in
   *the documentation and/or other materials provided with the
   *distribution.
   *
   * 3. The end-user documentation included with the redistribution,
   *if any, must include the following acknowledgment:
   *   "This product includes software developed by the
   *Apache Software Foundation (http://www.apache.org/)."
   *Alternately, this acknowledgment may appear in the software itself,
   *if and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "SOAP" and "Apache Software Foundation" must
   *not be used to endorse or promote products derived from this
   *software without prior written permission. For written
   *permission, please contact [EMAIL PROTECTED]
   *
   * 5. Products derived from this software may not be called "Apache",
   *nor may "Apache" appear in their name, without prior written
   *permission of the Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIM

cvs commit: xml-soap/java/src/org/apache/soap/rpc SOAPContext.java

2002-06-27 Thread snichol

snichol 2002/06/27 20:07:36

  Modified:java/docs changes.html
   java/src/org/apache/soap Body.java Constants.java
   java/src/org/apache/soap/encoding/soapenc
BeanMultiRefSerializer.java SoapEncUtils.java
   java/src/org/apache/soap/rpc SOAPContext.java
  Log:
  Generalize a little so that multi-reference serializers besides
  BeanMultiRefSerializer can exist.
  
  Revision  ChangesPath
  1.31  +1 -1  xml-soap/java/docs/changes.html
  
  Index: changes.html
  ===
  RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
  retrieving revision 1.30
  retrieving revision 1.31
  diff -u -r1.30 -r1.31
  --- changes.html  28 Jun 2002 02:33:16 -  1.30
  +++ changes.html  28 Jun 2002 03:07:35 -  1.31
  @@ -42,7 +42,7 @@
 Enhance multi-reference deserialization by only deserializing
 the object once, regardless of the number of references.  Provide
 initial support for multi-reference serialization.  The new
  -  BeanMultiRefSerializer is the only serializer for which
  +  BeanMultiRefSerializer is an example of a serializer for which
 multi-reference serialization is supported.  Added a sample to
 demonstrate serialization and deserialization of a cyclic graph
 of beans.
  
  
  
  1.8   +4 -5  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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- Body.java 28 Jun 2002 02:33:16 -  1.7
  +++ Body.java 28 Jun 2002 03:07:36 -  1.8
  @@ -175,17 +175,16 @@
   
   // serialize any multiRefs
   if (ctx.getMultiRefCount() > 0) {
  -  // TODO: support other serializers by having them registered
  -  // with the SOAPContext for each multiRef.
  -  BeanSerializer ser = new BeanSerializer();
  +  // This context tells serialization that this is a multiRef with id=X
 MultiRefContext mrc = new MultiRefContext();
 // Note: it is *essential* that one keep calling the getMultiRefCount method
 // rather than storing the result in a variable, as the act of serialization
 // could generate additional multiRefs.
 for (int id = 0; id < ctx.getMultiRefCount(); id++) {
  -Object o = ctx.getMultiRef(id);
  +Object obj = ctx.getMultiRefObject(id);
  +Serializer ser = ctx.getMultiRefSerializer(id);
   mrc.setId(id);
  -ser.marshall(actualEncStyle, o.getClass(), o, mrc,
  +ser.marshall(actualEncStyle, obj.getClass(), obj, mrc,
sink, nsStack, xjmr, ctx);
   sink.write(StringUtils.lineSeparator);
 }
  
  
  
  1.26  +2 -0  xml-soap/java/src/org/apache/soap/Constants.java
  
  Index: Constants.java
  ===
  RCS file: /home/cvs/xml-soap/java/src/org/apache/soap/Constants.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- Constants.java10 Jun 2002 03:49:57 -  1.25
  +++ Constants.java28 Jun 2002 03:07:36 -  1.26
  @@ -64,6 +64,7 @@
*
* @author Sanjiva Weerawarana ([EMAIL PROTECTED])
* @author Matthew J. Duftler ([EMAIL PROTECTED])
  + * @author Scott Nichol ([EMAIL PROTECTED])
*/
   public class Constants
   {
  @@ -176,6 +177,7 @@
   
 // Attribute values.
 public static String ATTRVAL_TRUE = "true";
  +  public static String ATTRVAL_MULTIREF_ID_PREFIX = "id";
   
 // SOAP defined fault codes.
 public static String FAULT_CODE_VERSION_MISMATCH =
  
  
  
  1.2   +3 -3  
xml-soap/java/src/org/apache/soap/encoding/soapenc/BeanMultiRefSerializer.java
  
  Index: BeanMultiRefSerializer.java
  ===
  RCS file: 
/home/cvs/xml-soap/java/src/org/apache/soap/encoding/soapenc/BeanMultiRefSerializer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- BeanMultiRefSerializer.java   28 Jun 2002 02:33:16 -  1.1
  +++ BeanMultiRefSerializer.java   28 Jun 2002 03:07:36 -  1.2
  @@ -73,7 +73,6 @@
* @author Scott Nichol ([EMAIL PROTECTED])
*/
   public class BeanMultiRefSerializer implements Serializer, Deserializer {
  -// Delegate de-serialization to the BeanSerializer
   private BeanSerializer deser = new BeanSerializer();
   
   public void marshall(String inScopeEncStyle, Class javaType, Object src,
  @@ -82,8 +81,8 @@
   throws IllegalArgumentException, IOException {
   nsStack.pushScope();
   
  -int id = ctx.addMultiRef(src);
  -sink.write("<" + context.toString() + " " + Constants.ATTR_R

Re: HashMap/Hashtable, nil/null and timing.

2002-06-27 Thread Sam Ruby

[switching to soap-dev from axis-dev]

Sanjiva Weerawarana wrote:
> 
> Since Apache SOAP was buggy on this until 2.3.1, I wonder whether
> we should add code to make Apache SOAP 2.3.1 "bug-compatible" with
> older versions of Apache SOAP?? It'll be a damn headache otherwise ..

I believe the only way to be "bug compatible" and produce valid SOAP 
messages would be to revert the default back to a prior schema version 
such as 1999.

- Sam Ruby



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: HashMap/Hashtable, nil/null and timing.

2002-06-27 Thread Scott Nichol

> [switching to soap-dev from axis-dev]
>
> Sanjiva Weerawarana wrote:
> >
> > Since Apache SOAP was buggy on this until 2.3.1, I wonder whether
> > we should add code to make Apache SOAP 2.3.1 "bug-compatible" with
> > older versions of Apache SOAP?? It'll be a damn headache otherwise ..
>
> I believe the only way to be "bug compatible" and produce valid SOAP
> messages would be to revert the default back to a prior schema version
> such as 1999.
>
> - Sam Ruby
>

One simple thing to improve compatibility is to have 2.3.1+ accept the buggy
output from 2.3 and earlier.  I just made the change and was about to commit
it.

Scott Nichol



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Nil problem - one more step

2002-06-27 Thread costinm

On Thu, 27 Jun 2002, Sam Ruby wrote:

> > targetException=java.lang.IllegalArgumentException: No mapping found for
> > ':name' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.]
> > 
> >   at org.apache.soap.rpc.Call.invoke(Call.java:296)
> 
> So, provide a mapping for :name to String.  For an example of how to do 
> so, take a look at 

For every field in the object hierarchy that may be null ???


> Per the SOAP specification, xsi:type is optional.  However, in April, I 
> did add the code to Axis to add this information.

I now use cvs HEAD on both xml-axis and xml-soap. 

I'll just try to move to axis on both ends ( well, a modified axis 
that uses Hashtables for maps, otherwise I'll have to edit too
much code )

Any info on this one ? Is the correct mapping a Hashtable or a 
HashMap ?


Costin


--
To unsubscribe, e-mail:   
For additional commands, e-mail: