Hello Deepal,

Its very urgent plz help if possible
thanks
-----Original Message-----
From: nancy [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 04, 2006 3:44 PM
To: '[email protected]'
Subject: RE: Caused by: org.apache.axis2.AxisFault: Connection refused:
connect; nested exception is:



Hello Deepal,

I am using JSOAP spheon for web service implentation and simple webserver as
a server.Axis2 is used for client implementation.

EPR will be
like:"http://ipaddress:portno/packageName/ServiceProviderClass.class";;

It is normally working fine. Any other reason for this.

Following method is for invoking the service operation:

private SOAPEnvelope invoke(HashMap parameterMap, String
remote_webServiceIPAdd, Integer remote_webServicePortNo, String
operationName) throws RepException {
                SOAPEnvelope resultEnvelope = null;
                Options options = null;
                try {
                        options = new Options();
        
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);

                        String webServiceURI =
"http://ipaddress:portno/packageName/ServiceProviderClass.class";;

                        EndpointReference EPR = new
EndpointReference(webServiceURI);

                        log.info("EndpointReference:" + EPR.getAddress());
                        options.setTo(EPR);

                        options.setAction(operationName);
                        Integer timeOut = new Integer(1000 * 60 * 60);
                        options.setProperty(HTTPConstants.SO_TIMEOUT,
timeOut);
        
options.setProperty(HTTPConstants.CONNECTION_TIMEOUT, timeOut);

                        ServiceClient serviceClient;
                        serviceClient = new ServiceClient();
                        serviceClient.setOptions(options);

                        MessageContext requestMessageContext = new
MessageContext();
                        SOAPEnvelope envelope =
getRequestEnvelope(operationName, parameterMap, "urn:CallWebService");
                        requestMessageContext.setEnvelope(envelope);

                        OperationClient opClient =
serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);
                        opClient.addMessageContext(requestMessageContext);

                        opClient.setOptions(options);
                        log.debug(envelope.toString());
                        long time_in = System.currentTimeMillis();

                        opClient.execute(true);

        
                        // Extract result from resultant soap xml file
                        resultEnvelope =
opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE).getEnvelope
();
                } catch (AxisFault ex) {
                        ex.printStackTrace();
                        log.error(ex.getReason());
                        ExceptionLog.writeERROR_FILE(ex);
                        throw new RepException("REP501", new Object[] {
ex.getMessage() });
                }
                return resultEnvelope;
        }

private SOAPEnvelope getRequestEnvelope(String operationName, HashMap param,
String webserviceNameSpace) {

                SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
                SOAPEnvelope envelope = fac.getDefaultEnvelope();
                OMNamespace namespace =
fac.createOMNamespace(webserviceNameSpace, operationName);

                OMElement params1 = fac.createOMElement(operationName,
namespace);
                if (param != null) {
                        Set set = param.keySet();
                        Iterator iter = set.iterator();
                        while (iter.hasNext()) {
                                String paramName = iter.next().toString();
                                Object paramValue = param.get(paramName);
                                OMElement paramOM =
fac.createOMElement(paramName, namespace);
                                log.debug("paramName::::" + paramName);
                                log.debug("paramValue::::" + paramValue);

                                if (paramValue instanceof String[]) {
                                        XStream xstream = new XStream(new
DomDriver());
                                        paramValue =
xstream.toXML(paramValue);
                                } else if (paramValue instanceof Integer) {
                                        XStream xstream = new XStream(new
DomDriver());
                                        paramValue =
xstream.toXML(paramValue);
                                } else if (paramValue instanceof HashMap) {
                                        XStream xstream = new XStream(new
DomDriver());
                                        paramValue =
xstream.toXML(paramValue);
                                }
                                if (paramValue == null) {
                                        paramOM.setText("");
                                } else {

        
paramOM.setText(paramValue.toString());
                                }
                                        params1.addChild(paramOM);
                        }
                }
                envelope.getBody().setFirstChild(params1);
                return envelope;
        }

-----Original Message-----
From: Deepal Jayasinghe [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 04, 2006 1:13 PM
To: [email protected]
Subject: Re: Caused by: org.apache.axis2.AxisFault: Connection refused:
connect; nested exception is:

Any possibility of sending the client code ,
btw is your EPR is valid one ?

Thanks
Deepal

nancy wrote:

>  
>
> Hello List,
>
>  
>
> I am facing this problem while using AXIS2.please help
>
>  
>
> Caused by: org.apache.axis2.AxisFault: Connection refused: connect;
> nested exception is:
>         java.net.ConnectException: Connection refused: connect
>         at
>
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithC
ommons(CommonsHTTPTransportSender.java:299)
>         at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke
> (CommonsHTTPTransportSender.java:205)
>         ... 35 more
> Caused by: java.net.ConnectException: Connection refused: connect
>         at java.net.PlainSocketImpl.socketConnect(Native Method)
>         at java.net.PlainSocketImpl.doConnect (Unknown Source)
>         at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
>         at java.net.PlainSocketImpl.connect(Unknown Source)
>         at java.net.Socket.connect(Unknown Source)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>         at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>         at java.lang.reflect.Method.invoke(Unknown Source)
>         at
>
org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(
ReflectionSocketFactory.java:139)
>         at
>
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSo
cket(DefaultProtocolSocketFactory.java
> :124)
>         at
> org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706)
>         at
>
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethod
Director.java:386)
>         at
> org.apache.commons.httpclient.HttpMethodDirector.executeMethod
> (HttpMethodDirector.java:170)
>         at
>
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396)
>         at
>
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346)
>         at
>
org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.j
ava:100)
>         at
>
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithC
ommons(CommonsHTTPTransportSender.java:293)
>         ... 36 more
>
>  
>
> *With Warm Regards,* **
>
> *Nancy Aggarwal *
>
> *Software Developer *
>
>  
>
> ** **
>
>  
>

-- 
Thanks,
Deepal
................................................................
~Future is Open~ 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to