The Artima Developer Community
Sponsored Link

Web Services Forum
a problem with JDBC and Web Service

2 replies on 1 page. Most recent reply: Jun 28, 2005 12:12 PM by George

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 2 replies on 1 page
Xingguang ma

Posts: 2
Nickname: xm4
Registered: Aug, 2004

a problem with JDBC and Web Service Posted: Aug 24, 2004 1:11 AM
Reply to this message Reply
Advertisement
I am a newbie of Web service doing a project about it. Within this topic, I need to retrive data from a database with JDBC then offer a web service. My JDBC program works well and saves all results into a Vector. So I orginally think a simple server programe which invokes the JDBC programe and return Vector to client will finish the project. Unfortuantely, when the client invokes WebService programe, it gives the following exception:

AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace: AxisFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
faultSubcode:
faultString: java.lang.reflect.InvocationTargetException
faultActor:
faultNode:
faultDetail:

java.lang.reflect.InvocationTargetException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationC ontextImpl.java:1015)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher .dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContex tImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)
at SoapTest.main(SoapTest.java:15)


java.lang.reflect.InvocationTargetException
at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:260)
at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:169)
at org.apache.axis.encoding.DeserializationContextImpl.endElement(DeserializationC ontextImpl.java:1015)
at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher .dispatch(Unknown Source)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
at javax.xml.parsers.SAXParser.parse(Unknown Source)
at org.apache.axis.encoding.DeserializationContextImpl.parse(DeserializationContex tImpl.java:242)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:538)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:376)
at org.apache.axis.client.Call.invokeEngine(Call.java:2583)
at org.apache.axis.client.Call.invoke(Call.java:2553)
at org.apache.axis.client.Call.invoke(Call.java:2248)
at org.apache.axis.client.Call.invoke(Call.java:2171)
at org.apache.axis.client.Call.invoke(Call.java:1691)

The source code of both server side and client side are listed as below:

Server:
public Vector homologyQuery(String gID) throws FileException,DatabaseException
{
Initialize i=new Initialize(); //reading a configure file
DBService db=new DBService(i);
gIDs=db.queryGID(gID);

return gIDs ;
}

Client:

try {
String endpoint = "http://localhost:8080/test/services/HomolougeQueryService";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("http://HomolougeQueryService", "homologyQuery"));
Vector res = (Vector) call.invoke( new Object[] { args[0]} );
System.out.println("Now the Vector size is :" +res.size());
for (int i=0;i<res.size();i++ )
{
System.out.println(res.elementAt(i));
}
} catch (Exception e) {
e.printStackTrace();
}
}

Could help me figure out the problem or give me any hits.


Xingguang ma

Posts: 2
Nickname: xm4
Registered: Aug, 2004

Re: a problem with JDBC and Web Service Posted: Aug 24, 2004 1:21 AM
Reply to this message Reply
Sorry, A line in Server programe is omitted.

Server:

public Vector homologyQuery(String gID) throws FileException,DatabaseException
{
Initialize i=new Initialize(); //read a configure file
DBService db=new DBService(i);
Vector gIDs=new Vector();
gIDs=db.queryGID(gID);

return gIDs ;
}

George

Posts: 1
Nickname: semi
Registered: Jun, 2005

Re: a problem with JDBC and Web Service Posted: Jun 28, 2005 12:12 PM
Reply to this message Reply
Please let me know if you know the solution for this issue.

Flat View: This topic has 2 replies on 1 page
Topic: How to use webservices with SSL? Previous Topic   Next Topic Topic: Authentication web services

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use