axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KUMAR NITESH <nitesh.ku...@sdc.canon.co.in>
Subject deploying c++ dll as a webservice
Date Thu, 30 Jul 2009 11:00:27 GMT

Dear all,

I have stuck to the problem of developing web service using SOAP which
internally calls a JNI interface which inturn uses C++ code.
Initially, I made a web service using only Java codes with the help of the
site "http://people.apache.org/~ruchithf/hw-axis2/". I successfully made
SOAP web service and its client for using the web service.

But my project required me to use a C++ library from Java code. So, I have
to make a web service which uses this C++ library internally. I am getting
stuck when i am making the web service by above method. 

Description of the how I made web service:
1. I have created a service class file "DLLService.java" in my Project
folder..
2. Created folder META-INF and copied  services.xml in this folder.
services.xml contains:
><service>
>	<parameter name="ServiceClass" locked="false">DLLService</parameter>
>	<operation name="echo">
>		<messageReceiver
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>	</operation>    
></service>

3. compile DLLService.java
4. created myservice DLLService.aar file .
5. Copied  DLLService.aar file in axis2
6. After deploying webservice we convert it into javacode using
WSDL2Java.bat file
8. Created Client.java file which calls the echo function of myservice
class(webservice).
9. compiled stubed code (code generated by wsdl to java command )  and
client
10. run the client
11.We got an error message  : Exception in thread "main"
org.apache.axis2.AxisFault: Connection reset
        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
        at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.jav
a:195)
        at
org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
        at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessa
geWithCommons(CommonsHTTPTransportSender.java:327)
        at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Com
monsHTTPTransportSender.java:206)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
        at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisO
peration.java:374)
        at
org.apache.axis2.description.OutInAxisOperationClient.executeImpl(Out
InAxisOperation.java:211)
        at
org.apache.axis2.client.OperationClient.execute(OperationClient.java:
163)
        at org.apache.ws.axis2.DLLServiceStub.echo(DLLServiceStub.java:145)
        at Client.main(Client.java:17)
Caused by: java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at
org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:
77)
        at
org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105
)
        at
org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.
java:1115)
        at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$Http
ConnectionAdapter.readLine(MultiThreadedHttpConnectionManager.java:1373)
        at
org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMetho
dBase.java:1832)
        at
org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodB
ase.java:1590)
        at
org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.j
ava:995)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(Htt
pMethodDirector.java:397)
        at
org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe
thodDirector.java:170)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:396)
        at
org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:346)
        at
org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Abst
ractHTTPSender.java:520)
        at
org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.jav
a:191)



Please suggest some solution to this problem

Thanks.
-- 
View this message in context: http://www.nabble.com/deploying-c%2B%2B-dll-as-a-webservice-tp24736290p24736290.html
Sent from the Axis - C++ - User mailing list archive at Nabble.com.


Mime
View raw message