Re: Use SOAP-Service to query database

2007-07-18 Thread Joe Nathan


Oliver Hirschi-2 wrote:
 
 Is there a generic framework for doing that?
 
SOAP means platform and programming language neutral,
which means it supports limited data types. Obvious choice
is String. To return data, one obvious choice is envelop into
XML string and return it! So your clients should understand
your xml string.

regards.

-- 
View this message in context: 
http://www.nabble.com/Use-SOAP-Service-to-query-database-tf4097472.html#a11667149
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: Use SOAP-Service to query database

2007-07-17 Thread Joe Nathan

You are rignt on it!

regards.


Oliver Hirschi-2 wrote:
 
 Hi there
 
 I have to implement a SOAP-Server as a application server to query 
 database. The clients are java and c++.
 I think this is base practice of using a soap-service, isn't it?
 So, how would you return the ResultSet? I think there would be the 
 solution go throw the ResultSet on server and generate a xml-stream 
 which is returned like the following:
 
 ResultSet
 Row
 Col name=Label1Value11/Col
 Col name=Label2Value12/Col
 ...
 /Row
 Row
 Col name=Label1Value21/Col
 Col name=Label2Value22/Col
 ...
 /Row
 ...
 /ResultSet
 
 
 Is there a better way to do that?
 
 Thanks  kind regards
 
 -- 
 Oliver Hirschi
 http://www.FamilyHirschi.ch 
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Use-SOAP-Service-to-query-database-tf4097472.html#a11659530
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: [Axis2]How to invoke web service from another

2007-07-12 Thread Joe Nathan

I think there are bugs in Axis. I tested on POJO calling another SOAP.
Then I get exception like this;
==
java.util.MissingResourceException: Can't find resource for bundle
org.apache.ax
is2.i18n.ProjectResourceBundle, key outboundNoAction
at java.util.ResourceBundle.getObject(ResourceBundle.java:386)
at java.util.ResourceBundle.getString(ResourceBundle.java:346)
at
org.apache.axis2.i18n.MessageBundle.getMessage(MessageBundle.java:191)
===
I tested from Servelet container after adding jars to servelet lib. It
worked 
fine. But not from Axis container per se. I will contact SAAJ developer
about 
this problem.

regards.




-- 
View this message in context: 
http://www.nabble.com/-Axis2-How-to-invoke-web-service-from-another-tf4055013.html#a11556679
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: [Axis2]How to invoke web service from another

2007-07-11 Thread Joe Nathan

You should make relevant JAR files included in your classpath or
in container libs. I use JDK1.6 which includes most of the packages
you use. 1.5 is quite different. You have to use many of Axis 
provided JAR files.

If you still have problems, please post versions for;
 - JDK
 - Servlet container
 - Axis

And where you run clients?

Regards.




vittal nangunoori wrote:
 
 hi Joe Nathan,
 I have put the SAAJ code in my web service application
 and I am getting the following exceptions
 
 Please provide solution for this too..
 
 javax.xml.soap.SOAPException: Unable to create SOAP
 Factory: org.apache.axis2.sa
 aj.SOAPFactoryImpl
 at
 javax.xml.soap.SOAPFactory.newInstance()Ljavax.xml.soap.SOAPFactory;(
 Unknown Source)
 

-- 
View this message in context: 
http://www.nabble.com/-Axis2-How-to-invoke-web-service-from-another-tf4055013.html#a11549923
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: [Axis2]How to invoke web service from another

2007-07-11 Thread Joe Nathan

You should make relevant JAR files included in your classpath or
in container libs. I use JDK1.6 which includes most of the packages
you use. 1.5 is quite different. You have to use many of Axis 
provided JAR files.

If you still have problems, please post versions for;
 - JDK
 - Servlet container
 - Axis

And where you run clients?

Regards.




vittal nangunoori wrote:
 
 hi Joe Nathan,
 I have put the SAAJ code in my web service application
 and I am getting the following exceptions
 
 Please provide solution for this too..
 
 javax.xml.soap.SOAPException: Unable to create SOAP
 Factory: org.apache.axis2.sa
 aj.SOAPFactoryImpl
 at
 javax.xml.soap.SOAPFactory.newInstance()Ljavax.xml.soap.SOAPFactory;(
 Unknown Source)
 

-- 
View this message in context: 
http://www.nabble.com/-Axis2-How-to-invoke-web-service-from-another-tf4055013.html#a11549924
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: [Axis2]How to invoke web service from another

2007-07-10 Thread Joe Nathan

Use SAAJ for client side. You do not need stub in SAAJ!
The following is a fully-tested code example. You can copy it and
change for your purpose;
===
SOAPConnectionFactory connectionFactory =
SOAPConnectionFactory.newInstance(); 
SOAPConnection connection = connectionFactory.createConnection(); 

MessageFactory mf = MessageFactory.newInstance(); 
SOAPMessage smsg = mf.createMessage(); 
SOAPBody body = smsg.getSOAPBody(); 

QName bodyName = new QName(http://ws.apache.org/axis2/xsd;, 
YourServiceMethodName, m); 
SOAPBodyElement bodyElement = body.addBodyElement(bodyName); 

// build arguments: three in this case;
QName name = new QName(inputarg); 
SOAPElement symbol = bodyElement.addChildElement(name); 
symbol.addTextNode(your input data); 

name = new QName(user); 
symbol = bodyElement.addChildElement(name); 
symbol.addTextNode(your userid); 

name = new QName(password); 
symbol = bodyElement.addChildElement(name); 
symbol.addTextNode(blashblah); 

// call the service;
URL endpoint = new
URL(http://localhost/axis2/services/YOURsoapServiceName;); 
SOAPMessage sresponse = connection.call(smsg, endpoint); 
connection.close();

// Get the return text;
SOAPBody soapBody = sresponse.getSOAPBody();
SOAPElement node = (SOAPElement)soapBody.getFirstChild().getFirstChild();
String msg = node.getValue();

-- 
View this message in context: 
http://www.nabble.com/-Axis2-How-to-invoke-web-service-from-another-tf4055013.html#a11530555
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: [Axis2]How to invoke web service from another

2007-07-10 Thread Joe Nathan

PS;

Add the following imports if necessary;
==
import javax.xml.soap.*;
import javax.xml.namespace.QName;
import java.net.URL;

import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import org.w3c.dom.*;

import com.sun.org.apache.xml.internal.serialize.OutputFormat;
import com.sun.org.apache.xml.internal.serialize.XMLSerializer;

-- 
View this message in context: 
http://www.nabble.com/-Axis2-How-to-invoke-web-service-from-another-tf4055013.html#a11530590
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: String[] as return type

2007-07-07 Thread Joe Nathan

This may be the answer for your question: 
http://www.nabble.com/-Axis2--returning-Array-versus-List-%2C-and-more-tf4035642.html
http://www.nabble.com/-Axis2--returning-Array-versus-List-%2C-and-more-tf4035642.html
 
-- 
View this message in context: 
http://www.nabble.com/String---as-return-type-tf4035249.html#a11483266
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: [Axis2] returning Array versus List , and more

2007-07-06 Thread Joe Nathan

SOAP meant to be universal over both platforms and programming languages.
This means that it's sensible to pass and return values in common datatypes
in all platforms and languages which is String, Int, Float. As all
SOAP implementations support XML, you may return multiple values wrapped in
a xml string. Your client may need to pass arrays imbedded in xml strings!

-- 
View this message in context: 
http://www.nabble.com/-Axis2--returning-Array-versus-List-%2C-and-more-tf4035642.html#a11474884
Sent from the Axis - User mailing list archive at Nabble.com.


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



RE: Where to put Axis2 jar files on TOMCAT

2007-06-29 Thread Joe Nathan

This is a messy business. If you use JDK1.6, many of the jar archives are
already includes in the JVM per se. Then again, they may not compatile with
the versions on Axis and Tomcat. The safer way is to include in WEB-INF/lib.
However you ended up placing multiple places!





Chen, John (N-Avatar Inc.) wrote:
 
 
 Actually, here is the reason 
 
 http://issues.apache.org/jira/browse/WSCOMMONS-70
 
 John
 
 -Original Message-
 From: Chen, John (N-Avatar Inc.) 
 Sent: Friday, June 29, 2007 4:59 PM
 To: axis-user@ws.apache.org
 Cc: [EMAIL PROTECTED]
 Subject: RE: Where to put Axis2 jar files on TOMCAT
 
 
 I think the problem is stax-api.jar, somehow I have to either put my
 Axis2 WEB-INF/lib or my classpath to expose it to Axis engine. So my
 solution is have it in my classpath and all other jar files under
 common/lib and it works for me.
 
 But why?
 
 John
 
 -Original Message-
 From: Chen, John (N-Avatar Inc.) 
 Sent: Friday, June 29, 2007 2:29 PM
 To: axis-user@ws.apache.org
 Cc: [EMAIL PROTECTED]
 Subject: RE: Where to put Axis2 jar files on TOMCAT
 
 Do you know why Axis2 is not able to locate the jar files I put under
 common/lib. It looks to me an Axis2 service is able to locate some jar
 files in common/lib such as Axis2-kernel.jar, but having problem with
 some such as stax-api.jar. Is it the case?
 
 I have to put my own jar file under common/lib since I have other web
 applications using it and invoke Axis stub class from a class in that
 jar file. Can anybody give me some help here? Please, I have tried all
 the options I can think of, including adding Axis jar files to my
 classpath(it didn't work either because of the tomcat class loader
 mechanism)
 
 Thanks
 
 John
 
 
 -Original Message-
 From: Joe Nathan [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, June 27, 2007 7:01 PM
 To: axis-user@ws.apache.org
 Subject: RE: Where to put Axis2 jar files on TOMCAT
 
 
 Instead of common lib, place them all together in the service specific
 lib.
 Then it works. But this also creates another problem: duplicate resource
 creations. Eventually, Axis and Tomcat should be merged as one.
 Otherwise, duplication problems will remain.
 
 regards.
 
 
 Chen, John (N-Avatar Inc.) wrote:
 
 Dims,
 
 Actually when I put all jar files in common\lib, I could not even
 deploy, I got java.lang.IllegalStateException: No valid ObjectCreator
 found.
 
 Thanks
 
 John 
 
 -Original Message-
 From: Davanum Srinivas [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, June 27, 2007 3:08 PM
 To: axis-user@ws.apache.org
 Cc: Jain, Kokil
 Subject: Re: Where to put Axis2 jar files on TOMCAT
 
 find all the stax related jars in your environment. easy thumb rule,
 you need to place the woodstox and stax jars in the same directory
 whether it is in WEB-INF/lib or commons/lib. more importantly remove
 any dups.
 
 thanks,
 dims
 
 On 6/27/07, Chen, John (N-Avatar Inc.) [EMAIL PROTECTED] wrote:




 I have been struggling with this issue for the last several days and
 I
 believe it is the Axis2 class loader issue



 Basically I am developing a system can act as both Web Services
 client
 and
 server. To use it as a Web Services client, I have to put my
 application jar
 file and all dependent Axis2 jar files under common/lib. To host my
 Web
 Services, I have a war file with my Web Services configuration and
 classes
 in it.



 My issue is, if I don't put any Axis2 jar files in the war file
 (WEB-INF/lib), I am getting the following exception,

 java.lang.IllegalStateException: No valid ObjectCreator found.

 at
 org.apache.axiom.om.util.StAXUtils$Pool.init(StAXUtils.java:44)

 at
 org.apache.axiom.om.util.StAXUtils.clinit(StAXUtils.java:68)

 at
 org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:555)

 at
 org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBui



 Then if I put those Axis2 jar files back in the war file, I don't
 have
 any
 problem deploying it, but I got the following exception when invoking
 the
 Web Services,



 ERROR AxisServlet - java.lang.LinkageError: Class
 javax/xml/stream/XMLStreamRead

 er violates loader constraints





 Thanks



 John
 
 
 -- 
 Davanum Srinivas :: http://davanum.wordpress.com
 
 -
 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]
 
 
 
 
 -- 
 View this message in context:
 http://www.nabble.com/Where-to-put-Axis2-jar-files-on-TOMCAT-tf3989363.h
 tml#a11334198
 Sent from the Axis - User mailing list archive at Nabble.com.
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED

RE: Where to put Axis2 jar files on TOMCAT

2007-06-27 Thread Joe Nathan

Instead of common lib, place them all together in the service specific lib.
Then it works. But this also creates another problem: duplicate resource
creations. Eventually, Axis and Tomcat should be merged as one.
Otherwise, duplication problems will remain.

regards.


Chen, John (N-Avatar Inc.) wrote:
 
 Dims,
 
 Actually when I put all jar files in common\lib, I could not even
 deploy, I got java.lang.IllegalStateException: No valid ObjectCreator
 found.
 
 Thanks
 
 John 
 
 -Original Message-
 From: Davanum Srinivas [mailto:[EMAIL PROTECTED] 
 Sent: Wednesday, June 27, 2007 3:08 PM
 To: axis-user@ws.apache.org
 Cc: Jain, Kokil
 Subject: Re: Where to put Axis2 jar files on TOMCAT
 
 find all the stax related jars in your environment. easy thumb rule,
 you need to place the woodstox and stax jars in the same directory
 whether it is in WEB-INF/lib or commons/lib. more importantly remove
 any dups.
 
 thanks,
 dims
 
 On 6/27/07, Chen, John (N-Avatar Inc.) [EMAIL PROTECTED] wrote:




 I have been struggling with this issue for the last several days and I
 believe it is the Axis2 class loader issue



 Basically I am developing a system can act as both Web Services client
 and
 server. To use it as a Web Services client, I have to put my
 application jar
 file and all dependent Axis2 jar files under common/lib. To host my
 Web
 Services, I have a war file with my Web Services configuration and
 classes
 in it.



 My issue is, if I don't put any Axis2 jar files in the war file
 (WEB-INF/lib), I am getting the following exception,

 java.lang.IllegalStateException: No valid ObjectCreator found.

 at
 org.apache.axiom.om.util.StAXUtils$Pool.init(StAXUtils.java:44)

 at
 org.apache.axiom.om.util.StAXUtils.clinit(StAXUtils.java:68)

 at
 org.apache.axis2.util.XMLUtils.toOM(XMLUtils.java:555)

 at
 org.apache.axis2.deployment.DescriptionBuilder.buildOM(DescriptionBui



 Then if I put those Axis2 jar files back in the war file, I don't have
 any
 problem deploying it, but I got the following exception when invoking
 the
 Web Services,



 ERROR AxisServlet - java.lang.LinkageError: Class
 javax/xml/stream/XMLStreamRead

 er violates loader constraints





 Thanks



 John
 
 
 -- 
 Davanum Srinivas :: http://davanum.wordpress.com
 
 -
 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]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Where-to-put-Axis2-jar-files-on-TOMCAT-tf3989363.html#a11334198
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: Steps for returning Custom SOAP BODY

2007-06-26 Thread Joe Nathan

I am not sure whether I understand your question correctly.
You can return String objects which is XML string contents. 
For example, your POJO service can have the following;

public class MyPoJo {

  public String xmlHello(String v) {
 String xmlstring = hello./hello;
 return xmlstring;
  }
}

From clinents, you just get XML as String as follows;

  SOAPBody soapBody = sresponse.getSOAPBody();
  SOAPElement node = (SOAPElement)soapBody.getFirstChild().getFirstChild();
  String msg = node.getValue();

Note that you can XML contents as String for arguments as well. The rest
will 
be taken care by service containers!

Hope this helps!










Gagan Sinha wrote:
 
  
 
 Hi 
 
  
 
 I have hosted a simple webservice using AXIS 1.4 .
 
 The Java Method returns a ArrayList of ProductVO class.
 
  
 
 Can any one help me with the steps for returning my own Custom XML in the
 SOAP body? I.e. I need to replace the Axis generated SOAP body with my
 own.
 
  
 
 The need is urgent and any help would be highly appreciated.
 
  
 
 Thanks  Regards
 
 Gagan
 
  
 
  
 
  
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Steps-for-returning-Custom-SOAP-BODY-tf3982830.html#a11316918
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: class loading problem

2007-06-25 Thread Joe Nathan

It does make difference, especially forward compatibility is not assured!


Michele Mazzucco-2 wrote:
 
 Joe,
 
 it should not make any difference because the linking is made at  
 runtime, and I wasn't using any of the new features.
 Indeed, I think the problem is related to the Axis2 class loader.
 
 
 Michele
 

-- 
View this message in context: 
http://www.nabble.com/class-loading-problem-tf3965801.html#a11297073
Sent from the Axis - User mailing list archive at Nabble.com.


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



Axis and resource management

2007-06-25 Thread Joe Nathan

I think most will host both SOAP and Servlets together using Tomcat+Axis. In
addition, most will have running environmental resources such as database
connections, files, etc. Currently, we ended up with two separate rources
managers. This is a highly undesirable situation! It should be better if we
can serve Servlets and SOAPs together using a single resources manager.

In addition, Axis returns URL which is not actual location for the following
call;

  URL url = xx.getClassLoader().getResource(??);

This should return actual .jar or .aar path names!

Regards.

-- 
View this message in context: 
http://www.nabble.com/Axis-and-resource-management-tf3979466.html#a11297223
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: class loading problem

2007-06-23 Thread Joe Nathan

It does have differences between 1.6 and 1.5!
For example, 1.6 JVM contains class definitions that 1.5 does not.
The latter you have to add extra Tomcat/Axis jar files to classpath.

Regards.


Michele Mazzucco-2 wrote:
 
 Hi all,
 
 I've compiled a module on a machine using Java 1.6 and deployed on
 another machine running Java 1.5. When I start tomcat I get a
 ClassNotFoundException on the module class -- which is correctly
 included and configured into the mar file.
 If I compile the module with Java 1.5 it works fine.
 I guess this is not a normal behavior, is it?
 
 Michele
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/class-loading-problem-tf3965801.html#a11265430
Sent from the Axis - User mailing list archive at Nabble.com.


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