Re: axis2 + Spring2.5+Hibernate

2009-07-30 Thread Sagara Gunathunga
HI ,
>       at 
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>       at 
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>       at 
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
>       at java.lang.Thread.run(Thread.java:595)
> Caused by: java.lang.NullPointerException
>       at 
> com.xxx.ws.DataSetServiceEnquiry.getDataSetList(DataSetServiceEnquiry.java:73)
>       ... 34 more

Seems like there is no any problem with web service , according to the
above error trace you got a  NullPointerException in your business
method (getDataSetList).  May be you haven't inject required beans
properly, can you test your business method separately with JUnit
Spring support separately before you expose into Axis2.


Thanks ,

-- 
Sagara Gunathunga

Blog - http://ssagara.blogspot.com
Web - http://sagaras.awardspace.com/


Re: axis2 + Spring2.5+Hibernate

2009-07-30 Thread sam wong
hi,Sagara,

the Axis2+spring is ok now.


I have a method need return objects.
how can i do?


attahch is my  main config and source:

1.  project folder :

projectName
|src
||com.xxx.ws
|||-DataSetServiceEnquiry.java
||com.xxx.ws.pojo
|||-DataSet.java
|
|WebRoot
||
||WEB-INF
|||classes
|||conf
||||axis2.xml
|||modules
||||addressing-1.4.1.mar
||||axis2-scripting-1.4.1.mar
||||mex-1.4.1.mar
||||modules-1.4.1.mar
||||ping-1.4.1.mar||
||||soapmonitor-1.4.1.mar
|||pojo
|||services
||||xxx
|||||META-INF
||||||services.xml
||||services.list
||||version-1.4.1.aar
|||Web.xml


2. web.xml
in this file, i copy all content from axis2.war /WEB-INF/web.xml

3.services.xml


 
   
   simple spring example
   
   org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
   dataSetServiceEnquiry
   
   http://www.w3.org/2004/08/wsdl/in-out";
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
   




3.DataSetServiceEnquiry.java

public class DataSetServiceEnquiry {
ohter code...
   // The web service
   public String getUserAccountCount() {
   return "(RPCMessageReceiver) Total UserAccount count is
:"+String.valueOf(this.getUserAccountManager().findAllUserAccount().size());
   }
   public com.eadi.ws.pojo.DataSet[]  getDataSetList(){

   List list=this.getDataSetManager().findAll();

   com.xxx.ws.pojo.DataSet[]   ds=new com.xxx.ws.pojo.DataSet[list.size()];

   for(int i=0;list!=null & i:
> Hi,
> I have noticed following problems with your approach.
>
> 1.) You have placed service.xml file in a wrong place , it should be
> like this  /mysite/META-INF/services/services.xml . ( refer [1] to get
> familiar with correct directory structure )
>
> 2.)As a suggestion in DataSetServiceEnquiry class you can expose your
> web service as a POJO method. Axis2 supports for exposing Spring beans
> (POJO) as web services, here you don't need to deal with OMElement
> unless you really want to do so .
>
>  instead of  public OMElement getValue(OMElement ignore)  method,
> simply you can use following method with RPCMessageReceiver (in
> service.xml).
>
>                   public String getValue(){
>                        return this.dataSetEnquiryManager.getValue();
>                       }
>
>
> 3.) you haven't mention any thing about web.xml file or how you deploy
> your service whether it  as a WAR archive or as a AAR archive ?
>
>
>
> [1] - http://www.developer.com/open/article.php/3777111
>
> Thanks ,
>
>
> On Wed, Jul 29, 2009 at 8:44 AM, sam wong wrote:
>> hi,Sagara
>> first ,  my web site is working.
>>
>> 1.   Spring Bean
>>
>> public interface IDataSetEnquiryManager {
>>   public String getValue();
>> }
>> public class DataSetEnquiryManagerImpl  implements IDataSetEnquiryManager {
>>   public String getValue(){
>>      return "TEST";
>>   }
>> }
>>
>> applicationContext.xml is:
>>
>> >        class="com.eadi.ws.DataSetServiceEnquiry">
>>        
>>                
>>        
>> 
>> >               class="com.eadi.service.impl.DataSetEnquiryManagerImpl">
>> 
>>
>> 2.  web service class,
>>
>> DataSetServiceEnquiry.java :
>>
>> package com.eadi.ws;
>> import org.apache.axiom.om.OMAbstractFactory;
>> import org.apache.axiom.om.OMElement;
>> import org.apache.axiom.om.OMFactory;
>> import org.apache.axiom.om.OMNamespace;
>> import org.apache.axiom.om.OMText;
>>
>> import com.eadi.service.IDataSetEnquiryManager;
>> public class DataSetServiceEnquiry {
>>    private IDataSetEnquiryManager dataSetEnquiryManager = null;
>>    public IDataSetEnquiryManager getDataSetEnquiryManager() {
>>                return dataSetEnquiryManager;
>>        }
>>        public void setDataSetEnquiryManager(
>>                        IDataSetEnquiryManager dataSetEnquiryManager) {
>>                this.dataSetEnquiryManager = dataSetEnquiryManager;
>>        }
>>    // The web service
>>    public OMElement getValue(OMElement ignore) {
>>            OMFactory factory=OMAbstractFactory.getOMFactory();
>>            OMNamespace payloadNs=
>> factory.createOMNamespace("http://ws.eadi.com/datasetenquiry";,
>> "datasetenquiry");
>>            OMElement payload =factory.createOMElement("string", payloadNs);
>>            OMText response =
>> factory.createOMText(this.dataSetEnquiryManager.getValue());
>>            payload.addChild(response);
>>            return payload;
>>    }
>> }
>>
>>
>>
>> 3. add services.xml to    /mysite/META-INF/services.xml
>>
>> 
>>  
>>    
>>        simple spring example
>>    
>>    > name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
>>    dataSetServiceEn

Re: axis2 with spring

2009-07-30 Thread sam wong
Dear Joe,

the Axis2+spring is ok now.

I have a mentd need return objects.
how can i do?


attahch is my  main config and source:

1.  project folder :

projectName
|src
||com.xxx.ws
|||-DataSetServiceEnquiry.java
||com.xxx.ws.pojo
|||-DataSet.java
|
|WebRoot
||
||WEB-INF
|||classes
|||conf
||||axis2.xml
|||modules
||||addressing-1.4.1.mar
||||axis2-scripting-1.4.1.mar
||||mex-1.4.1.mar
||||modules-1.4.1.mar
||||ping-1.4.1.mar||
||||soapmonitor-1.4.1.mar
|||pojo
|||services
||||xxx
|||||META-INF
||||||services.xml
||||services.list
||||version-1.4.1.aar
|||Web.xml


2. web.xml
in this file, i copy all content from axis2.war /WEB-INF/web.xml

3.services.xml


 

simple spring example

org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
dataSetServiceEnquiry

http://www.w3.org/2004/08/wsdl/in-out";
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>





3.DataSetServiceEnquiry.java

public class DataSetServiceEnquiry {
ohter code...
// The web service
public String getUserAccountCount() {
return "(RPCMessageReceiver) Total UserAccount count is
:"+String.valueOf(this.getUserAccountManager().findAllUserAccount().size());
}
public com.eadi.ws.pojo.DataSet[]  getDataSetList(){

List list=this.getDataSetManager().findAll();

com.xxx.ws.pojo.DataSet[]   ds=new com.xxx.ws.pojo.DataSet[list.size()];

for(int i=0;list!=null & i:
> Look at this thread:
>
> http://www.nabble.com/Newbie-question%3A-how-to-plug-axis2-engine-into-existing-web-application-running-in-weblogic-td23411717.html#a23412081
>
> Then this one:
>
> http://www.nabble.com/Axis2-Spring-integration...-Getting-nulls-in-dependency-injected-values-tt23785825.html#a23785825
>
>
>
> -Original Message-
> From: sam wong [mailto:samwon...@gmail.com]
> Sent: Tuesday, July 28, 2009 11:54 PM
> To: axis-user@ws.apache.org
> Subject: axis2 with spring
>
> hi, everybody,
>
>  i have a web site  wrote with  jsf1.2+Spring2.5+Hibernate.
>
> now need to publish some Spring Bean as WebService( use axis).
>
> what steps should i do ?
>
> Thanks a lot.
> Sam Wong
>
> STATEMENT OF CONFIDENTIALITY:
>
>
>
> The information contained in this electronic message and any attachments to
> this message are intended for the exclusive use of the addressee(s) and may
> contain confidential or privileged information. If you are not the intended
> recipient, please notify WHI Solutions immediately at g...@whisolutions.com,
> and destroy all copies of this message and any attachments.
>


Reexamining problem with Axis not generating container

2009-07-30 Thread KARR, DAVID (ATTCINW)
A couple weeks ago I posted a note about a problem (title "Axis skips
generating type if it thinks it can just make an array") where Axis 1.3
doesn't generate a container class if an element only has a single
child.  I had thought the problem was just annoying, but now I'm seeing
it's more serious than that.  Axis fails to deserialize legal XML if I
don't add a kludge element to make it create the container class.

When I generate code for the following:


  


  


It generates a container class corresponding to the "PropertyData"
element, and the class corresponding to the
"SomethingItemPropertyListInfo" element has a data element of that type.

If I comment out the "Dummy" element, however, the data element in the
class corresponding to the "SomethingItemPropertyListInfo" element is
simply an array of "SomethingPropertyInfo".

This is annoying, but it's not fatal, as I can just change code
references, depending on whether a container class was generated or not.

What is fatal is that when I don't have the "Dummy" element defined,
then legal XML using these structures (note that "Dummy" is optional, so
it doesn't need to be present in the data) fails to deserialize,
throwing an exception like the following:

-
2009-07-30 09:49:29,551 ERROR
[org.apache.axis.encoding.ser.BeanPropertyTarget] [set] [Thread:main] -
[Could not convert
[Lcom.company.interfaces.csi.soap.types.SomethingServicePropertyInfo; to
bean field 'itemPropertyListData', type
[Lcom.company.interfaces.csi.soap.types.SomethingServicePropertyInfo;]
2009-07-30 09:49:29,551 ERROR [org.apache.axis.client.Call] [invoke]
[Thread:main] - [Exception:]
java.lang.IllegalArgumentException: argument type mismatch
at
org.apache.axis.encoding.ser.BeanPropertyTarget.set(BeanPropertyTarget.j
ava:157)
at
org.apache.axis.encoding.DeserializerImpl.valueComplete(DeserializerImpl
.java:249)
at
org.apache.axis.encoding.ser.ArrayDeserializer.valueComplete(ArrayDeseri
alizer.java:583)
at
org.apache.axis.encoding.DeserializerImpl.endElement(DeserializerImpl.ja
va:509)
at
org.apache.axis.encoding.DeserializationContext.endElement(Deserializati
onContext.java:1087)
at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:
171)
at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.j
ava:1141)
at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)
at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
at org.apache.axis.client.Call.invoke(Call.java:2467)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)


If I'm understanding this correctly, this error message is saying that I
have a value of type "SomethingServicePropertyInfo[]", and I'm trying to
assign it to a field named "itemPropertyListData", which is of type
"SomethingServicePropertyInfo[]".  I must be misunderstanding this,
because I don't see how that could fail to convert.


Java2WSDL Java 5 enum

2009-07-30 Thread Greg Guydo
Has support for Java 5 Enums been added to Axis2's Maven Java2WSDL with the
Axis2 1.5 release?

Thanks,
Greg


Query regarding Axis2 CORBA module

2009-07-30 Thread Rohit Bhagwat
Hi,

My client has a CORBA application running on Borland Visibroker. We plan 
to use  Axis2 CORBA module to expose the CORBA server as webservice.
The CORBA server is written in C++ and the CORBA client is written is 
Java.


(1) As the CORBA server is written in C++,  shall we use Axis2/Java  or 
Axis2/C?

(2) Currently the client is paying heavy licensing costs of Borland 
Visibroker. Is there a way to get rid of Visibroker with minimal code 
changes to the server code


Any help will be appreciated.

Thanks & Regards,
Rohit




-
This message, and any attachments to it, may contain information
that is privileged, confidential, and exempt from disclosure under
applicable law.  If the reader of this message is not the intended
recipient, you are notified that any use, dissemination,
distribution, copying, or communication of this message is strictly
prohibited.  If you have received this message in error, please
notify the sender immediately by return e-mail and delete the
message and any attachments.  Thank you.

WSDD deployment without axis running

2009-07-30 Thread Nikolay Dyankov
Hi!

I'm a newbie to java and axis.
I have a set of jars and the wsdd.
I have access to the filesystem on which the service needs to be
deployed and on which axis server/tomcat runs.

Is it possible to deploy a web-service without actually running the
axis server/tomcat (like it's possible for jws files)?

I guess if the answer is yes, the procedure would involve a set of
copy/convert operations on the wsdd?
Any help is highly appreciated.

Thanks in advance,
Nikolay


Rampart 1.4 OutFaultFlow entry in the module.xml

2009-07-30 Thread Chinmoy Chakraborty
Hi Rampart Guys,

I noticed there is no entry for paramter based WS-Security in 'OutFaultFlow'
phase order in the module.xml for 'rampart-1.4.mar' file. Could this be a
reason for not sending the SOAP fault to the client when error occurs while
invoking the service method? By the way I am having parameter based
WS-security enabled services.


Chinmoy


Re: Error handling for WS-Security enabled services

2009-07-30 Thread Chinmoy Chakraborty
Preetham,

Thanks for your reply. Do you see the same problem? Could you tell me
reason? Is it a AXIS2 issue? May be there is some parameter we can configure
in axis2.xml (in OutFaultFlow phase order) to solve this issue.

Chinmoy

On Wed, Jul 29, 2009 at 8:06 PM, Axis PC  wrote:

> Chinmoy,
>
> When an exception occurs on the server end...and if you know the kind of
> exception...try wrapping it as a fault. In most cases it has worked for me
> as expected.
>
> Preetham
>
>
> On Wed, Jul 29, 2009 at 9:14 AM, Chinmoy Chakraborty wrote:
>
>> Hi All,
>>
>> I am using rampart 1.4 and Axis2 1.4. I have parameterbased ws-security
>> enabled services. In normal cases when there is no error at the time of
>> invocation (invocation of business logic) of the service, it works fine.
>> Following is the SOAP is returned by axis2 (captured in TCPMon):
>>
>> *Good One*
>> --
>> HTTP/1.1 200 OK
>> Content-Type: text/xml;charset=UTF-8
>> Transfer-Encoding: chunked
>> Date: Wed, 29 Jul 2009 12:56:25 GMT
>> Server: Apache-Coyote/1.1
>>
>> 
>> http://schemas.xmlsoap.org/soap/envelope/";>
>>  
>>   http://www.abc.com/webservice";>
>>   5.5
>>   
>>  
>> 
>>
>>
>> So far so good. Now when some error happens at the time of service
>> invocation it does not return SOAP fault back. I got following things
>> (captured in TCPMon):
>>
>> Bad One
>> --
>> HTTP/1.1 500 Internal Server Error
>> Content-Type: text/html;charset=UTF-8
>> Content-Language: en-US
>> Content-Length: 980
>> Date: Wed, 29 Jul 2009 12:58:29 GMT
>> Server: Apache-Coyote/1.1
>> Connection: close
>>
>> Apache Tomcat/5.0.19 - Error
>> report
>> HTTP Status 500 - type
>> Status reportmessage description The
>> server encountered an internal error () that prevented it from fulfilling
>> this request.Apache
>> Tomcat/5.0.19
>>
>> I have no clue what went wrong. Am I missing something? Do I need to
>> configure anything in services.xml (inside inflowsecurity)/axis2.xml? or is
>> this a bug?
>>
>> Chinmoy
>>
>>
>
>