You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Sochea Meas (LMC)" <So...@ericsson.ca> on 2003/03/26 00:51:34 UTC

What is the difference between SOAP and JAX-RPC

Hi all!

	Does anyone can tell me what's the difference between SOAP and JAX-RPC? I've read documents found on the internet and on Apache web site but can't figure out the difference.

I am not sure if I am asking this question in the appropriate mailing list. If not, please let me know.


Cheer,



-----
Sochea MEAS, intern
LMC/JG/A department
Ericsson Communication Canada

telephone: 514-345-7900 ext. 3432
email: Sochea.Meas@ericsson.ca


Envelope.addBodyElement doesn't work

Posted by Sam <ch...@yahoo.com>.
HI,
I'm trying to use call.invoke(Envelope ), so i created a Envelope without the attriabutes,
 
here is the source code

package samples.security;
import javax.xml.namespace.QName;
//import org.apache.axis.AxisFault;
import org.apache.axis.MessageContext;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPBodyElement;
import org.apache.axis.message.SOAPEnvelope;
//import org.apache.axis.utils.Options;
import org.apache.axis.utils.XMLUtils;
//import org.apache.xpath.operations.String;

import org.apache.axis.encoding.XMLType;
import javax.xml.rpc.ParameterMode;
import javax.xml.soap.Name;
import javax.xml.namespace.QName;

public class Client {
  //private static Name hello;
 
    public static void main(String[] args) throws Exception {
        try {
    
     System.out.println("\n============= 1 ==============");
            Service service = new Service();
               System.out.println("\n============= 2 ==============");
            Call call = (Call) service.createCall();
               System.out.println("\n============= 3 ==============");
            call.setTargetEndpointAddress(new java.net.URL("http://localhost:5678/mr/rpcrouter"));
               System.out.println("\n============= 4 ==============");

          
                       SOAPEnvelope env = new SOAPEnvelope();
                       
            
               System.out.println("\n============= 5 ==============");

     SOAPBodyElement sbe = new SOAPBodyElement(XMLUtils.StringToElement("urn:dss", "validateSession", ""));
    env.getBody().addBodyElement(env.createName("stoken"));
   env.getBody().addBodyElement(env.createName("reqID"));
    env.getBody().addBodyElement(env.createName("clientID"));
  
               System.out.println("\n============= 6 ==============");
 sbe.setAttribute("hello","world","jhkjh");
           
       System.out.println("vector is "+env.getBodyElements());            
            XMLUtils.PrettyElementToStream(env.getAsDOM(), System.out);
               System.out.println("\n============= 7 ==============");
            env = new SignedSOAPEnvelope(env, "http://xml-security");
            
               System.out.println("\n============= 8 ==============");
            System.out.println("\n============= Request ==============");
                             
            XMLUtils.PrettyElementToStream(env.getAsDOM(), System.out);
            call.invoke(env); 
            MessageContext mc = call.getMessageContext();
            System.out.println("\n============= Response ==============");
            XMLUtils.PrettyElementToStream(mc.getResponseMessage().getSOAPEnvelope().getAsDOM(), System.out);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 
the webservice I'm trying access, which expects 3 parameters, I'm not sure how to pass those parameters in the envelope
 
any help would be great
 
Thx
Sam
 



---------------------------------
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

Re: What is the difference between SOAP and JAX-RPC

Posted by "E.Narayanan" <ed...@pspl.co.in>.

> What is XML-RPC? Is it a spec or implementation?
Its a spec. It's remote procedure calling using HTTP as the transport and
XML as the encoding

> Does JAX-RPC stand for Java API for XML-RPC?
Stands for Java API for XML Based RPC


> --- Anne Thomas Manes <an...@manes.net> wrote:
> > What is the difference between SOAP and JAX-RPCSOAP
> > is a language- and
> > platform-independent XML protocol. The current
> > version of the specification
> > (SOAP 1.1 -- see http://www.w3.org/TR/SOAP/) was
> > developed by Developmentor,
> > Lotus, IBM, Microsoft, and Userland. There are
> > approximately 70
> > implementations of this specification available for
> > many different languages
> > (see
> >
> http://www.soapware.org/directory/4/implementations).
> > W3C is in the
> > process of defining a standard XML Protocol called
> > SOAP 1.2. (see
> > http://www.w3.org/2000/xp/Group/)
> >
> > The SOAP specifications don't specify any
> > language-specific APIs. Therefore
> > each implementation defines its own API. The Java
> > community
> > (http://www.jcp.org) decided to develop a set of
> > standard Java APIs for
> > SOAP. There are three of them (see
> >
> http://java.sun.com/webservices/webservicespack.html):
> > - JAX-RPC: the standard API that makes SOAP look and
> > feel a lot like RMI --
> > it supports WSDL
> > - JAXM: an XML-oriented API that does not support
> > WSDL and assumes that the
> > application constructs the XML message.
> > - SAAJ: a low-level API that lets the application
> > work directly with the
> > SOAP message structure.
> >
> > Anne
> >   -----Original Message-----
> >   From: Sochea Meas (LMC)
> > [mailto:Sochea.Meas@ericsson.ca]
> >   Sent: Tuesday, March 25, 2003 6:52 PM
> >   To: 'axis-user@ws.apache.org'
> >   Subject: What is the difference between SOAP and
> > JAX-RPC
> >
> >
> >   Hi all!
> >
> >           Does anyone can tell me what's the
> > difference between SOAP and
> > JAX-RPC? I've read documents found on the internet
> > and on Apache web site
> > but can't figure out the difference.
> >
> >   I am not sure if I am asking this question in the
> > appropriate mailing
> > list. If not, please let me know.
> >
> >
> >
> >   Cheer,
> >
> >
> >
> >
> >   -----
> >   Sochea MEAS, intern
> >   LMC/JG/A department
> >   Ericsson Communication Canada
> >
> >   telephone: 514-345-7900 ext. 3432
> >   email: Sochea.Meas@ericsson.ca
> >
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
> http://platinum.yahoo.com


RE: What is the difference between SOAP and JAX-RPC

Posted by Anne Thomas Manes <an...@manes.net>.
JAX-RPC is a standard Java API for SOAP.
Products that implement the JAX-RPC API are also implementations of SOAP.
Examples:
- Sun's JAX-RPC reference implementation
- Apache Axis
- BEA's SOAP implementation
- IONA XMLBus
- Systinet WASP
- The Mind Electric GLUE

XML-RPC is a different XML Protocol specification. (see
http://www.xmlrpc.org/) It's an off-shoot from the original SOAP project,
published prior to SOAP -- when SOAP got bogged down in Microsoft politics.
It is simpler and less extensible than SOAP. It only supports an RPC-style
format.

JAX-RPC stands for Java API for XML based RPC. (bad choice of name: it
supports both RPC and document style formats) It is an API for SOAP, not for
XML-RPC.

Anne

> -----Original Message-----
> From: Rufoo [mailto:rufoo2001@yahoo.com]
> Sent: Tuesday, March 25, 2003 11:34 PM
> To: axis-user@ws.apache.org
> Subject: RE: What is the difference between SOAP and JAX-RPC
>
>
> So JAX-RPC is an implementation of SOAP.
> What is XML-RPC?
>
> Is it a spec or implementation?
> Does JAX-RPC stand for Java API for XML-RPC?
>
> ~rf
>
> --- Anne Thomas Manes <an...@manes.net> wrote:
> > What is the difference between SOAP and JAX-RPCSOAP
> > is a language- and
> > platform-independent XML protocol. The current
> > version of the specification
> > (SOAP 1.1 -- see http://www.w3.org/TR/SOAP/) was
> > developed by Developmentor,
> > Lotus, IBM, Microsoft, and Userland. There are
> > approximately 70
> > implementations of this specification available for
> > many different languages
> > (see
> >
> http://www.soapware.org/directory/4/implementations).
> > W3C is in the
> > process of defining a standard XML Protocol called
> > SOAP 1.2. (see
> > http://www.w3.org/2000/xp/Group/)
> >
> > The SOAP specifications don't specify any
> > language-specific APIs. Therefore
> > each implementation defines its own API. The Java
> > community
> > (http://www.jcp.org) decided to develop a set of
> > standard Java APIs for
> > SOAP. There are three of them (see
> >
> http://java.sun.com/webservices/webservicespack.html):
> > - JAX-RPC: the standard API that makes SOAP look and
> > feel a lot like RMI --
> > it supports WSDL
> > - JAXM: an XML-oriented API that does not support
> > WSDL and assumes that the
> > application constructs the XML message.
> > - SAAJ: a low-level API that lets the application
> > work directly with the
> > SOAP message structure.
> >
> > Anne
> >   -----Original Message-----
> >   From: Sochea Meas (LMC)
> > [mailto:Sochea.Meas@ericsson.ca]
> >   Sent: Tuesday, March 25, 2003 6:52 PM
> >   To: 'axis-user@ws.apache.org'
> >   Subject: What is the difference between SOAP and
> > JAX-RPC
> >
> >
> >   Hi all!
> >
> >           Does anyone can tell me what's the
> > difference between SOAP and
> > JAX-RPC? I've read documents found on the internet
> > and on Apache web site
> > but can't figure out the difference.
> >
> >   I am not sure if I am asking this question in the
> > appropriate mailing
> > list. If not, please let me know.
> >
> >
> >
> >   Cheer,
> >
> >
> >
> >
> >   -----
> >   Sochea MEAS, intern
> >   LMC/JG/A department
> >   Ericsson Communication Canada
> >
> >   telephone: 514-345-7900 ext. 3432
> >   email: Sochea.Meas@ericsson.ca
> >
> >
>
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
> http://platinum.yahoo.com
>


RE: What is the difference between SOAP and JAX-RPC

Posted by Rufoo <ru...@yahoo.com>.
So JAX-RPC is an implementation of SOAP.
What is XML-RPC?

Is it a spec or implementation?
Does JAX-RPC stand for Java API for XML-RPC?

~rf

--- Anne Thomas Manes <an...@manes.net> wrote:
> What is the difference between SOAP and JAX-RPCSOAP
> is a language- and
> platform-independent XML protocol. The current
> version of the specification
> (SOAP 1.1 -- see http://www.w3.org/TR/SOAP/) was
> developed by Developmentor,
> Lotus, IBM, Microsoft, and Userland. There are
> approximately 70
> implementations of this specification available for
> many different languages
> (see
>
http://www.soapware.org/directory/4/implementations).
> W3C is in the
> process of defining a standard XML Protocol called
> SOAP 1.2. (see
> http://www.w3.org/2000/xp/Group/)
> 
> The SOAP specifications don't specify any
> language-specific APIs. Therefore
> each implementation defines its own API. The Java
> community
> (http://www.jcp.org) decided to develop a set of
> standard Java APIs for
> SOAP. There are three of them (see
>
http://java.sun.com/webservices/webservicespack.html):
> - JAX-RPC: the standard API that makes SOAP look and
> feel a lot like RMI --
> it supports WSDL
> - JAXM: an XML-oriented API that does not support
> WSDL and assumes that the
> application constructs the XML message.
> - SAAJ: a low-level API that lets the application
> work directly with the
> SOAP message structure.
> 
> Anne
>   -----Original Message-----
>   From: Sochea Meas (LMC)
> [mailto:Sochea.Meas@ericsson.ca]
>   Sent: Tuesday, March 25, 2003 6:52 PM
>   To: 'axis-user@ws.apache.org'
>   Subject: What is the difference between SOAP and
> JAX-RPC
> 
> 
>   Hi all!
> 
>           Does anyone can tell me what's the
> difference between SOAP and
> JAX-RPC? I've read documents found on the internet
> and on Apache web site
> but can't figure out the difference.
> 
>   I am not sure if I am asking this question in the
> appropriate mailing
> list. If not, please let me know.
> 
> 
> 
>   Cheer,
> 
> 
> 
> 
>   -----
>   Sochea MEAS, intern
>   LMC/JG/A department
>   Ericsson Communication Canada
> 
>   telephone: 514-345-7900 ext. 3432
>   email: Sochea.Meas@ericsson.ca
> 
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
http://platinum.yahoo.com

Envelope.addBodyElement doesn't work

Posted by Sam <ch...@yahoo.com>.
HI, 
I'm trying to use call.invoke(Envelope ), so i created a Envelope without the attriabutes, 
 
here is the source code 

package samples.security; 
import javax.xml.namespace.QName; 
//import org.apache.axis.AxisFault;
import org.apache.axis.MessageContext;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.message.SOAPBodyElement;
import org.apache.axis.message.SOAPEnvelope;
//import org.apache.axis.utils.Options;
import org.apache.axis.utils.XMLUtils;
//import org.apache.xpath.operations.String; 

import org.apache.axis.encoding.XMLType; 
import javax.xml.rpc.ParameterMode;
import javax.xml.soap.Name;
import javax.xml.namespace.QName; 

public class Client {
  //private static Name hello;
 
    public static void main(String[] args) throws Exception {
        try {
    
     System.out.println("\n============= 1 ==============");
            Service service = new Service();
               System.out.println("\n============= 2 ==============");
            Call call = (Call) service.createCall();
               System.out.println("\n============= 3 ==============");
            call.setTargetEndpointAddress(new java.net.URL("http://localhost:5678/mr/rpcrouter"));
               System.out.println("\n============= 4 =============="); 

          
                       SOAPEnvelope env = new SOAPEnvelope();
                       
            
               System.out.println("\n============= 5 =============="); 

     SOAPBodyElement sbe = new SOAPBodyElement(XMLUtils.StringToElement("urn:dss", "validateSession", "")); 
    env.getBody().addBodyElement(env.createName("stoken"));
   env.getBody().addBodyElement(env.createName("reqID"));
    env.getBody().addBodyElement(env.createName("clientID"));
  
               System.out.println("\n============= 6 ==============");
 sbe.setAttribute("hello","world","jhkjh");
           
       System.out.println("vector is "+env.getBodyElements());            
            XMLUtils.PrettyElementToStream(env.getAsDOM(), System.out);
               System.out.println("\n============= 7 =============="); 
            env = new SignedSOAPEnvelope(env, "http://xml-security");
            
               System.out.println("\n============= 8 =============="); 
            System.out.println("\n============= Request ==============");
                             
            XMLUtils.PrettyElementToStream(env.getAsDOM(), System.out); 
            call.invoke(env); 
            MessageContext mc = call.getMessageContext(); 
            System.out.println("\n============= Response =============="); 
            XMLUtils.PrettyElementToStream(mc.getResponseMessage().getSOAPEnvelope().getAsDOM(), System.out);
        }
        catch (Exception e) {
            e.printStackTrace();
        }
    }
}

 
the webservice I'm trying access, which expects 3 parameters, I'm not sure how to pass those parameters in the envelope 
 
any help would be great 
 
Thx 
Sam 
 



---------------------------------
Do you Yahoo!?
Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!

RE: What is the difference between SOAP and JAX-RPC

Posted by Anne Thomas Manes <an...@manes.net>.
What is the difference between SOAP and JAX-RPCSOAP is a language- and
platform-independent XML protocol. The current version of the specification
(SOAP 1.1 -- see http://www.w3.org/TR/SOAP/) was developed by Developmentor,
Lotus, IBM, Microsoft, and Userland. There are approximately 70
implementations of this specification available for many different languages
(see http://www.soapware.org/directory/4/implementations). W3C is in the
process of defining a standard XML Protocol called SOAP 1.2. (see
http://www.w3.org/2000/xp/Group/)

The SOAP specifications don't specify any language-specific APIs. Therefore
each implementation defines its own API. The Java community
(http://www.jcp.org) decided to develop a set of standard Java APIs for
SOAP. There are three of them (see
http://java.sun.com/webservices/webservicespack.html):
- JAX-RPC: the standard API that makes SOAP look and feel a lot like RMI --
it supports WSDL
- JAXM: an XML-oriented API that does not support WSDL and assumes that the
application constructs the XML message.
- SAAJ: a low-level API that lets the application work directly with the
SOAP message structure.

Anne
  -----Original Message-----
  From: Sochea Meas (LMC) [mailto:Sochea.Meas@ericsson.ca]
  Sent: Tuesday, March 25, 2003 6:52 PM
  To: 'axis-user@ws.apache.org'
  Subject: What is the difference between SOAP and JAX-RPC


  Hi all!

          Does anyone can tell me what's the difference between SOAP and
JAX-RPC? I've read documents found on the internet and on Apache web site
but can't figure out the difference.

  I am not sure if I am asking this question in the appropriate mailing
list. If not, please let me know.



  Cheer,




  -----
  Sochea MEAS, intern
  LMC/JG/A department
  Ericsson Communication Canada

  telephone: 514-345-7900 ext. 3432
  email: Sochea.Meas@ericsson.ca