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 Vijay Shinde <Vi...@morganstanley.com> on 2002/04/29 18:27:10 UTC
client error
Hey ,
I am new to soap I am invoking one service on xmlmethods.net
My Client code is --
import java.io.*;
import java.net.*;
import java.util.*;
import org.apache.soap.util.xml.*;
import org.apache.soap.*;
import org.apache.soap.rpc.*;
public class TempClient{
public static float getTemp (URL url, String zipcode) throws
Exception {
Call call = new Call ();
// Service uses standard SOAP encoding
String encodingStyleURI = Constants.NS_URI_SOAP_ENC;
call.setEncodingStyleURI(encodingStyleURI);
// Set service locator parameters
call.setTargetObjectURI ("urn:xmethods-Temperature");
call.setMethodName ("getTemp");
// Create input parameter vector
Vector params = new Vector ();
params.addElement (new Parameter("zipcode", String.class,
zipcode,null));
call.setParams (params);
// Invoke the service ....
Response resp = call.invoke (url,"");
// ... and evaluate the response
if (resp.generatedFault ()) {
throw new Exception();
} else {
// Call was successful. Extract response parameter and return
Parameter result = resp.getReturnValue ();
Float rate=(Float) result.getValue();
return rate.floatValue();
}
}
// Driver to illustrate service invocation
public static void main(String[] args)
{
try
{
URL url=new
URL("http://services.xmethods.com:80/soap/servlet/rpcrouter");
String zipcode= "94041";
float temp = getTemp(url,zipcode);
System.out.println(temp);
}
catch (Exception e) {e.printStackTrace();}
}
}
I get following error.
[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket:
Connection
timed out: connect; targetException=java.lang.IllegalArgumentException:
Error op
ening socket: Connection timed out: connect]
at
org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
tion.java:324)
at org.apache.soap.rpc.Call.invoke(Call.java:205)
at TempClient.getTemp(TempClient.java:28)
at TempClient.main(TempClient.java:49)
Is any one has any guess, I will really appreciate any help on the same.
Regards,
Vijay
"W. Scott Grant" wrote:
> A signature match usually means that the parameters you send to
> the method do not exactly match the expected order listed. In other
> words if you have the following method
>
> run(String a, String b, int c) and you try to call it using
>
> run(int c, String a, String b) you will get a signature error.
>
> > -----Original Message-----
> > From: C. Schlegelmilch [mailto:c_schlegelmilch@yahoo.com]
> > Sent: Friday, April 12, 2002 3:17 PM
> > To: soap-user@xml.apache.org
> > Subject: No Signature Match
> >
> >
> > Hello,
> >
> > I've searched the archives and the web and have yet to
> > see a solid answer that works for me:
> >
> > With a SOAP Messaging service implemented using Apache
> > SOAP. My service calls a method called run(). It
> > contains the following signature:
> >
> > public void run (org.apache.soap.Envelope
> > env,org.apache.soap.rpc.SOAPContext
> > reqCtx,org.apache.soap.rpc.SOAPContext resCtx)
> >
> > My service constantly returns the following error:
> > Exception while handling service request:
> > com.cssde.server.RecordRouter.run(org.apache.soap.Envelope,org.apa
> > che.soap.rpc.SOAPContext,org.apache.soap.rpc.SOAPContext)
> > -- no signature match
> >
> > Have no clue why.
> >
> > Running Tomcat 4.0.1 on Win2000 with JDK 1.3.1.
> >
> > Any ideas?
> >
> > Thanks,
> >
> > Craig Schlegelmilch
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Everything you'll ever need on one web page
> > from News and Sport to Email and Music Charts
> > http://uk.my.yahoo.com
> >
> >
Re: client error
Posted by Vijay Shinde <Vi...@morganstanley.com>.
Hey Mike,
You are right,I am behind firewall.So does it meant that i can't run the
SOAP client if i am behind firewall.
Regard,
Vijay
Mike Blake-Knox wrote:
> > I get following error.
>
> > [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket:
> > Connection
> > timed out: connect;
> targetException=java.lang.IllegalArgumentException:
> > Error opening socket: Connection timed out: connect]
> > at
> > org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
> tion.java:324)
>
> What happens if you point your browser to
> http://services.xmethods.com:80/soap/servlet/rpcrouter? I believe you
> should get an error saying you need to use POST which would confirm
> connectivity. The connection timeout message you are getting may mean
> you have a firewall/proxy server of some kind between you and the
> server.
>
> Mike Blake-Knox
> Voice: (919) 929-5293
> eFax: (501) 421-7970
> email: mikebk@intrex.net
RE: client error
Posted by Mike Blake-Knox <mi...@intrex.net>.
> I get following error.
> [SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket:
> Connection
> timed out: connect;
targetException=java.lang.IllegalArgumentException:
> Error opening socket: Connection timed out: connect]
> at
> org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnec
tion.java:324)
What happens if you point your browser to
http://services.xmethods.com:80/soap/servlet/rpcrouter? I believe you
should get an error saying you need to use POST which would confirm
connectivity. The connection timeout message you are getting may mean
you have a firewall/proxy server of some kind between you and the
server.
Mike Blake-Knox
Voice: (919) 929-5293
eFax: (501) 421-7970
email: mikebk@intrex.net