camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sanjeevirayan <sanjeevirayan...@gmail.com>
Subject Websevice Client Call in Camel
Date Sat, 21 Nov 2015 04:48:49 GMT
Hi ,

I am new to Camel and am learning camel, doing some sample program in Camel.

I am developing the program which need to be communicate with the webservice 
and It has to send the SOAP request to webservice call at the same time it
need to  get the response from it.

I have downloaded the example program from Apache Camel site.

camel-example-cxf-blueprint --project folder name.


When I run my web service with this code , I get an "Unknown Host Exception"
when it is actually there..

Below is my camel for making webservice call..

<?xml version="1.0" encoding="UTF-8"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
	xmlns:camel="http://camel.apache.org/schema/blueprint"
	xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
    xmlns:jaxrs="http://cxf.apache.org/blueprint/jaxrs"
	xmlns:cm="http://aries.apache.org/blueprint/xmlns/blueprint-cm/v1.1.0"
	xmlns:sec="http://cxf.apache.org/configuration/security"
    xmlns:http="http://cxf.apache.org/transports/http/configuration"	
	xsi:schemaLocation="
	   http://cxf.apache.org/configuration/security
       http://cxf.apache.org/schemas/configuration/security.xsd
       http://cxf.apache.org/transports/http/configuration
       http://cxf.apache.org/schemas/configuration/http-conf.xsd	   
       http://www.osgi.org/xmlns/blueprint/v1.0.0 
       http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
       http://camel.apache.org/schema/blueprint 
       http://camel.apache.org/schema/blueprint/camel-blueprint.xsd
       http://camel.apache.org/schema/blueprint/cxf
       http://camel.apache.org/schema/blueprint/cxf/camel-cxf.xsd
       http://cxf.apache.org/blueprint/jaxrs 
       http://cxf.apache.org/schemas/blueprint/jaxrs.xsd">         
       
	

     <cxf:cxfEndpoint id="NumberConvertorWebService"   

          
address="http://www.dataaccess.com/webservicesserver/numberconversion.wso" 
          
           serviceName="s:NumberConversion"

           endpointName="s:NumberConversionSoap"
          
          
wsdlURL="http://www.dataaccess.com/webservicesserver/numberconversion.wso?wsdl"

           xmlns:s="http://www.dataaccess.com/webservicesserver/">

        <cxf:properties>

            <entry key="dataFormat" value="PAYLOAD"/>         

            

            <entry key="defaultOperationNamespace"
value="http://www.dataaccess.com/webservicesserver/"/>

            <entry key="defaultOperationName" value="NumberToWords"/>

             

        </cxf:properties>

    </cxf:cxfEndpoint>




    <camelContext id="mdisSendEmail"
		xmlns="http://camel.apache.org/schema/blueprint">

        <route id="sendEmailNotification">       

            

           
            <from uri="file:mike/call-ws/input?noop=true"/>
            <log loggingLevel="INFO" message="&gt;&gt;&gt; ${body}"/>
            <log message="here1\n${body}\n"/>    

             

            

             <to uri="cxf:bean:NumberConvertorWebService"/>

            <log message="here2\n${body}\n"/>            

            

            <setBody>

                <simple>FILENAME:${file:name}\nTIME:
${date:now:hh:MM:ss.SSS}\nBODY:\n${body}</simple>

            </setBody>

            <log message="here3\n${body}\n"/>

            <to uri="file:mike/call-ws/output"/>

             

        </route>

    </camelContext>

</blueprint>



I am getting below exception when I run it in Fuse/karaf


Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR:
Problem parsing 'http://www.dataaccess.com
/webservicesserver/numberconversion.wso?wsdl'.:
java.net.UnknownHostException: www.dataaccess.com
        at
com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2198)[130:org.apache.servicemix.bundles.wsd
l4j:1.6.3.1]
        at
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2390)[130:org.apache.servicemix.bundles.wsdl4j
:1.6.3.1]
        at
com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2422)[130:org.apache.servicemix.bundles.wsdl4j
:1.6.3.1]
        at
org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:231)[131:org.apache.cxf.cxf-rt-ws
dl:3.0.4.redhat-620133]
        at
org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:163)[131:org.apache.cxf.cxf-rt-wsd
l:3.0.4.redhat-620133]
        at
org.apache.camel.component.cxf.WSDLServiceFactoryBean.getDefinition(WSDLServiceFactoryBean.java:64)[207:org
.apache.camel.camel-cxf:2.15.1.redhat-620133]
        ... 86 more
Caused by: java.net.UnknownHostException: www.dataaccess.com
        at
java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178)[:1.7.0_76]
        at
java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)[:1.7.0_76]
        at
java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)[:1.7.0_76]
        at java.net.Socket.connect(Socket.java:579)[:1.7.0_76]
        at java.net.Socket.connect(Socket.java:528)[:1.7.0_76]
        at
sun.net.NetworkClient.doConnect(NetworkClient.java:180)[:1.7.0_76]
        at
sun.net.www.http.HttpClient.openServer(HttpClient.java:432)[:1.7.0_76]
        at
sun.net.www.http.HttpClient.openServer(HttpClient.java:527)[:1.7.0_76]
        at
sun.net.www.http.HttpClient.<init>(HttpClient.java:211)[:1.7.0_76]
        at sun.net.www.http.HttpClient.New(HttpClient.java:308)[:1.7.0_76]
        at sun.net.www.http.HttpClient.New(HttpClient.java:326)[:1.7.0_76]
        at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)[:1.7.0_76]
        at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)[:1.7.0_76]
        at
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)[:1.7.0_76]
        at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)[:1.7.0_76]
        at
org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown
Source)[:]
        at
org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown
Source)[:]
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)[:]
        at org.apache.xerces.parsers.XML11Configuration.parse(Unknown
Source)[:]
        at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)[:]
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)[:]
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown
Source)[:]
        at
com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2188)[130:org.apache.servicemix.bundles.wsd
l4j:1.6.3.1]
        ... 91 more


Please help me on this. Your help would appreciated.



--
View this message in context: http://camel.465427.n5.nabble.com/Websevice-Client-Call-in-Camel-tp5774165.html
Sent from the Camel Development mailing list archive at Nabble.com.

Mime
View raw message