You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@xml.apache.org by matteo belloni <be...@cefriel.it> on 2001/02/23 16:55:31 UTC
COURTESY
I'm new to Soap and i have maked a my example.
This example send two parameter so:
SOAPTransport st=new SOAPHTTPConnection();
Call call=new Call();
call.setSOAPTransport(st);
SOAPMappingRegistry smr=new SOAPMappingRegistry();
QName parametri=smr.queryElementType(Vector.class,Constants.NS_URI_SOAP_ENC);
call.setTargetObjectURI("urn:somma_vettore");
call.setMethodName("calcola");
System.out.println(Constants.NS_URI_SOAP_ENC);
call.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);
Vector param=new Vector();
Vector Add=new Vector();
Add.addElement("5");
Add.add("4");
Parameter param1=new Parameter("add",Vector.class,new Vector(Add),null);
param.addElement(param1);
call.setParams(param);
Response resp=null;
try{
resp=call.invoke(url,"");
System.out.println("Qui anche");
}catch(SOAPException e){System.out.println("Errore" +e);};
if (resp.generatedFault ()) {
Fault fault = resp.getFault ();
System.out.println ("Ouch, the call failed: ");
System.out.println (" Fault Code = " + fault.getFaultCode ());
System.out.println (" Fault String = " + fault.getFaultString ());
System.out.println("Questo รจ l'errore");
} else {
Parameter result = resp.getReturnValue ();
System.out.println (result.getValue ());
}
}
The SOAP service invocation is correct?
If I want to read the message created how can I do?
I do this:
public String calcola(Vector add) throws Exception{
SOAPHTTPConnection st = new SOAPHTTPConnection();
String Str = Call.getEnvelopeString(st);
System.out.println("Saluti2");
XMLParserLiaison xpl = new XercesParserLiaison ();
Document d =xpl.read("- SOAP RPC Response Envelope -",
new StringReader(Str));
Element elem=d.getDocumentElement();
System.out.println(elem.getNodeValue());
return("pippo");
}
What is wrong?
Another question the call method is the only to make SOAP request?
Very Thanks in advance
Theo
Re: COURTESY
Posted by matteo belloni <be...@cefriel.it>.
Thank Erik.
I will look on the site.
But someone have some example or link to site with example in which a client
send a XML message with SOAP and a server read this message and send the
response
Theo
----- Original Message -----
From: "Erik van Zijst" <er...@marketxs.com>
To: <so...@xml.apache.org>
Sent: Friday, February 23, 2001 5:23 PM
Subject: Re: COURTESY
> > If I want to read the message created how can I do?
>
> Take a look at Apache-SOAP. They include a very simple GUI network sniffer
> that you can use to view the actual envelopes over the wire.
>
> Erik
> --
> Thrashing is just virtual crashing.
Re: COURTESY
Posted by matteo belloni <be...@cefriel.it>.
Thank Erik.
I will look on the site.
But someone have some example or link to site with example in which a client
send a XML message with SOAP and a server read this message and send the
response
Theo
----- Original Message -----
From: "Erik van Zijst" <er...@marketxs.com>
To: <so...@xml.apache.org>
Sent: Friday, February 23, 2001 5:23 PM
Subject: Re: COURTESY
> > If I want to read the message created how can I do?
>
> Take a look at Apache-SOAP. They include a very simple GUI network sniffer
> that you can use to view the actual envelopes over the wire.
>
> Erik
> --
> Thrashing is just virtual crashing.
Re: COURTESY
Posted by Erik van Zijst <er...@marketxs.com>.
> If I want to read the message created how can I do?
Take a look at Apache-SOAP. They include a very simple GUI network sniffer
that you can use to view the actual envelopes over the wire.
Erik
--
Thrashing is just virtual crashing.
Re: COURTESY
Posted by Erik van Zijst <er...@marketxs.com>.
> If I want to read the message created how can I do?
Take a look at Apache-SOAP. They include a very simple GUI network sniffer
that you can use to view the actual envelopes over the wire.
Erik
--
Thrashing is just virtual crashing.