You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@ws.apache.org by sn...@apache.org on 2002/07/11 17:45:54 UTC

cvs commit: xml-soap/java/docs changes.html

snichol     2002/07/11 08:45:54

  Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
               java/docs changes.html
  Log:
  Remove deadlock for a service that in the constructor invokes
  another service when both services are at application scope.  The
  deadlock still occurs if both services are at session scope.
  
  Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
  
  Revision  Changes    Path
  1.24      +18 -5     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.23
  retrieving revision 1.24
  diff -u -r1.23 -r1.24
  --- ServerHTTPUtils.java	25 Jun 2002 05:16:27 -0000	1.23
  +++ ServerHTTPUtils.java	11 Jul 2002 15:45:53 -0000	1.24
  @@ -246,7 +246,20 @@
       } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
         scopeLock = session;
       } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
  -      scopeLock = context;
  +      try {
  +        scopeLock = ctxt.loadClass(className);
  +      } catch (ClassNotFoundException e) {
  +        String msg;
  +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
  +            providerType == DeploymentDescriptor.PROVIDER_USER_DEFINED) {
  +          msg = "Unable to resolve target object at application scope: " + e.getMessage ();
  +        } else {
  +          msg = "Unable to load BSF at application scope: script services not available " +
  +            "without BSF: " + e.getMessage ();
  +        }
  +        throw new SOAPException (
  +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
  +      }
       } else {
         throw new SOAPException (Constants.FAULT_CODE_SERVER,
                                  "Service uses deprecated object scope " +
  @@ -264,10 +277,10 @@
         // locate (or create) the target object and invoke the method
         if ( scopeLock == null ) scopeLock = className ; // Just pick something
         synchronized (scopeLock) {
  -        if (scopeLock == session) {
  +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
             // targetObject = session.getAttribute (targetID);
             targetObject = session.getValue (targetID);
  -        } else if (scopeLock == context) {
  +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
             targetObject = context.getAttribute (targetID);
           } else {
             targetObject = null;
  @@ -295,10 +308,10 @@
               // 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) {
  +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
                 session.putValue (targetID, targetObject);
                 // session.setAttribute (targetID, targetObject);
  -            } else if (scopeLock == context) {
  +            } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
                 context.setAttribute (targetID, targetObject);
               }
             } catch (Exception e) {
  
  
  
  1.32      +3 -0      xml-soap/java/docs/changes.html
  
  Index: changes.html
  ===================================================================
  RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
  retrieving revision 1.31
  retrieving revision 1.32
  diff -u -r1.31 -r1.32
  --- changes.html	28 Jun 2002 03:07:35 -0000	1.31
  +++ changes.html	11 Jul 2002 15:45:54 -0000	1.32
  @@ -46,6 +46,9 @@
         multi-reference serialization is supported.  Added a sample to
         demonstrate serialization and deserialization of a cyclic graph
         of beans.</li>
  +      <li>Remove deadlock for a service that in the constructor invokes
  +      another service when both services are at application scope.  The
  +      deadlock still occurs if both services are at session scope.</li>
       </ul>
     </li>
   </ul>
  
  
  

Re: Sending/Receiving objetcs. Please, Please, Please ... help.

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
Thanks Scott,

I will look into it. But may require your help again.

Indrasish.

Scott Nichol wrote:

> The AddressBook sample in Apache SOAP is an example of serializing objects
> that are Java Beans.  This is done with the BeanSerializer.
>
> The best text documentation for Apache SOAP is included with the
> distribution.  The User's Guide includes some information on Creating Type
> Mappings, although not with an example of a customer [de-]serializer.  Of
> course, the most detailed and accurate documentation is the source code
> itself.
>
> Roughly speaking, a QName is a fully qualified XML element or attribute
> name.  By fully qualified, I mean it is both the namespace and the local
> part of the name.
>
> You may find some tutorials helpful.  You could just do a Google search
> (i.e. help thyself), but here are a couple of suggestions:
>
> http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-soap.html (be sure to
> read parts 2 and 3, too)
> http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
> http://www.soapuser.com/server1.html
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Indrasish N Basuroychowdhury"
> <in...@fanniemae.com>
> To: <so...@xml.apache.org>
> Cc: <xm...@apache.org>
> Sent: Thursday, July 11, 2002 12:09 PM
> Subject: Sending/Receiving objetcs. Please, Please, Please ... help.
>
> > Hope people do not get tired with me as I am sending this message
> repeatedly.
> > I need help for sending/receiving objects as well as
> serializing/deserializing them.
> > Can anyone help me in findinf example of how to do it and what type of
> objects I can send and
> > receive (I know String Boolean, Int, Double etc.) How about any object I
> want to send /receive.
> > Also, I would like to know about QName. What exactly is it and where/how
> do we use it.
> > Experts please help me. It is a question of retaining my job now.
> > Also, where is a good documentation for Apache soap?
> >
> > Thanks,
> >
> > Indrasish.
> >
> > snichol@apache.org wrote:
> >
> > > snichol     2002/07/11 08:45:54
> > >
> > >   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
> > >                java/docs changes.html
> > >   Log:
> > >   Remove deadlock for a service that in the constructor invokes
> > >   another service when both services are at application scope.  The
> > >   deadlock still occurs if both services are at session scope.
> > >
> > >   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
> > >
> > >   Revision  Changes    Path
> > >   1.24      +18 -5
> 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.23
> > >   retrieving revision 1.24
> > >   diff -u -r1.23 -r1.24
> > >   --- ServerHTTPUtils.java      25 Jun 2002 05:16:27 -0000      1.23
> > >   +++ ServerHTTPUtils.java      11 Jul 2002 15:45:53 -0000      1.24
> > >   @@ -246,7 +246,20 @@
> > >        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >          scopeLock = session;
> > >        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> > >   -      scopeLock = context;
> > >   +      try {
> > >   +        scopeLock = ctxt.loadClass(className);
> > >   +      } catch (ClassNotFoundException e) {
> > >   +        String msg;
> > >   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
> > >   +            providerType ==
> DeploymentDescriptor.PROVIDER_USER_DEFINED) {
> > >   +          msg = "Unable to resolve target object at application
> scope: " + e.getMessage ();
> > >   +        } else {
> > >   +          msg = "Unable to load BSF at application scope: script
> services not available " +
> > >   +            "without BSF: " + e.getMessage ();
> > >   +        }
> > >   +        throw new SOAPException (
> > >   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
> > >   +      }
> > >        } else {
> > >          throw new SOAPException (Constants.FAULT_CODE_SERVER,
> > >                                   "Service uses deprecated object scope
> " +
> > >   @@ -264,10 +277,10 @@
> > >          // locate (or create) the target object and invoke the method
> > >          if ( scopeLock == null ) scopeLock = className ; // Just pick
> something
> > >          synchronized (scopeLock) {
> > >   -        if (scopeLock == session) {
> > >   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >              // targetObject = session.getAttribute (targetID);
> > >              targetObject = session.getValue (targetID);
> > >   -        } else if (scopeLock == context) {
> > >   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> > >              targetObject = context.getAttribute (targetID);
> > >            } else {
> > >              targetObject = null;
> > >   @@ -295,10 +308,10 @@
> > >                // 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) {
> > >   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >                  session.putValue (targetID, targetObject);
> > >                  // session.setAttribute (targetID, targetObject);
> > >   -            } else if (scopeLock == context) {
> > >   +            } else if (scope ==
> DeploymentDescriptor.SCOPE_APPLICATION) {
> > >                  context.setAttribute (targetID, targetObject);
> > >                }
> > >              } catch (Exception e) {
> > >
> > >
> > >
> > >   1.32      +3 -0      xml-soap/java/docs/changes.html
> > >
> > >   Index: changes.html
> > >   ===================================================================
> > >   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
> > >   retrieving revision 1.31
> > >   retrieving revision 1.32
> > >   diff -u -r1.31 -r1.32
> > >   --- changes.html      28 Jun 2002 03:07:35 -0000      1.31
> > >   +++ changes.html      11 Jul 2002 15:45:54 -0000      1.32
> > >   @@ -46,6 +46,9 @@
> > >          multi-reference serialization is supported.  Added a sample to
> > >          demonstrate serialization and deserialization of a cyclic graph
> > >          of beans.</li>
> > >   +      <li>Remove deadlock for a service that in the constructor
> invokes
> > >   +      another service when both services are at application scope.
> The
> > >   +      deadlock still occurs if both services are at session
> scope.</li>
> > >        </ul>
> > >      </li>
> > >    </ul>
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > > For additional commands, e-mail: <ma...@xml.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
> >
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>



Re: Sending/Receiving objetcs. Please, Please, Please ... help.

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
Scott,

What is local part name in the QName. Is it the name of the parameter of the web
service.

Thanks for all the help.

Indrasish.

Scott Nichol wrote:

> The AddressBook sample in Apache SOAP is an example of serializing objects
> that are Java Beans.  This is done with the BeanSerializer.
>
> The best text documentation for Apache SOAP is included with the
> distribution.  The User's Guide includes some information on Creating Type
> Mappings, although not with an example of a customer [de-]serializer.  Of
> course, the most detailed and accurate documentation is the source code
> itself.
>
> Roughly speaking, a QName is a fully qualified XML element or attribute
> name.  By fully qualified, I mean it is both the namespace and the local
> part of the name.
>
> You may find some tutorials helpful.  You could just do a Google search
> (i.e. help thyself), but here are a couple of suggestions:
>
> http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-soap.html (be sure to
> read parts 2 and 3, too)
> http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
> http://www.soapuser.com/server1.html
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Indrasish N Basuroychowdhury"
> <in...@fanniemae.com>
> To: <so...@xml.apache.org>
> Cc: <xm...@apache.org>
> Sent: Thursday, July 11, 2002 12:09 PM
> Subject: Sending/Receiving objetcs. Please, Please, Please ... help.
>
> > Hope people do not get tired with me as I am sending this message
> repeatedly.
> > I need help for sending/receiving objects as well as
> serializing/deserializing them.
> > Can anyone help me in findinf example of how to do it and what type of
> objects I can send and
> > receive (I know String Boolean, Int, Double etc.) How about any object I
> want to send /receive.
> > Also, I would like to know about QName. What exactly is it and where/how
> do we use it.
> > Experts please help me. It is a question of retaining my job now.
> > Also, where is a good documentation for Apache soap?
> >
> > Thanks,
> >
> > Indrasish.
> >
> > snichol@apache.org wrote:
> >
> > > snichol     2002/07/11 08:45:54
> > >
> > >   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
> > >                java/docs changes.html
> > >   Log:
> > >   Remove deadlock for a service that in the constructor invokes
> > >   another service when both services are at application scope.  The
> > >   deadlock still occurs if both services are at session scope.
> > >
> > >   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
> > >
> > >   Revision  Changes    Path
> > >   1.24      +18 -5
> 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.23
> > >   retrieving revision 1.24
> > >   diff -u -r1.23 -r1.24
> > >   --- ServerHTTPUtils.java      25 Jun 2002 05:16:27 -0000      1.23
> > >   +++ ServerHTTPUtils.java      11 Jul 2002 15:45:53 -0000      1.24
> > >   @@ -246,7 +246,20 @@
> > >        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >          scopeLock = session;
> > >        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> > >   -      scopeLock = context;
> > >   +      try {
> > >   +        scopeLock = ctxt.loadClass(className);
> > >   +      } catch (ClassNotFoundException e) {
> > >   +        String msg;
> > >   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
> > >   +            providerType ==
> DeploymentDescriptor.PROVIDER_USER_DEFINED) {
> > >   +          msg = "Unable to resolve target object at application
> scope: " + e.getMessage ();
> > >   +        } else {
> > >   +          msg = "Unable to load BSF at application scope: script
> services not available " +
> > >   +            "without BSF: " + e.getMessage ();
> > >   +        }
> > >   +        throw new SOAPException (
> > >   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
> > >   +      }
> > >        } else {
> > >          throw new SOAPException (Constants.FAULT_CODE_SERVER,
> > >                                   "Service uses deprecated object scope
> " +
> > >   @@ -264,10 +277,10 @@
> > >          // locate (or create) the target object and invoke the method
> > >          if ( scopeLock == null ) scopeLock = className ; // Just pick
> something
> > >          synchronized (scopeLock) {
> > >   -        if (scopeLock == session) {
> > >   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >              // targetObject = session.getAttribute (targetID);
> > >              targetObject = session.getValue (targetID);
> > >   -        } else if (scopeLock == context) {
> > >   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> > >              targetObject = context.getAttribute (targetID);
> > >            } else {
> > >              targetObject = null;
> > >   @@ -295,10 +308,10 @@
> > >                // 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) {
> > >   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >                  session.putValue (targetID, targetObject);
> > >                  // session.setAttribute (targetID, targetObject);
> > >   -            } else if (scopeLock == context) {
> > >   +            } else if (scope ==
> DeploymentDescriptor.SCOPE_APPLICATION) {
> > >                  context.setAttribute (targetID, targetObject);
> > >                }
> > >              } catch (Exception e) {
> > >
> > >
> > >
> > >   1.32      +3 -0      xml-soap/java/docs/changes.html
> > >
> > >   Index: changes.html
> > >   ===================================================================
> > >   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
> > >   retrieving revision 1.31
> > >   retrieving revision 1.32
> > >   diff -u -r1.31 -r1.32
> > >   --- changes.html      28 Jun 2002 03:07:35 -0000      1.31
> > >   +++ changes.html      11 Jul 2002 15:45:54 -0000      1.32
> > >   @@ -46,6 +46,9 @@
> > >          multi-reference serialization is supported.  Added a sample to
> > >          demonstrate serialization and deserialization of a cyclic graph
> > >          of beans.</li>
> > >   +      <li>Remove deadlock for a service that in the constructor
> invokes
> > >   +      another service when both services are at application scope.
> The
> > >   +      deadlock still occurs if both services are at session
> scope.</li>
> > >        </ul>
> > >      </li>
> > >    </ul>
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > > For additional commands, e-mail: <ma...@xml.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
> >
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Sending/Receiving objetcs. Please, Please, Please ... help.

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
Scott,

What is local part name in the QName. Is it the name of the parameter of the web
service.

Thanks for all the help.

Indrasish.

Scott Nichol wrote:

> The AddressBook sample in Apache SOAP is an example of serializing objects
> that are Java Beans.  This is done with the BeanSerializer.
>
> The best text documentation for Apache SOAP is included with the
> distribution.  The User's Guide includes some information on Creating Type
> Mappings, although not with an example of a customer [de-]serializer.  Of
> course, the most detailed and accurate documentation is the source code
> itself.
>
> Roughly speaking, a QName is a fully qualified XML element or attribute
> name.  By fully qualified, I mean it is both the namespace and the local
> part of the name.
>
> You may find some tutorials helpful.  You could just do a Google search
> (i.e. help thyself), but here are a couple of suggestions:
>
> http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-soap.html (be sure to
> read parts 2 and 3, too)
> http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
> http://www.soapuser.com/server1.html
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Indrasish N Basuroychowdhury"
> <in...@fanniemae.com>
> To: <so...@xml.apache.org>
> Cc: <xm...@apache.org>
> Sent: Thursday, July 11, 2002 12:09 PM
> Subject: Sending/Receiving objetcs. Please, Please, Please ... help.
>
> > Hope people do not get tired with me as I am sending this message
> repeatedly.
> > I need help for sending/receiving objects as well as
> serializing/deserializing them.
> > Can anyone help me in findinf example of how to do it and what type of
> objects I can send and
> > receive (I know String Boolean, Int, Double etc.) How about any object I
> want to send /receive.
> > Also, I would like to know about QName. What exactly is it and where/how
> do we use it.
> > Experts please help me. It is a question of retaining my job now.
> > Also, where is a good documentation for Apache soap?
> >
> > Thanks,
> >
> > Indrasish.
> >
> > snichol@apache.org wrote:
> >
> > > snichol     2002/07/11 08:45:54
> > >
> > >   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
> > >                java/docs changes.html
> > >   Log:
> > >   Remove deadlock for a service that in the constructor invokes
> > >   another service when both services are at application scope.  The
> > >   deadlock still occurs if both services are at session scope.
> > >
> > >   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
> > >
> > >   Revision  Changes    Path
> > >   1.24      +18 -5
> 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.23
> > >   retrieving revision 1.24
> > >   diff -u -r1.23 -r1.24
> > >   --- ServerHTTPUtils.java      25 Jun 2002 05:16:27 -0000      1.23
> > >   +++ ServerHTTPUtils.java      11 Jul 2002 15:45:53 -0000      1.24
> > >   @@ -246,7 +246,20 @@
> > >        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >          scopeLock = session;
> > >        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> > >   -      scopeLock = context;
> > >   +      try {
> > >   +        scopeLock = ctxt.loadClass(className);
> > >   +      } catch (ClassNotFoundException e) {
> > >   +        String msg;
> > >   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
> > >   +            providerType ==
> DeploymentDescriptor.PROVIDER_USER_DEFINED) {
> > >   +          msg = "Unable to resolve target object at application
> scope: " + e.getMessage ();
> > >   +        } else {
> > >   +          msg = "Unable to load BSF at application scope: script
> services not available " +
> > >   +            "without BSF: " + e.getMessage ();
> > >   +        }
> > >   +        throw new SOAPException (
> > >   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
> > >   +      }
> > >        } else {
> > >          throw new SOAPException (Constants.FAULT_CODE_SERVER,
> > >                                   "Service uses deprecated object scope
> " +
> > >   @@ -264,10 +277,10 @@
> > >          // locate (or create) the target object and invoke the method
> > >          if ( scopeLock == null ) scopeLock = className ; // Just pick
> something
> > >          synchronized (scopeLock) {
> > >   -        if (scopeLock == session) {
> > >   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >              // targetObject = session.getAttribute (targetID);
> > >              targetObject = session.getValue (targetID);
> > >   -        } else if (scopeLock == context) {
> > >   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> > >              targetObject = context.getAttribute (targetID);
> > >            } else {
> > >              targetObject = null;
> > >   @@ -295,10 +308,10 @@
> > >                // 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) {
> > >   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >                  session.putValue (targetID, targetObject);
> > >                  // session.setAttribute (targetID, targetObject);
> > >   -            } else if (scopeLock == context) {
> > >   +            } else if (scope ==
> DeploymentDescriptor.SCOPE_APPLICATION) {
> > >                  context.setAttribute (targetID, targetObject);
> > >                }
> > >              } catch (Exception e) {
> > >
> > >
> > >
> > >   1.32      +3 -0      xml-soap/java/docs/changes.html
> > >
> > >   Index: changes.html
> > >   ===================================================================
> > >   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
> > >   retrieving revision 1.31
> > >   retrieving revision 1.32
> > >   diff -u -r1.31 -r1.32
> > >   --- changes.html      28 Jun 2002 03:07:35 -0000      1.31
> > >   +++ changes.html      11 Jul 2002 15:45:54 -0000      1.32
> > >   @@ -46,6 +46,9 @@
> > >          multi-reference serialization is supported.  Added a sample to
> > >          demonstrate serialization and deserialization of a cyclic graph
> > >          of beans.</li>
> > >   +      <li>Remove deadlock for a service that in the constructor
> invokes
> > >   +      another service when both services are at application scope.
> The
> > >   +      deadlock still occurs if both services are at session
> scope.</li>
> > >        </ul>
> > >      </li>
> > >    </ul>
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > > For additional commands, e-mail: <ma...@xml.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
> >
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>



Re: Sending/Receiving objetcs. Please, Please, Please ... help.

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
Thanks Scott,

I will look into it. But may require your help again.

Indrasish.

Scott Nichol wrote:

> The AddressBook sample in Apache SOAP is an example of serializing objects
> that are Java Beans.  This is done with the BeanSerializer.
>
> The best text documentation for Apache SOAP is included with the
> distribution.  The User's Guide includes some information on Creating Type
> Mappings, although not with an example of a customer [de-]serializer.  Of
> course, the most detailed and accurate documentation is the source code
> itself.
>
> Roughly speaking, a QName is a fully qualified XML element or attribute
> name.  By fully qualified, I mean it is both the namespace and the local
> part of the name.
>
> You may find some tutorials helpful.  You could just do a Google search
> (i.e. help thyself), but here are a couple of suggestions:
>
> http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-soap.html (be sure to
> read parts 2 and 3, too)
> http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
> http://www.soapuser.com/server1.html
>
> Scott Nichol
>
> ----- Original Message -----
> From: "Indrasish N Basuroychowdhury"
> <in...@fanniemae.com>
> To: <so...@xml.apache.org>
> Cc: <xm...@apache.org>
> Sent: Thursday, July 11, 2002 12:09 PM
> Subject: Sending/Receiving objetcs. Please, Please, Please ... help.
>
> > Hope people do not get tired with me as I am sending this message
> repeatedly.
> > I need help for sending/receiving objects as well as
> serializing/deserializing them.
> > Can anyone help me in findinf example of how to do it and what type of
> objects I can send and
> > receive (I know String Boolean, Int, Double etc.) How about any object I
> want to send /receive.
> > Also, I would like to know about QName. What exactly is it and where/how
> do we use it.
> > Experts please help me. It is a question of retaining my job now.
> > Also, where is a good documentation for Apache soap?
> >
> > Thanks,
> >
> > Indrasish.
> >
> > snichol@apache.org wrote:
> >
> > > snichol     2002/07/11 08:45:54
> > >
> > >   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
> > >                java/docs changes.html
> > >   Log:
> > >   Remove deadlock for a service that in the constructor invokes
> > >   another service when both services are at application scope.  The
> > >   deadlock still occurs if both services are at session scope.
> > >
> > >   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
> > >
> > >   Revision  Changes    Path
> > >   1.24      +18 -5
> 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.23
> > >   retrieving revision 1.24
> > >   diff -u -r1.23 -r1.24
> > >   --- ServerHTTPUtils.java      25 Jun 2002 05:16:27 -0000      1.23
> > >   +++ ServerHTTPUtils.java      11 Jul 2002 15:45:53 -0000      1.24
> > >   @@ -246,7 +246,20 @@
> > >        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >          scopeLock = session;
> > >        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> > >   -      scopeLock = context;
> > >   +      try {
> > >   +        scopeLock = ctxt.loadClass(className);
> > >   +      } catch (ClassNotFoundException e) {
> > >   +        String msg;
> > >   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
> > >   +            providerType ==
> DeploymentDescriptor.PROVIDER_USER_DEFINED) {
> > >   +          msg = "Unable to resolve target object at application
> scope: " + e.getMessage ();
> > >   +        } else {
> > >   +          msg = "Unable to load BSF at application scope: script
> services not available " +
> > >   +            "without BSF: " + e.getMessage ();
> > >   +        }
> > >   +        throw new SOAPException (
> > >   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
> > >   +      }
> > >        } else {
> > >          throw new SOAPException (Constants.FAULT_CODE_SERVER,
> > >                                   "Service uses deprecated object scope
> " +
> > >   @@ -264,10 +277,10 @@
> > >          // locate (or create) the target object and invoke the method
> > >          if ( scopeLock == null ) scopeLock = className ; // Just pick
> something
> > >          synchronized (scopeLock) {
> > >   -        if (scopeLock == session) {
> > >   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >              // targetObject = session.getAttribute (targetID);
> > >              targetObject = session.getValue (targetID);
> > >   -        } else if (scopeLock == context) {
> > >   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> > >              targetObject = context.getAttribute (targetID);
> > >            } else {
> > >              targetObject = null;
> > >   @@ -295,10 +308,10 @@
> > >                // 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) {
> > >   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> > >                  session.putValue (targetID, targetObject);
> > >                  // session.setAttribute (targetID, targetObject);
> > >   -            } else if (scopeLock == context) {
> > >   +            } else if (scope ==
> DeploymentDescriptor.SCOPE_APPLICATION) {
> > >                  context.setAttribute (targetID, targetObject);
> > >                }
> > >              } catch (Exception e) {
> > >
> > >
> > >
> > >   1.32      +3 -0      xml-soap/java/docs/changes.html
> > >
> > >   Index: changes.html
> > >   ===================================================================
> > >   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
> > >   retrieving revision 1.31
> > >   retrieving revision 1.32
> > >   diff -u -r1.31 -r1.32
> > >   --- changes.html      28 Jun 2002 03:07:35 -0000      1.31
> > >   +++ changes.html      11 Jul 2002 15:45:54 -0000      1.32
> > >   @@ -46,6 +46,9 @@
> > >          multi-reference serialization is supported.  Added a sample to
> > >          demonstrate serialization and deserialization of a cyclic graph
> > >          of beans.</li>
> > >   +      <li>Remove deadlock for a service that in the constructor
> invokes
> > >   +      another service when both services are at application scope.
> The
> > >   +      deadlock still occurs if both services are at session
> scope.</li>
> > >        </ul>
> > >      </li>
> > >    </ul>
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > > For additional commands, e-mail: <ma...@xml.apache.org>
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
> >
> >
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Sending/Receiving objetcs. Please, Please, Please ... help.

Posted by Scott Nichol <sn...@scottnichol.com>.
The AddressBook sample in Apache SOAP is an example of serializing objects
that are Java Beans.  This is done with the BeanSerializer.

The best text documentation for Apache SOAP is included with the
distribution.  The User's Guide includes some information on Creating Type
Mappings, although not with an example of a customer [de-]serializer.  Of
course, the most detailed and accurate documentation is the source code
itself.

Roughly speaking, a QName is a fully qualified XML element or attribute
name.  By fully qualified, I mean it is both the namespace and the local
part of the name.

You may find some tutorials helpful.  You could just do a Google search
(i.e. help thyself), but here are a couple of suggestions:

http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-soap.html (be sure to
read parts 2 and 3, too)
http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
http://www.soapuser.com/server1.html

Scott Nichol

----- Original Message -----
From: "Indrasish N Basuroychowdhury"
<in...@fanniemae.com>
To: <so...@xml.apache.org>
Cc: <xm...@apache.org>
Sent: Thursday, July 11, 2002 12:09 PM
Subject: Sending/Receiving objetcs. Please, Please, Please ... help.


> Hope people do not get tired with me as I am sending this message
repeatedly.
> I need help for sending/receiving objects as well as
serializing/deserializing them.
> Can anyone help me in findinf example of how to do it and what type of
objects I can send and
> receive (I know String Boolean, Int, Double etc.) How about any object I
want to send /receive.
> Also, I would like to know about QName. What exactly is it and where/how
do we use it.
> Experts please help me. It is a question of retaining my job now.
> Also, where is a good documentation for Apache soap?
>
> Thanks,
>
> Indrasish.
>
> snichol@apache.org wrote:
>
> > snichol     2002/07/11 08:45:54
> >
> >   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
> >                java/docs changes.html
> >   Log:
> >   Remove deadlock for a service that in the constructor invokes
> >   another service when both services are at application scope.  The
> >   deadlock still occurs if both services are at session scope.
> >
> >   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
> >
> >   Revision  Changes    Path
> >   1.24      +18 -5
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.23
> >   retrieving revision 1.24
> >   diff -u -r1.23 -r1.24
> >   --- ServerHTTPUtils.java      25 Jun 2002 05:16:27 -0000      1.23
> >   +++ ServerHTTPUtils.java      11 Jul 2002 15:45:53 -0000      1.24
> >   @@ -246,7 +246,20 @@
> >        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> >          scopeLock = session;
> >        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> >   -      scopeLock = context;
> >   +      try {
> >   +        scopeLock = ctxt.loadClass(className);
> >   +      } catch (ClassNotFoundException e) {
> >   +        String msg;
> >   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
> >   +            providerType ==
DeploymentDescriptor.PROVIDER_USER_DEFINED) {
> >   +          msg = "Unable to resolve target object at application
scope: " + e.getMessage ();
> >   +        } else {
> >   +          msg = "Unable to load BSF at application scope: script
services not available " +
> >   +            "without BSF: " + e.getMessage ();
> >   +        }
> >   +        throw new SOAPException (
> >   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
> >   +      }
> >        } else {
> >          throw new SOAPException (Constants.FAULT_CODE_SERVER,
> >                                   "Service uses deprecated object scope
" +
> >   @@ -264,10 +277,10 @@
> >          // locate (or create) the target object and invoke the method
> >          if ( scopeLock == null ) scopeLock = className ; // Just pick
something
> >          synchronized (scopeLock) {
> >   -        if (scopeLock == session) {
> >   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> >              // targetObject = session.getAttribute (targetID);
> >              targetObject = session.getValue (targetID);
> >   -        } else if (scopeLock == context) {
> >   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> >              targetObject = context.getAttribute (targetID);
> >            } else {
> >              targetObject = null;
> >   @@ -295,10 +308,10 @@
> >                // 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) {
> >   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> >                  session.putValue (targetID, targetObject);
> >                  // session.setAttribute (targetID, targetObject);
> >   -            } else if (scopeLock == context) {
> >   +            } else if (scope ==
DeploymentDescriptor.SCOPE_APPLICATION) {
> >                  context.setAttribute (targetID, targetObject);
> >                }
> >              } catch (Exception e) {
> >
> >
> >
> >   1.32      +3 -0      xml-soap/java/docs/changes.html
> >
> >   Index: changes.html
> >   ===================================================================
> >   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
> >   retrieving revision 1.31
> >   retrieving revision 1.32
> >   diff -u -r1.31 -r1.32
> >   --- changes.html      28 Jun 2002 03:07:35 -0000      1.31
> >   +++ changes.html      11 Jul 2002 15:45:54 -0000      1.32
> >   @@ -46,6 +46,9 @@
> >          multi-reference serialization is supported.  Added a sample to
> >          demonstrate serialization and deserialization of a cyclic graph
> >          of beans.</li>
> >   +      <li>Remove deadlock for a service that in the constructor
invokes
> >   +      another service when both services are at application scope.
The
> >   +      deadlock still occurs if both services are at session
scope.</li>
> >        </ul>
> >      </li>
> >    </ul>
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Re: Sending/Receiving objetcs. Please, Please, Please ... help.

Posted by Scott Nichol <sn...@scottnichol.com>.
The AddressBook sample in Apache SOAP is an example of serializing objects
that are Java Beans.  This is done with the BeanSerializer.

The best text documentation for Apache SOAP is included with the
distribution.  The User's Guide includes some information on Creating Type
Mappings, although not with an example of a customer [de-]serializer.  Of
course, the most detailed and accurate documentation is the source code
itself.

Roughly speaking, a QName is a fully qualified XML element or attribute
name.  By fully qualified, I mean it is both the namespace and the local
part of the name.

You may find some tutorials helpful.  You could just do a Google search
(i.e. help thyself), but here are a couple of suggestions:

http://www.javaworld.com/javaworld/jw-03-2001/jw-0330-soap.html (be sure to
read parts 2 and 3, too)
http://www.onjava.com/pub/a/onjava/2002/02/27/tomcat.html
http://www.soapuser.com/server1.html

Scott Nichol

----- Original Message -----
From: "Indrasish N Basuroychowdhury"
<in...@fanniemae.com>
To: <so...@xml.apache.org>
Cc: <xm...@apache.org>
Sent: Thursday, July 11, 2002 12:09 PM
Subject: Sending/Receiving objetcs. Please, Please, Please ... help.


> Hope people do not get tired with me as I am sending this message
repeatedly.
> I need help for sending/receiving objects as well as
serializing/deserializing them.
> Can anyone help me in findinf example of how to do it and what type of
objects I can send and
> receive (I know String Boolean, Int, Double etc.) How about any object I
want to send /receive.
> Also, I would like to know about QName. What exactly is it and where/how
do we use it.
> Experts please help me. It is a question of retaining my job now.
> Also, where is a good documentation for Apache soap?
>
> Thanks,
>
> Indrasish.
>
> snichol@apache.org wrote:
>
> > snichol     2002/07/11 08:45:54
> >
> >   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
> >                java/docs changes.html
> >   Log:
> >   Remove deadlock for a service that in the constructor invokes
> >   another service when both services are at application scope.  The
> >   deadlock still occurs if both services are at session scope.
> >
> >   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
> >
> >   Revision  Changes    Path
> >   1.24      +18 -5
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.23
> >   retrieving revision 1.24
> >   diff -u -r1.23 -r1.24
> >   --- ServerHTTPUtils.java      25 Jun 2002 05:16:27 -0000      1.23
> >   +++ ServerHTTPUtils.java      11 Jul 2002 15:45:53 -0000      1.24
> >   @@ -246,7 +246,20 @@
> >        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> >          scopeLock = session;
> >        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> >   -      scopeLock = context;
> >   +      try {
> >   +        scopeLock = ctxt.loadClass(className);
> >   +      } catch (ClassNotFoundException e) {
> >   +        String msg;
> >   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
> >   +            providerType ==
DeploymentDescriptor.PROVIDER_USER_DEFINED) {
> >   +          msg = "Unable to resolve target object at application
scope: " + e.getMessage ();
> >   +        } else {
> >   +          msg = "Unable to load BSF at application scope: script
services not available " +
> >   +            "without BSF: " + e.getMessage ();
> >   +        }
> >   +        throw new SOAPException (
> >   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
> >   +      }
> >        } else {
> >          throw new SOAPException (Constants.FAULT_CODE_SERVER,
> >                                   "Service uses deprecated object scope
" +
> >   @@ -264,10 +277,10 @@
> >          // locate (or create) the target object and invoke the method
> >          if ( scopeLock == null ) scopeLock = className ; // Just pick
something
> >          synchronized (scopeLock) {
> >   -        if (scopeLock == session) {
> >   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> >              // targetObject = session.getAttribute (targetID);
> >              targetObject = session.getValue (targetID);
> >   -        } else if (scopeLock == context) {
> >   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
> >              targetObject = context.getAttribute (targetID);
> >            } else {
> >              targetObject = null;
> >   @@ -295,10 +308,10 @@
> >                // 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) {
> >   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
> >                  session.putValue (targetID, targetObject);
> >                  // session.setAttribute (targetID, targetObject);
> >   -            } else if (scopeLock == context) {
> >   +            } else if (scope ==
DeploymentDescriptor.SCOPE_APPLICATION) {
> >                  context.setAttribute (targetID, targetObject);
> >                }
> >              } catch (Exception e) {
> >
> >
> >
> >   1.32      +3 -0      xml-soap/java/docs/changes.html
> >
> >   Index: changes.html
> >   ===================================================================
> >   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
> >   retrieving revision 1.31
> >   retrieving revision 1.32
> >   diff -u -r1.31 -r1.32
> >   --- changes.html      28 Jun 2002 03:07:35 -0000      1.31
> >   +++ changes.html      11 Jul 2002 15:45:54 -0000      1.32
> >   @@ -46,6 +46,9 @@
> >          multi-reference serialization is supported.  Added a sample to
> >          demonstrate serialization and deserialization of a cyclic graph
> >          of beans.</li>
> >   +      <li>Remove deadlock for a service that in the constructor
invokes
> >   +      another service when both services are at application scope.
The
> >   +      deadlock still occurs if both services are at session
scope.</li>
> >        </ul>
> >      </li>
> >    </ul>
> >
> >
> >
> >
> > --
> > To unsubscribe, e-mail:   <ma...@xml.apache.org>
> > For additional commands, e-mail: <ma...@xml.apache.org>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


Sending/Receiving objetcs. Please, Please, Please ... help.

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
Hope people do not get tired with me as I am sending this message repeatedly.
I need help for sending/receiving objects as well as serializing/deserializing them.
Can anyone help me in findinf example of how to do it and what type of objects I can send and
receive (I know String Boolean, Int, Double etc.) How about any object I want to send /receive.
Also, I would like to know about QName. What exactly is it and where/how do we use it.
Experts please help me. It is a question of retaining my job now.
Also, where is a good documentation for Apache soap?

Thanks,

Indrasish.

snichol@apache.org wrote:

> snichol     2002/07/11 08:45:54
>
>   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
>                java/docs changes.html
>   Log:
>   Remove deadlock for a service that in the constructor invokes
>   another service when both services are at application scope.  The
>   deadlock still occurs if both services are at session scope.
>
>   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
>
>   Revision  Changes    Path
>   1.24      +18 -5     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.23
>   retrieving revision 1.24
>   diff -u -r1.23 -r1.24
>   --- ServerHTTPUtils.java      25 Jun 2002 05:16:27 -0000      1.23
>   +++ ServerHTTPUtils.java      11 Jul 2002 15:45:53 -0000      1.24
>   @@ -246,7 +246,20 @@
>        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>          scopeLock = session;
>        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>   -      scopeLock = context;
>   +      try {
>   +        scopeLock = ctxt.loadClass(className);
>   +      } catch (ClassNotFoundException e) {
>   +        String msg;
>   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
>   +            providerType == DeploymentDescriptor.PROVIDER_USER_DEFINED) {
>   +          msg = "Unable to resolve target object at application scope: " + e.getMessage ();
>   +        } else {
>   +          msg = "Unable to load BSF at application scope: script services not available " +
>   +            "without BSF: " + e.getMessage ();
>   +        }
>   +        throw new SOAPException (
>   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
>   +      }
>        } else {
>          throw new SOAPException (Constants.FAULT_CODE_SERVER,
>                                   "Service uses deprecated object scope " +
>   @@ -264,10 +277,10 @@
>          // locate (or create) the target object and invoke the method
>          if ( scopeLock == null ) scopeLock = className ; // Just pick something
>          synchronized (scopeLock) {
>   -        if (scopeLock == session) {
>   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>              // targetObject = session.getAttribute (targetID);
>              targetObject = session.getValue (targetID);
>   -        } else if (scopeLock == context) {
>   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>              targetObject = context.getAttribute (targetID);
>            } else {
>              targetObject = null;
>   @@ -295,10 +308,10 @@
>                // 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) {
>   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>                  session.putValue (targetID, targetObject);
>                  // session.setAttribute (targetID, targetObject);
>   -            } else if (scopeLock == context) {
>   +            } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>                  context.setAttribute (targetID, targetObject);
>                }
>              } catch (Exception e) {
>
>
>
>   1.32      +3 -0      xml-soap/java/docs/changes.html
>
>   Index: changes.html
>   ===================================================================
>   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
>   retrieving revision 1.31
>   retrieving revision 1.32
>   diff -u -r1.31 -r1.32
>   --- changes.html      28 Jun 2002 03:07:35 -0000      1.31
>   +++ changes.html      11 Jul 2002 15:45:54 -0000      1.32
>   @@ -46,6 +46,9 @@
>          multi-reference serialization is supported.  Added a sample to
>          demonstrate serialization and deserialization of a cyclic graph
>          of beans.</li>
>   +      <li>Remove deadlock for a service that in the constructor invokes
>   +      another service when both services are at application scope.  The
>   +      deadlock still occurs if both services are at session scope.</li>
>        </ul>
>      </li>
>    </ul>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>



--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Sending/Receiving objetcs. Please, Please, Please ... help.

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
Hope people do not get tired with me as I am sending this message repeatedly.
I need help for sending/receiving objects as well as serializing/deserializing them.
Can anyone help me in findinf example of how to do it and what type of objects I can send and
receive (I know String Boolean, Int, Double etc.) How about any object I want to send /receive.
Also, I would like to know about QName. What exactly is it and where/how do we use it.
Experts please help me. It is a question of retaining my job now.
Also, where is a good documentation for Apache soap?

Thanks,

Indrasish.

snichol@apache.org wrote:

> snichol     2002/07/11 08:45:54
>
>   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
>                java/docs changes.html
>   Log:
>   Remove deadlock for a service that in the constructor invokes
>   another service when both services are at application scope.  The
>   deadlock still occurs if both services are at session scope.
>
>   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
>
>   Revision  Changes    Path
>   1.24      +18 -5     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.23
>   retrieving revision 1.24
>   diff -u -r1.23 -r1.24
>   --- ServerHTTPUtils.java      25 Jun 2002 05:16:27 -0000      1.23
>   +++ ServerHTTPUtils.java      11 Jul 2002 15:45:53 -0000      1.24
>   @@ -246,7 +246,20 @@
>        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>          scopeLock = session;
>        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>   -      scopeLock = context;
>   +      try {
>   +        scopeLock = ctxt.loadClass(className);
>   +      } catch (ClassNotFoundException e) {
>   +        String msg;
>   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
>   +            providerType == DeploymentDescriptor.PROVIDER_USER_DEFINED) {
>   +          msg = "Unable to resolve target object at application scope: " + e.getMessage ();
>   +        } else {
>   +          msg = "Unable to load BSF at application scope: script services not available " +
>   +            "without BSF: " + e.getMessage ();
>   +        }
>   +        throw new SOAPException (
>   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
>   +      }
>        } else {
>          throw new SOAPException (Constants.FAULT_CODE_SERVER,
>                                   "Service uses deprecated object scope " +
>   @@ -264,10 +277,10 @@
>          // locate (or create) the target object and invoke the method
>          if ( scopeLock == null ) scopeLock = className ; // Just pick something
>          synchronized (scopeLock) {
>   -        if (scopeLock == session) {
>   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>              // targetObject = session.getAttribute (targetID);
>              targetObject = session.getValue (targetID);
>   -        } else if (scopeLock == context) {
>   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>              targetObject = context.getAttribute (targetID);
>            } else {
>              targetObject = null;
>   @@ -295,10 +308,10 @@
>                // 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) {
>   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>                  session.putValue (targetID, targetObject);
>                  // session.setAttribute (targetID, targetObject);
>   -            } else if (scopeLock == context) {
>   +            } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>                  context.setAttribute (targetID, targetObject);
>                }
>              } catch (Exception e) {
>
>
>
>   1.32      +3 -0      xml-soap/java/docs/changes.html
>
>   Index: changes.html
>   ===================================================================
>   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
>   retrieving revision 1.31
>   retrieving revision 1.32
>   diff -u -r1.31 -r1.32
>   --- changes.html      28 Jun 2002 03:07:35 -0000      1.31
>   +++ changes.html      11 Jul 2002 15:45:54 -0000      1.32
>   @@ -46,6 +46,9 @@
>          multi-reference serialization is supported.  Added a sample to
>          demonstrate serialization and deserialization of a cyclic graph
>          of beans.</li>
>   +      <li>Remove deadlock for a service that in the constructor invokes
>   +      another service when both services are at application scope.  The
>   +      deadlock still occurs if both services are at session scope.</li>
>        </ul>
>      </li>
>    </ul>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>



Re: Need urgent help. Please help.

Posted by Scott Nichol <sn...@scottnichol.com>.
I suggest you post your client code and/or a wire dump in order to get help.

Scott Nichol

----- Original Message -----
From: "Indrasish N Basuroychowdhury"
<in...@fanniemae.com>
To: <so...@xml.apache.org>
Sent: Friday, July 12, 2002 11:55 AM
Subject: Need urgent help. Please help.


> Could Scott or any other expert please help?
>
> I am trying to send and receive object to a .NET service via. Java client.
>
> I am receiving following error message:
> Fault Code   = soap:Client
> Fault String = System.Web.Services.Protocols.SoapException: Server was
unable to
> read request. ---> System.Exception: There is an error in XML document (5,
2).
> ---> System.Exception: The specified type was not recognized:
> name='ReturnService', namespace='http://localhost/FirstTry/WebServices/',
at <ah
> xmlns=''>.
>    at
>
System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualif
iedName
> type)
>    at
>
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g
> name, String ns, Boolean throwOnUnknownType, Boolean ignoreIfNoId, String&
> fixupReference)
>    at
>
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g
> name, String ns, String& fixupReference)
>    at
>
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationReader1.Read4_ReturnServic
e()
>    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader)
>    at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
>    at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
>    at System.Web.Services.Protocols.WebServiceHandler.Invoke()
>    at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
>
> Here is the protocol of .NET service.
>
> SOAP
> The following is a sample SOAP request and response. The placeholders
shown need
> to be replaced with actual values.
>
> POST /FirstTry/WebServices/Objects/TestObjSer.asmx HTTP/1.1
> Host: localhost
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
> SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"
>
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="http://localhost/FirstTry/WebServices/"
> xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>   <soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>     <tns:ReturnService>
>       <ah href="#id1" />
>     </tns:ReturnService>
>     <types:AuthHeader id="id1" xsi:type="types:AuthHeader">
>       <Username xsi:type="xsd:string">string</Username>
>       <Password xsi:type="xsd:string">string</Password>
>     </types:AuthHeader>
>   </soap:Body>
> </soap:Envelope>
> HTTP/1.1 200 OK
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
>
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="http://localhost/FirstTry/WebServices/"
> xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>   <soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>     <tns:ReturnServiceResponse>
>       <ReturnServiceResult href="#id1" />
>     </tns:ReturnServiceResponse>
>     <types:ReturnObj id="id1" xsi:type="types:ReturnObj">
>       <Username xsi:type="xsd:string">string</Username>
>       <Password xsi:type="xsd:string">string</Password>
>       <Together xsi:type="xsd:string">string</Together>
>     </types:ReturnObj>
>   </soap:Body>
> </soap:Envelope>
>
>
> And here is my code:
> import org.apache.soap.encoding.*;
> import org.apache.soap.encoding.soapenc.*;
> import org.apache.soap.util.xml.*;
> import org.apache.soap.rpc.*;
> import org.apache.soap.*;
> import java.util.*;
> import java.net.*;
>
> class AuthHeader {
>  public String Username;
>  public String Password;
>  }
>
> class ReturnObj {
>  public String Username;
>  public String Password;
>  public String Together;
>  }
>
> public class ClientNetObj {
>
>    static String XMLSOAP = "http://schemas.xmlsoap.org/soap/encoding/";
>    static String __targetNS = "http://localhost/FirstTry/WebServices/";
>    static String __methNsURI = __targetNS;
>    static String __baseURL =
> "http://localhost/FirstTry/WebServices/Objects/TestObjSer.asmx";
>    static String __soapAction =
> "http://localhost/FirstTry/WebServices/ReturnService";
>    static String __methodName = "ReturnService";
>
>    public static void main(String args[]) throws Exception
>  {
>       Call call = new Call();
>       SOAPMappingRegistry smr = new SOAPMappingRegistry();
>       BeanSerializer beanSer = new BeanSerializer();
>       smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
> "ReturnService"),
>
> AuthHeader.class, beanSer, beanSer);
> //      smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
> "ReturnServiceResult"),
>
> ReturnObj.class, beanSer, beanSer);
>
>       call.setSOAPMappingRegistry(smr);
>       call.setEncodingStyleURI(XMLSOAP);
>       call.setTargetObjectURI(__methNsURI);
>       call.setMethodName(__methodName);
>
>       Vector params = new Vector();
> //      params.addElement(new Parameter("strInput", String.class, "Test",
> null));
>   AuthHeader ah = new AuthHeader();
>   ah.Username = "Indrasish";
>   ah.Password = "Genius";
>    params.addElement(new Parameter("ah", AuthHeader.class, ah, null));
>       call.setParams(params);
>
>       URL url = new URL(__baseURL);
>       Response res = call.invoke(url, __soapAction);
>       if (res.generatedFault())
>   {
>          Fault f = res.getFault();
>          System.out.println("Fault Code   = " + f.getFaultCode());
>          System.out.println("Fault String = " + f.getFaultString());
>       }
>   else
>   {
>          Parameter p = res.getReturnValue();
>          System.out.println(" Object Value = " + p.getValue());
>       }
>  }
>
>
> I need urgent help.
>
> Any help is appreciated.
>
> Thanks,
>
> Indrasish.
>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


Re: Need urgent help. Please help.

Posted by Scott Nichol <sn...@scottnichol.com>.
I suggest you post your client code and/or a wire dump in order to get help.

Scott Nichol

----- Original Message -----
From: "Indrasish N Basuroychowdhury"
<in...@fanniemae.com>
To: <so...@xml.apache.org>
Sent: Friday, July 12, 2002 11:55 AM
Subject: Need urgent help. Please help.


> Could Scott or any other expert please help?
>
> I am trying to send and receive object to a .NET service via. Java client.
>
> I am receiving following error message:
> Fault Code   = soap:Client
> Fault String = System.Web.Services.Protocols.SoapException: Server was
unable to
> read request. ---> System.Exception: There is an error in XML document (5,
2).
> ---> System.Exception: The specified type was not recognized:
> name='ReturnService', namespace='http://localhost/FirstTry/WebServices/',
at <ah
> xmlns=''>.
>    at
>
System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualif
iedName
> type)
>    at
>
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g
> name, String ns, Boolean throwOnUnknownType, Boolean ignoreIfNoId, String&
> fixupReference)
>    at
>
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(Strin
g
> name, String ns, String& fixupReference)
>    at
>
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationReader1.Read4_ReturnServic
e()
>    at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader
xmlReader)
>    at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
>    at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
>    at System.Web.Services.Protocols.WebServiceHandler.Invoke()
>    at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()
>
> Here is the protocol of .NET service.
>
> SOAP
> The following is a sample SOAP request and response. The placeholders
shown need
> to be replaced with actual values.
>
> POST /FirstTry/WebServices/Objects/TestObjSer.asmx HTTP/1.1
> Host: localhost
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
> SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"
>
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="http://localhost/FirstTry/WebServices/"
> xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>   <soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>     <tns:ReturnService>
>       <ah href="#id1" />
>     </tns:ReturnService>
>     <types:AuthHeader id="id1" xsi:type="types:AuthHeader">
>       <Username xsi:type="xsd:string">string</Username>
>       <Password xsi:type="xsd:string">string</Password>
>     </types:AuthHeader>
>   </soap:Body>
> </soap:Envelope>
> HTTP/1.1 200 OK
> Content-Type: text/xml; charset=utf-8
> Content-Length: length
>
> <?xml version="1.0" encoding="utf-8"?>
> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"
> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:tns="http://localhost/FirstTry/WebServices/"
> xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
> xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
>   <soap:Body
soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
>     <tns:ReturnServiceResponse>
>       <ReturnServiceResult href="#id1" />
>     </tns:ReturnServiceResponse>
>     <types:ReturnObj id="id1" xsi:type="types:ReturnObj">
>       <Username xsi:type="xsd:string">string</Username>
>       <Password xsi:type="xsd:string">string</Password>
>       <Together xsi:type="xsd:string">string</Together>
>     </types:ReturnObj>
>   </soap:Body>
> </soap:Envelope>
>
>
> And here is my code:
> import org.apache.soap.encoding.*;
> import org.apache.soap.encoding.soapenc.*;
> import org.apache.soap.util.xml.*;
> import org.apache.soap.rpc.*;
> import org.apache.soap.*;
> import java.util.*;
> import java.net.*;
>
> class AuthHeader {
>  public String Username;
>  public String Password;
>  }
>
> class ReturnObj {
>  public String Username;
>  public String Password;
>  public String Together;
>  }
>
> public class ClientNetObj {
>
>    static String XMLSOAP = "http://schemas.xmlsoap.org/soap/encoding/";
>    static String __targetNS = "http://localhost/FirstTry/WebServices/";
>    static String __methNsURI = __targetNS;
>    static String __baseURL =
> "http://localhost/FirstTry/WebServices/Objects/TestObjSer.asmx";
>    static String __soapAction =
> "http://localhost/FirstTry/WebServices/ReturnService";
>    static String __methodName = "ReturnService";
>
>    public static void main(String args[]) throws Exception
>  {
>       Call call = new Call();
>       SOAPMappingRegistry smr = new SOAPMappingRegistry();
>       BeanSerializer beanSer = new BeanSerializer();
>       smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
> "ReturnService"),
>
> AuthHeader.class, beanSer, beanSer);
> //      smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
> "ReturnServiceResult"),
>
> ReturnObj.class, beanSer, beanSer);
>
>       call.setSOAPMappingRegistry(smr);
>       call.setEncodingStyleURI(XMLSOAP);
>       call.setTargetObjectURI(__methNsURI);
>       call.setMethodName(__methodName);
>
>       Vector params = new Vector();
> //      params.addElement(new Parameter("strInput", String.class, "Test",
> null));
>   AuthHeader ah = new AuthHeader();
>   ah.Username = "Indrasish";
>   ah.Password = "Genius";
>    params.addElement(new Parameter("ah", AuthHeader.class, ah, null));
>       call.setParams(params);
>
>       URL url = new URL(__baseURL);
>       Response res = call.invoke(url, __soapAction);
>       if (res.generatedFault())
>   {
>          Fault f = res.getFault();
>          System.out.println("Fault Code   = " + f.getFaultCode());
>          System.out.println("Fault String = " + f.getFaultString());
>       }
>   else
>   {
>          Parameter p = res.getReturnValue();
>          System.out.println(" Object Value = " + p.getValue());
>       }
>  }
>
>
> I need urgent help.
>
> Any help is appreciated.
>
> Thanks,
>
> Indrasish.
>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Need urgent help. Please help.

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
Could Scott or any other expert please help?

I am trying to send and receive object to a .NET service via. Java client.

I am receiving following error message:
Fault Code   = soap:Client
Fault String = System.Web.Services.Protocols.SoapException: Server was unable to
read request. ---> System.Exception: There is an error in XML document (5, 2).
---> System.Exception: The specified type was not recognized:
name='ReturnService', namespace='http://localhost/FirstTry/WebServices/', at <ah
xmlns=''>.
   at
System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualifiedName
type)
   at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String
name, String ns, Boolean throwOnUnknownType, Boolean ignoreIfNoId, String&
fixupReference)
   at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String
name, String ns, String& fixupReference)
   at
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationReader1.Read4_ReturnService()
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.Invoke()
   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

Here is the protocol of .NET service.

SOAP
The following is a sample SOAP request and response. The placeholders shown need
to be replaced with actual values.

POST /FirstTry/WebServices/Objects/TestObjSer.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/FirstTry/WebServices/"
xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:ReturnService>
      <ah href="#id1" />
    </tns:ReturnService>
    <types:AuthHeader id="id1" xsi:type="types:AuthHeader">
      <Username xsi:type="xsd:string">string</Username>
      <Password xsi:type="xsd:string">string</Password>
    </types:AuthHeader>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/FirstTry/WebServices/"
xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:ReturnServiceResponse>
      <ReturnServiceResult href="#id1" />
    </tns:ReturnServiceResponse>
    <types:ReturnObj id="id1" xsi:type="types:ReturnObj">
      <Username xsi:type="xsd:string">string</Username>
      <Password xsi:type="xsd:string">string</Password>
      <Together xsi:type="xsd:string">string</Together>
    </types:ReturnObj>
  </soap:Body>
</soap:Envelope>


And here is my code:
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.rpc.*;
import org.apache.soap.*;
import java.util.*;
import java.net.*;

class AuthHeader {
 public String Username;
 public String Password;
 }

class ReturnObj {
 public String Username;
 public String Password;
 public String Together;
 }

public class ClientNetObj {

   static String XMLSOAP = "http://schemas.xmlsoap.org/soap/encoding/";
   static String __targetNS = "http://localhost/FirstTry/WebServices/";
   static String __methNsURI = __targetNS;
   static String __baseURL =
"http://localhost/FirstTry/WebServices/Objects/TestObjSer.asmx";
   static String __soapAction =
"http://localhost/FirstTry/WebServices/ReturnService";
   static String __methodName = "ReturnService";

   public static void main(String args[]) throws Exception
 {
      Call call = new Call();
      SOAPMappingRegistry smr = new SOAPMappingRegistry();
      BeanSerializer beanSer = new BeanSerializer();
      smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
"ReturnService"),

AuthHeader.class, beanSer, beanSer);
//      smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
"ReturnServiceResult"),

ReturnObj.class, beanSer, beanSer);

      call.setSOAPMappingRegistry(smr);
      call.setEncodingStyleURI(XMLSOAP);
      call.setTargetObjectURI(__methNsURI);
      call.setMethodName(__methodName);

      Vector params = new Vector();
//      params.addElement(new Parameter("strInput", String.class, "Test",
null));
  AuthHeader ah = new AuthHeader();
  ah.Username = "Indrasish";
  ah.Password = "Genius";
   params.addElement(new Parameter("ah", AuthHeader.class, ah, null));
      call.setParams(params);

      URL url = new URL(__baseURL);
      Response res = call.invoke(url, __soapAction);
      if (res.generatedFault())
  {
         Fault f = res.getFault();
         System.out.println("Fault Code   = " + f.getFaultCode());
         System.out.println("Fault String = " + f.getFaultString());
      }
  else
  {
         Parameter p = res.getReturnValue();
         System.out.println(" Object Value = " + p.getValue());
      }
 }


I need urgent help.

Any help is appreciated.

Thanks,

Indrasish.





--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


Need urgent help. Please help.

Posted by Indrasish N Basuroychowdhury <in...@fanniemae.com>.
Could Scott or any other expert please help?

I am trying to send and receive object to a .NET service via. Java client.

I am receiving following error message:
Fault Code   = soap:Client
Fault String = System.Web.Services.Protocols.SoapException: Server was unable to
read request. ---> System.Exception: There is an error in XML document (5, 2).
---> System.Exception: The specified type was not recognized:
name='ReturnService', namespace='http://localhost/FirstTry/WebServices/', at <ah
xmlns=''>.
   at
System.Xml.Serialization.XmlSerializationReader.ReadTypedPrimitive(XmlQualifiedName
type)
   at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String
name, String ns, Boolean throwOnUnknownType, Boolean ignoreIfNoId, String&
fixupReference)
   at
System.Xml.Serialization.XmlSerializationReader.ReadReferencingElement(String
name, String ns, String& fixupReference)
   at
n2499d7d93ffa468fbd8861780677ee41.XmlSerializationReader1.Read4_ReturnService()
   at System.Xml.Serialization.XmlSerializer.Deserialize(XmlReader xmlReader)
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.SoapServerProtocol.ReadParameters()
   at System.Web.Services.Protocols.WebServiceHandler.Invoke()
   at System.Web.Services.Protocols.WebServiceHandler.CoreProcessRequest()

Here is the protocol of .NET service.

SOAP
The following is a sample SOAP request and response. The placeholders shown need
to be replaced with actual values.

POST /FirstTry/WebServices/Objects/TestObjSer.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://localhost/FirstTry/WebServices/ReturnService"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/FirstTry/WebServices/"
xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:ReturnService>
      <ah href="#id1" />
    </tns:ReturnService>
    <types:AuthHeader id="id1" xsi:type="types:AuthHeader">
      <Username xsi:type="xsd:string">string</Username>
      <Password xsi:type="xsd:string">string</Password>
    </types:AuthHeader>
  </soap:Body>
</soap:Envelope>
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:tns="http://localhost/FirstTry/WebServices/"
xmlns:types="http://localhost/FirstTry/WebServices/encodedTypes"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  <soap:Body soap:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <tns:ReturnServiceResponse>
      <ReturnServiceResult href="#id1" />
    </tns:ReturnServiceResponse>
    <types:ReturnObj id="id1" xsi:type="types:ReturnObj">
      <Username xsi:type="xsd:string">string</Username>
      <Password xsi:type="xsd:string">string</Password>
      <Together xsi:type="xsd:string">string</Together>
    </types:ReturnObj>
  </soap:Body>
</soap:Envelope>


And here is my code:
import org.apache.soap.encoding.*;
import org.apache.soap.encoding.soapenc.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.rpc.*;
import org.apache.soap.*;
import java.util.*;
import java.net.*;

class AuthHeader {
 public String Username;
 public String Password;
 }

class ReturnObj {
 public String Username;
 public String Password;
 public String Together;
 }

public class ClientNetObj {

   static String XMLSOAP = "http://schemas.xmlsoap.org/soap/encoding/";
   static String __targetNS = "http://localhost/FirstTry/WebServices/";
   static String __methNsURI = __targetNS;
   static String __baseURL =
"http://localhost/FirstTry/WebServices/Objects/TestObjSer.asmx";
   static String __soapAction =
"http://localhost/FirstTry/WebServices/ReturnService";
   static String __methodName = "ReturnService";

   public static void main(String args[]) throws Exception
 {
      Call call = new Call();
      SOAPMappingRegistry smr = new SOAPMappingRegistry();
      BeanSerializer beanSer = new BeanSerializer();
      smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
"ReturnService"),

AuthHeader.class, beanSer, beanSer);
//      smr.mapTypes(Constants.NS_URI_SOAP_ENC, new QName(__targetNS,
"ReturnServiceResult"),

ReturnObj.class, beanSer, beanSer);

      call.setSOAPMappingRegistry(smr);
      call.setEncodingStyleURI(XMLSOAP);
      call.setTargetObjectURI(__methNsURI);
      call.setMethodName(__methodName);

      Vector params = new Vector();
//      params.addElement(new Parameter("strInput", String.class, "Test",
null));
  AuthHeader ah = new AuthHeader();
  ah.Username = "Indrasish";
  ah.Password = "Genius";
   params.addElement(new Parameter("ah", AuthHeader.class, ah, null));
      call.setParams(params);

      URL url = new URL(__baseURL);
      Response res = call.invoke(url, __soapAction);
      if (res.generatedFault())
  {
         Fault f = res.getFault();
         System.out.println("Fault Code   = " + f.getFaultCode());
         System.out.println("Fault String = " + f.getFaultString());
      }
  else
  {
         Parameter p = res.getReturnValue();
         System.out.println(" Object Value = " + p.getValue());
      }
 }


I need urgent help.

Any help is appreciated.

Thanks,

Indrasish.





RE: Constructor Deadlock

Posted by Scott Nichol <sn...@scottnichol.com>.
Adam,

The following change was made to the code in CVS regarding this issue.
Thanks again for providing the technique of locking the service class rather
than the servlet context.

Scott Nichol

----- Original Message -----
From: <sn...@apache.org>
To: <xm...@apache.org>
Sent: Thursday, July 11, 2002 11:45 AM
Subject: cvs commit: xml-soap/java/docs changes.html


> snichol     2002/07/11 08:45:54
>
>   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
>                java/docs changes.html
>   Log:
>   Remove deadlock for a service that in the constructor invokes
>   another service when both services are at application scope.  The
>   deadlock still occurs if both services are at session scope.
>
>   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
>
>   Revision  Changes    Path
>   1.24      +18 -5
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.23
>   retrieving revision 1.24
>   diff -u -r1.23 -r1.24
>   --- ServerHTTPUtils.java 25 Jun 2002 05:16:27 -0000 1.23
>   +++ ServerHTTPUtils.java 11 Jul 2002 15:45:53 -0000 1.24
>   @@ -246,7 +246,20 @@
>        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>          scopeLock = session;
>        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>   -      scopeLock = context;
>   +      try {
>   +        scopeLock = ctxt.loadClass(className);
>   +      } catch (ClassNotFoundException e) {
>   +        String msg;
>   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
>   +            providerType == DeploymentDescriptor.PROVIDER_USER_DEFINED)
{
>   +          msg = "Unable to resolve target object at application scope:
" + e.getMessage ();
>   +        } else {
>   +          msg = "Unable to load BSF at application scope: script
services not available " +
>   +            "without BSF: " + e.getMessage ();
>   +        }
>   +        throw new SOAPException (
>   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
>   +      }
>        } else {
>          throw new SOAPException (Constants.FAULT_CODE_SERVER,
>                                   "Service uses deprecated object scope "
+
>   @@ -264,10 +277,10 @@
>          // locate (or create) the target object and invoke the method
>          if ( scopeLock == null ) scopeLock = className ; // Just pick
something
>          synchronized (scopeLock) {
>   -        if (scopeLock == session) {
>   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>              // targetObject = session.getAttribute (targetID);
>              targetObject = session.getValue (targetID);
>   -        } else if (scopeLock == context) {
>   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>              targetObject = context.getAttribute (targetID);
>            } else {
>              targetObject = null;
>   @@ -295,10 +308,10 @@
>                // 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) {
>   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>                  session.putValue (targetID, targetObject);
>                  // session.setAttribute (targetID, targetObject);
>   -            } else if (scopeLock == context) {
>   +            } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION)
{
>                  context.setAttribute (targetID, targetObject);
>                }
>              } catch (Exception e) {
>
>
>
>   1.32      +3 -0      xml-soap/java/docs/changes.html
>
>   Index: changes.html
>   ===================================================================
>   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
>   retrieving revision 1.31
>   retrieving revision 1.32
>   diff -u -r1.31 -r1.32
>   --- changes.html 28 Jun 2002 03:07:35 -0000 1.31
>   +++ changes.html 11 Jul 2002 15:45:54 -0000 1.32
>   @@ -46,6 +46,9 @@
>          multi-reference serialization is supported.  Added a sample to
>          demonstrate serialization and deserialization of a cyclic graph
>          of beans.</li>
>   +      <li>Remove deadlock for a service that in the constructor invokes
>   +      another service when both services are at application scope.  The
>   +      deadlock still occurs if both services are at session scope.</li>
>        </ul>
>      </li>
>    </ul>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@xml.apache.org>
For additional commands, e-mail: <ma...@xml.apache.org>


RE: Constructor Deadlock

Posted by Scott Nichol <sn...@scottnichol.com>.
Adam,

The following change was made to the code in CVS regarding this issue.
Thanks again for providing the technique of locking the service class rather
than the servlet context.

Scott Nichol

----- Original Message -----
From: <sn...@apache.org>
To: <xm...@apache.org>
Sent: Thursday, July 11, 2002 11:45 AM
Subject: cvs commit: xml-soap/java/docs changes.html


> snichol     2002/07/11 08:45:54
>
>   Modified:    java/src/org/apache/soap/server/http ServerHTTPUtils.java
>                java/docs changes.html
>   Log:
>   Remove deadlock for a service that in the constructor invokes
>   another service when both services are at application scope.  The
>   deadlock still occurs if both services are at session scope.
>
>   Based on a technique submitted by Adam Moore (moore@ipsi.fhg.de).
>
>   Revision  Changes    Path
>   1.24      +18 -5
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.23
>   retrieving revision 1.24
>   diff -u -r1.23 -r1.24
>   --- ServerHTTPUtils.java 25 Jun 2002 05:16:27 -0000 1.23
>   +++ ServerHTTPUtils.java 11 Jul 2002 15:45:53 -0000 1.24
>   @@ -246,7 +246,20 @@
>        } else if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>          scopeLock = session;
>        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>   -      scopeLock = context;
>   +      try {
>   +        scopeLock = ctxt.loadClass(className);
>   +      } catch (ClassNotFoundException e) {
>   +        String msg;
>   +        if (providerType == DeploymentDescriptor.PROVIDER_JAVA ||
>   +            providerType == DeploymentDescriptor.PROVIDER_USER_DEFINED)
{
>   +          msg = "Unable to resolve target object at application scope:
" + e.getMessage ();
>   +        } else {
>   +          msg = "Unable to load BSF at application scope: script
services not available " +
>   +            "without BSF: " + e.getMessage ();
>   +        }
>   +        throw new SOAPException (
>   +          Constants.FAULT_CODE_SERVER_BAD_TARGET_OBJECT_URI, msg, e);
>   +      }
>        } else {
>          throw new SOAPException (Constants.FAULT_CODE_SERVER,
>                                   "Service uses deprecated object scope "
+
>   @@ -264,10 +277,10 @@
>          // locate (or create) the target object and invoke the method
>          if ( scopeLock == null ) scopeLock = className ; // Just pick
something
>          synchronized (scopeLock) {
>   -        if (scopeLock == session) {
>   +        if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>              // targetObject = session.getAttribute (targetID);
>              targetObject = session.getValue (targetID);
>   -        } else if (scopeLock == context) {
>   +        } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION) {
>              targetObject = context.getAttribute (targetID);
>            } else {
>              targetObject = null;
>   @@ -295,10 +308,10 @@
>                // 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) {
>   +            if (scope == DeploymentDescriptor.SCOPE_SESSION) {
>                  session.putValue (targetID, targetObject);
>                  // session.setAttribute (targetID, targetObject);
>   -            } else if (scopeLock == context) {
>   +            } else if (scope == DeploymentDescriptor.SCOPE_APPLICATION)
{
>                  context.setAttribute (targetID, targetObject);
>                }
>              } catch (Exception e) {
>
>
>
>   1.32      +3 -0      xml-soap/java/docs/changes.html
>
>   Index: changes.html
>   ===================================================================
>   RCS file: /home/cvs/xml-soap/java/docs/changes.html,v
>   retrieving revision 1.31
>   retrieving revision 1.32
>   diff -u -r1.31 -r1.32
>   --- changes.html 28 Jun 2002 03:07:35 -0000 1.31
>   +++ changes.html 11 Jul 2002 15:45:54 -0000 1.32
>   @@ -46,6 +46,9 @@
>          multi-reference serialization is supported.  Added a sample to
>          demonstrate serialization and deserialization of a cyclic graph
>          of beans.</li>
>   +      <li>Remove deadlock for a service that in the constructor invokes
>   +      another service when both services are at application scope.  The
>   +      deadlock still occurs if both services are at session scope.</li>
>        </ul>
>      </li>
>    </ul>
>
>
>
>
> --
> To unsubscribe, e-mail:   <ma...@xml.apache.org>
> For additional commands, e-mail: <ma...@xml.apache.org>
>
>