Re: Regarding validating SOAP responses against the WSDL

2009-05-07 Thread Sneha Nikum
Hi,

I am yet stuck at the same problem.

I have a WSDL file and I want to validate the incoming SOAP response message
against this WSDL file on the fly.

I am using Axis 1.4.

Please do help me with some inputs as to how I can get this done.

Thanks and Regards,
Sneha

2009/3/17 Håkon Sagehaug 

> hi
>
> not sure how your setup is, do you know the wsdl to validate messages from
> in advance, or should it happen on the fly with possible unknown WSDL's?
>
> I'll give it a try if you know the WSDL's. If you are generating the client
> code from the wsdl and using the xmlbeans binding, the one I know best, the
> classes are generated from the schema in you wsdl and these will comply to
> the schema. A thread on this topic is here [1], can be outdated since it's
> from 07. Could also just complie using xmlbeans lib the XML schema into java
> files and tro to parse the request into the correct object.
>
> Hope it helped
>
> cheers, Håkon
>
> [1]
>
> http://mail-archives.apache.org/mod_mbox/ws-axis-dev/200708.mbox/%3c1591849069.172751187664742011.javamail.corem...@bj163app121.163.com%3e
>
> 2009/3/17 Sneha Nikum 
>
> Hi All,
>>
>> I am stuck up at this place.
>>
>> Please please do help me with this problem. Please do reply with the
>> solutions to the query
>>
>> Thanks
>> Sneha
>>
>>
>> On Mon, Mar 16, 2009 at 2:42 PM, Sneha Nikum wrote:
>>
>>> Hi,
>>>
>>> I want to validate the SOAP response structure against the structure of
>>> that response in the WSDL file.
>>>
>>> Are there any Axis APIs that would help me in achieving this task?
>>>
>>> Please let me know if there are any APIs that would help me do the above
>>> task
>>>
>>>
>>
>
>
> --
> Håkon Sagehaug, Scientific Programmer
> Parallab, Bergen Center for Computational Science (BCCS)
> UNIFOB AS (University of Bergen Research Company)
>



-- 
Sneha Anil Nikum
Don't get even with people
get AHEAD of them!


Re: Handling Large data in a method call

2009-05-07 Thread Sudhir Mongia
Hi Amila,
We are using Axis21.4.1 and it doesn't seems to support Complex type and
extensions.  I have not tried on Jibx yet.

Sudhir


On Thu, May 7, 2009 at 1:07 PM, Amila Suriarachchi <
amilasuriarach...@gmail.com> wrote:

>
>
> On Wed, May 6, 2009 at 10:12 AM, Sudhir Mongia wrote:
>
>> Hi Dennis,
>> We are not using WS-Security. Still its paining us.
>>
>> The problem we are facing is memory consumption while  serialization.
>>
>> We are using xmlbeans databinding, we couldn't go for ADB as it doesn't
>> supports Complex type extension and restrictions and we have not evaluated
>> other binding options as of now.
>>
>
> What is the Axis2 version you use? ADB supports Complex type extension and
> restrictions.  But again there is a possibility it won't support for all
> variations.
>
> Generally Xmlbeans slower than other data bindings. so you can try jibx and
> jaxbri as well.
>
> thanks,
> Amila.
>
>
>> Thanks,
>> Sudhir
>>
>>
>> On Wed, May 6, 2009 at 3:01 AM, Dennis Sosnoski  wrote:
>>
>>> Hi Sudhir,
>>>
>>> Are you using WS-Security for the service? WS-Security builds an
>>> in-memory model of the XML if you're using signatures (and perhaps at other
>>> times - I haven't checked, but there appeared to be some issues in this
>>> area).
>>>
>>> If you're not using WS-Security this type of data should not be causing
>>> problems. What data binding approach are you using? (ADB, XMLBeans, JiBX,
>>> JAXB?)
>>>
>>>  - Dennis
>>>
>>> --
>>> Dennis M. Sosnoski
>>> SOA and Web Services in Java
>>> Axis2 Training and Consulting
>>> http://www.sosnoski.com - http://www.sosnoski.co.nz
>>> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>>>
>>>
>>> Sudhir Mongia wrote:
>>>
 Hi,

 Has anyone got any experience in this type of problem ? One possible
 solution we used temporarily is, pass data fragment in in a call and do
 multiple calls to send the complete data.But we are reluctant to go with
 this approach in production.

 Any help/pointer ?

 Thanks,
 Sudhir

 On Mon, May 4, 2009 at 2:23 PM, Sudhir Mongia 
 >>> sudhir.mon...@gmail.com>> wrote:

Hi,

We have a web method exposed by .net app and we using client stubs
generated through Axis2. This method accepts an array of objects.
The object is very heavy object containing 25+ members variables
of double and string type.
The calls to this method fails sometimes due to memory when we are
trying to send large number of objects e.g. 10-20.

Any suggestions/idea , how can we compress the size of data to fix
this problem? We have control up to some extent on server side as
well.

Thanks,
Sudhir



>>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>


Re: Streaming large XML documents

2009-05-07 Thread Dennis Sosnoski

Hi Frederick,

Unless you have some very special needs, you probably want to be using 
data binding rather than going through AXIOM directly. Using data 
binding is both easier from the programming standpoint, and more 
efficient in that AXIOM is relatively slow to construct and uses a lot 
of memory.


JiBX binding allows you to work with an existing object model, which 
sounds like it'd be useful in your case (see 
http://jibx.sourceforge.net/fromcode/index.html for some starting 
information). You might also be able to do this using JAXB. Either of 
these will also work outside of Axis2, for use when serializing data 
directly from client.


Hope that helps,

 - Dennis

--
Dennis M. Sosnoski
SOA and Web Services in Java
Axis2 Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



Frederick G. Burkley wrote:

I want to check my understanding of the technique to stream large XML
instance documents without building the document in memory.  It is
implied, I believe, that the data that is to be serialized as a XML
instance document will first exist in the file system, a database,
perhaps a domain specific object model, etc.

No doubt this has been discussed many times, I found this thread that
covers the basics of the topic:
http://marc.info/?l=axis-user&m=117393850127293&w=2

1) Create an OMDataSource, either by implementing the
org.apache.axiom.om.OMDataSource interface directly or using a
convenience class such as org.apache.axiom.om.ds.ByteArrayDataSource.

In my case, my "backing object" is a domain specific object model.  It
is up to me to ensure that the OMDataSource of my choosing is properly
backed by my object model.  In this case, then, I must write code to
"stringify" the state of my object model so it can be passed to the
ByteArrayDataSource constructor as an array of bytes (i.e. byte[]).

Question: Is my basic understanding of the OMDataSource interface correct?


2) In my work, I'm using Axiom and Axis2 in two different use cases:
*) Streaming XML from an Axis2 Web Service to a client
*) Serializing XML directly from a client side application to disk.

In both cases, the data is the domain specific object model as mentioned.

Interestingly, the "intent" of the use of OMDataSource seems quite
different when used server side vice client side.  (Client side use
simply means using Axiom to create an OMElement and serialize it's
state to disk).

On the server, an OMElement is created (backed by the OMDataSource)
and passed off to Axis2 infrastructure and handled accordingly.

When serializing XML directly from the client, the use of OMDataSource
(and associated OMElement) does not really seem to buy me much.  In
other words, most of the work that goes into "populating" the
OMDataSource implementing class (such as ByteArrayDataSource) or
creating an implementation of my own will be in "stringifying" my
object model.

By the time I get that code written, I can just as well do something like:

String xml = objectModel.toXmlString()

and write that XML to disk.  It might make sense if I'm already using
Axiom heavily in my client application, but in and of itself most of
the work seems to be in "stringifying" my object model.

My point: I welcome any observations or clarifications on my thoughts.
I'm fairly new to Axiom and Axis2 so there may be many subtleties or
features I'm not aware of.


3) I'm including my test code.  I create a simple object model and then:
*) "Stringify" it directly to disk
*) Create an OMElement backed by a ByteArrayDataSource, then serialize the
   OMElement to disk.
Note that I don't create an OMSourcedElementImpl.  It seems to work simply by:
OMElement aElement = factory.createOMElement(omDataSource, "A", namespace)


4) I'm using Axiom 1.2.8.


V/r


--
public class Driver {

public A createObjectModel() {
A a = new A();
B b = new B();
C c = new C();

c.setCProp("c1");
b.addC(c);
b.setBProp("b1");
c = new C();
c.setCProp("c2");
b.addC(c);
a.addFie(b);

b = new B();
c = new C();
c.setCProp("c3");
b.addC(c);
b.setBProp("b2");
a.addFie(b);

return a;
}

private String serializeAsString(A a) {
StringBuilder xml = new StringBuilder();
if (null != a) {
xml.append("");
xml.append("\n");
xml.append("");
for (B b : a.getBList()) {
xml.append("\n  ");
xml.append("");
if (null != b.getBProp()) {
xml.append("\n");
xml.append("
").append(b.getBProp()).append("");
}
for (C c : b.getCList()) {
xml.append("\n");
xml.append("");
if (null != c.getCProp()) {
   

Streaming large XML documents

2009-05-07 Thread Frederick G. Burkley
I want to check my understanding of the technique to stream large XML
instance documents without building the document in memory.  It is
implied, I believe, that the data that is to be serialized as a XML
instance document will first exist in the file system, a database,
perhaps a domain specific object model, etc.

No doubt this has been discussed many times, I found this thread that
covers the basics of the topic:
http://marc.info/?l=axis-user&m=117393850127293&w=2

1) Create an OMDataSource, either by implementing the
org.apache.axiom.om.OMDataSource interface directly or using a
convenience class such as org.apache.axiom.om.ds.ByteArrayDataSource.

In my case, my "backing object" is a domain specific object model.  It
is up to me to ensure that the OMDataSource of my choosing is properly
backed by my object model.  In this case, then, I must write code to
"stringify" the state of my object model so it can be passed to the
ByteArrayDataSource constructor as an array of bytes (i.e. byte[]).

Question: Is my basic understanding of the OMDataSource interface correct?


2) In my work, I'm using Axiom and Axis2 in two different use cases:
*) Streaming XML from an Axis2 Web Service to a client
*) Serializing XML directly from a client side application to disk.

In both cases, the data is the domain specific object model as mentioned.

Interestingly, the "intent" of the use of OMDataSource seems quite
different when used server side vice client side.  (Client side use
simply means using Axiom to create an OMElement and serialize it's
state to disk).

On the server, an OMElement is created (backed by the OMDataSource)
and passed off to Axis2 infrastructure and handled accordingly.

When serializing XML directly from the client, the use of OMDataSource
(and associated OMElement) does not really seem to buy me much.  In
other words, most of the work that goes into "populating" the
OMDataSource implementing class (such as ByteArrayDataSource) or
creating an implementation of my own will be in "stringifying" my
object model.

By the time I get that code written, I can just as well do something like:

String xml = objectModel.toXmlString()

and write that XML to disk.  It might make sense if I'm already using
Axiom heavily in my client application, but in and of itself most of
the work seems to be in "stringifying" my object model.

My point: I welcome any observations or clarifications on my thoughts.
I'm fairly new to Axiom and Axis2 so there may be many subtleties or
features I'm not aware of.


3) I'm including my test code.  I create a simple object model and then:
*) "Stringify" it directly to disk
*) Create an OMElement backed by a ByteArrayDataSource, then serialize the
   OMElement to disk.
Note that I don't create an OMSourcedElementImpl.  It seems to work simply by:
OMElement aElement = factory.createOMElement(omDataSource, "A", namespace)


4) I'm using Axiom 1.2.8.


V/r


--
public class Driver {

    public A createObjectModel() {
    A a = new A();
    B b = new B();
    C c = new C();

    c.setCProp("c1");
    b.addC(c);
    b.setBProp("b1");
    c = new C();
    c.setCProp("c2");
    b.addC(c);
    a.addFie(b);

    b = new B();
    c = new C();
    c.setCProp("c3");
    b.addC(c);
    b.setBProp("b2");
    a.addFie(b);

    return a;
    }

    private String serializeAsString(A a) {
    StringBuilder xml = new StringBuilder();
    if (null != a) {
    xml.append("");
    xml.append("\n");
    xml.append("");
    for (B b : a.getBList()) {
    xml.append("\n  ");
    xml.append("");
    if (null != b.getBProp()) {
    xml.append("\n");
    xml.append("
").append(b.getBProp()).append("");
    }
    for (C c : b.getCList()) {
    xml.append("\n    ");
    xml.append("");
    if (null != c.getCProp()) {
    xml.append("\n");
    xml.append("
").append(c.getCProp()).append("");
    }
    xml.append("\n    ");
    xml.append("");
    }
    xml.append("\n  ");
    xml.append("");
    }
    xml.append("\n");
    xml.append("");
    }
    return xml.toString();
    }

    private void serializeAsDataSource(A a) throws XMLStreamException {
    String xml = this.serializeAsString(a);
    OMDataSource source = new ByteArrayDataSource(xml.getBytes(), "UTF-8");
    OMFactory factory = OMAbstractFactory.getOMFactory();
    OMNamespace ns = factory.createOMNamespace("www.example.org", "ex");
    OMElement aElement = factory.createOMElement(source, "A", ns);
    aElement.getBuilder().setCache(false);
    StringWriter writer = new

Re: Missing value in return from autogenerated Jira SOAP service

2009-05-07 Thread mr_greedy

I had a similar-sounding problem where axis2 was invoking my web service
method, but the request object being passed in wasn't initialised (all the
getters returned null).  It turned out that axis2 was trying to match up the
elements within the request, with the request (i.e. a level out), and to fix
this I needed to add the following to the class:
@SOAPBinding(parameterStyle=ParameterStyle.BARE)

-- 
View this message in context: 
http://www.nabble.com/Missing-value-in-return-from-autogenerated-Jira-SOAP-service-tp21807302p23436823.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: Help Axis don't work under https - First Element must contain the local name, Envelope , but found html

2009-05-07 Thread Cesar de Almeida Correia

Hi,

I had convert my cert to pkcs12 and imported in Firefox. Calling the web
service method via Firefox, using a web http call, all works fine. I had
enable the Tomcat acces log valve. He told me that all POSTS and GET to
call with Firefox. With my client only one POST is showed. I guess that my
client has some misconfiguration. Well, I builded my client under http
enviroment. Actually, should I have to build it under https?

Thanks in advance.








   
   
   
   Re: Help Axis don't work under https - First Element must contain the
   local name, Envelope , but found html   
   
   
   Andreas Veithen 
   para:   
   axis-user   
   07/05/2009 16:15
   
   
  Responda a axis-user 
   
   
   






The error message tells you that the root element of the returned
document is . In general this means an error page. So you have
to investigate on the server side.

Andreas

On Thu, May 7, 2009 at 20:20, Cesar de Almeida Correia
 wrote:
> Hello all,
>
> I have some services under apache axis. It work fine under http, but with
> https fail. Finished certs configuration in service and client, I am
getting
> the folowing error. Is missing some exta configuration to use https?
>
> Thanks in advance.
>
> INFO org.apache.axis2.builder.BuilderUtil - OMException in getSOAPBuilder
> org.apache.axiom.soap.SOAPProcessingException: First Element must contain
> the local name, Envelope , but found html
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode
(StAXSOAPModelBuilder.java:251)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement
(StAXSOAPModelBuilder.java:209)
> at
>
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement
(StAXSOAPModelBuilder.java:191)
> at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next
(StAXOMBuilder.java:172)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope
(StAXSOAPModelBuilder.java:156)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.
(StAXSOAPModelBuilder.java:105)
> at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder
(BuilderUtil.java:677)
> at
> org.apache.axis2.transport.TransportUtils.createDocumentElement
(TransportUtils.java:182)
> at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage
(TransportUtils.java:112)
> at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage
(TransportUtils.java:88)
> at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse
(OutInAxisOperation.java:353)
> at
> org.apache.axis2.description.OutInAxisOperationClient.send
(OutInAxisOperation.java:416)
> at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl
(OutInAxisOperation.java:228)
> at org.apache.axis2.client.OperationClient.execute
(OperationClient.java:163)
> at
> br.ufmg.lcc.pcollecta.ws.client.PCollectaServiceStub.getRequestItemStatus
(PCollectaServiceStub.java:2010)
> at
>
br.ufmg.lcc.pcollecta.ws.client.PCollectaWebServiceClient.getRequestItemStatus
(PCollectaWebServiceClient.java:266)
> at
> br.ufmg.lcc.pcollecta.model.data.PCollectaWSDAO.getRequestItemStatus
(PCollectaWSDAO.java:246)
> at
> br.ufmg.lcc.pcollecta.model.EtlProcessBO.waitForHarvestItemApproval
(EtlProcessBO.java:640)
> at
> br.ufmg.lcc.pcollecta.model.EtlProcessBO.prepareToRun
(EtlProcessBO.java:513)
> at br.ufmg.lcc.pcollecta.model.EtlProcessBO.processEtl
(EtlProcessBO.java:91)
> at
> br.ufmg.lcc.pcollecta.model.ImportProcessBO.doTransferProcess
(ImportProcessBO.java:866)
> at
> br.ufmg.lcc.pcollecta.model.ImportProcessBO.runEtls
(ImportProcessBO.java:425)
> at
> br.ufmg.lcc.pcollecta.model.ImportProcessBO.runProcessScheduled
(ImportProcessBO.java:210)
> at
> br.ufmg.lcc.pcollecta.model.PcollectaFacade.runProcessScheduled
(PcollectaFacade.java:58)
> at
> br.ufmg.lcc.pcollecta.controller.ScheduleAgentController$ScheduleThread
$1.run(ScheduleAgentController.java:878)
>
<><><>

Does Axis2-xmlbeans data binding support Unwrapping in Doc/Lit mode

2009-05-07 Thread John Eapen
We know that unwrapping works fine with adb but does anyone know if this is
officially supported with xmlbeans.

Thanks
  John


RE: [Axis2] Null array

2009-05-07 Thread Martin Gainty

for non-ADB databinding use minOccurs="0" e.g.


Martin 
__ 
Disclaimer and Confidentiality/Verzicht und Vertraulichkeitanmerkung/Note de 
déni et de confidentialité
This message is confidential. If you should not be the intended receiver, then 
we ask politely to report. Each unauthorized forwarding or manufacturing of a 
copy is inadmissible. This message serves only for the exchange of information 
and has no legal binding effect. Due to the easy manipulation of emails we 
cannot take responsibility over the the contents.
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger 
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung 
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem 
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. 
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung 
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le 
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez 
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est 
interdite. Ce message sert à l'information seulement et n'aura pas n'importe 
quel effet légalement obligatoire. Étant donné que les email peuvent facilement 
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité 
pour le contenu fourni.




Subject: [Axis2] Null array
Date: Thu, 7 May 2009 11:34:58 -0700
From: sow...@telenav.com
To: axis-user@ws.apache.org
















I have a nillable object array in my schema. If I set this
to NULL in my service code, the client is getting an array with size 1, and the
element at index 0 is NULL. Is this the expected behavior? Shouldn’t the
array itself be set to NULL?

 

- Sowmi

 

Sowmitra Thallapragada |
TeleNav Inc. | +1 408 207 4116 | sow...@telenav.com | www.telenav.com

 


_
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=TXT_TAGLM_BR_life_in_synch_052009

Re: Help Axis don't work under https - First Element must contain the local name, Envelope , but found html

2009-05-07 Thread Andreas Veithen
The error message tells you that the root element of the returned
document is . In general this means an error page. So you have
to investigate on the server side.

Andreas

On Thu, May 7, 2009 at 20:20, Cesar de Almeida Correia
 wrote:
> Hello all,
>
> I have some services under apache axis. It work fine under http, but with
> https fail. Finished certs configuration in service and client, I am getting
> the folowing error. Is missing some exta configuration to use https?
>
> Thanks in advance.
>
> INFO org.apache.axis2.builder.BuilderUtil - OMException in getSOAPBuilder
> org.apache.axiom.soap.SOAPProcessingException: First Element must contain
> the local name, Envelope , but found html
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(StAXSOAPModelBuilder.java:251)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(StAXSOAPModelBuilder.java:209)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement(StAXSOAPModelBuilder.java:191)
> at
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:172)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:156)
> at
> org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(StAXSOAPModelBuilder.java:105)
> at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:677)
> at
> org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:182)
> at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:112)
> at
> org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:88)
> at
> org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:353)
> at
> org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
> at
> org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
> at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
> at
> br.ufmg.lcc.pcollecta.ws.client.PCollectaServiceStub.getRequestItemStatus(PCollectaServiceStub.java:2010)
> at
> br.ufmg.lcc.pcollecta.ws.client.PCollectaWebServiceClient.getRequestItemStatus(PCollectaWebServiceClient.java:266)
> at
> br.ufmg.lcc.pcollecta.model.data.PCollectaWSDAO.getRequestItemStatus(PCollectaWSDAO.java:246)
> at
> br.ufmg.lcc.pcollecta.model.EtlProcessBO.waitForHarvestItemApproval(EtlProcessBO.java:640)
> at
> br.ufmg.lcc.pcollecta.model.EtlProcessBO.prepareToRun(EtlProcessBO.java:513)
> at br.ufmg.lcc.pcollecta.model.EtlProcessBO.processEtl(EtlProcessBO.java:91)
> at
> br.ufmg.lcc.pcollecta.model.ImportProcessBO.doTransferProcess(ImportProcessBO.java:866)
> at
> br.ufmg.lcc.pcollecta.model.ImportProcessBO.runEtls(ImportProcessBO.java:425)
> at
> br.ufmg.lcc.pcollecta.model.ImportProcessBO.runProcessScheduled(ImportProcessBO.java:210)
> at
> br.ufmg.lcc.pcollecta.model.PcollectaFacade.runProcessScheduled(PcollectaFacade.java:58)
> at
> br.ufmg.lcc.pcollecta.controller.ScheduleAgentController$ScheduleThread$1.run(ScheduleAgentController.java:878)
>


RE: https client - defining the keystore path

2009-05-07 Thread Sanjay Gupta
Hi Nuno,
If the server has a CA issued cert then you don't need anything. In case of 
self signed cert I add the following two line and it works for me. I usually 
don't import my self-signed cert to the java cacerts. 


System.setProperty("javax.net.ssl.trustStore", 
"C:/cts/axis2/client/resources/server.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "**");

Hope this helps.

Thanks
Sanjay


-Original Message-
From: Nuno Feliciano [mailto:nuno.felici...@novabase.pt] 
Sent: Thursday, May 07, 2009 10:08 AM
To: axis-user@ws.apache.org
Subject: https client - defining the keystore path

Hi,

I'm trying to use an axis client to consume an https webservice.
I set the following properties

System.setProperty("axis.socketSecureFactory", 
"org.apache.axis.components.net.SunJSSESocketFactory");
System.setProperty("javax.net.ssl.keyStore", "C:\\Program 
Files\\Java\\jdk1.5.0_14\\.keystore");
System.setProperty("javax.net.ssl.passwordStore", "");  
System.setProperty("javax.net.ssl.trustStore", "C:\\Program 
Files\\Java\\jdk1.5.0_14\\jre\\lib\\security\\cacerts");


But axis complains because it can't find the keystore file in my user.home

java.io.FileNotFoundException: D:\Documents and Settings\\.keystore (The 
system cannot find the file specified)


I thought the purpose of setting the "javax.net.ssl.keyStore" property was to 
tell axis not to look in the default place for the keystore, so why is it 
looking in my user.home folder, and how can I change that?


Re: java.lang.reflect.InvocationTargetException occurred when using Configure.getString()

2009-05-07 Thread Norio Sasagawa
Sorry.
Test Client is not correct.
The correct is as follows.

-< TestClient>-
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import org.apache.axis.utils.Options;

import javax.xml.namespace.QName;
import javax.xml.rpc.ParameterMode;

public class Test5Client
{
   public static void main(String [] args) throws Exception {
   Options options = new Options(args);
   
   String endpoint = "http://localhost:"; + options.getPort() +
 "/axis/TestTest5.jws";
   
   args = options.getRemainingArgs();
   
   if (args == null || args.length > 2) {
   System.err.println("Usage: Tes5tClient 
 arg1-1 ");
   return;
   }
   
   String method = args[0];
   if (!(method.equals("TestTestShowName") || 
method.equals("TestTestEchoName"))) {
   System.err.println("Usage: Test5Client 
 arg1-2 ");
   return;
   }
   
   String sTring = new String(args[1]);

   Service  service = new Service();
   Call call= (Call) service.createCall();

   call.setTargetEndpointAddress( new java.net.URL(endpoint) );
   call.setOperationName( new QName( endpoint, method ));
   call.addParameter( "in0", XMLType.XSD_STRING, ParameterMode.IN );
   call.setReturnType( XMLType.XSD_STRING );

   System.err.println("endpoint:" + endpoint);
   System.err.println("method  :" + method);
   System.err.println("sTring  :" + sTring);

   String ret = (String) call.invoke( new Object [] { sTring,  });
   System.out.println("Name : " + ret);
   }
}


- Original Message -
Date: Fri, 08 May 2009 03:28:30 +0900
To: axis-...@ws.apache.org, axis-user@ws.apache.org
Cc: n-sasag...@ka2.so-net.ne.jp
Subject: java.lang.reflect.InvocationTargetException occurred when using 
Configure.getString()
From: Norio Sasagawa 

Dear all,

Please help me!
I'm using axis 1.4 and Tomcat 6.0.
When I making Configure.class with getString() method, the following error 
occurred.
What is wrong?
I can not catch the Exception.
So, I'm not sure which Exception was thrown out.
And I can not get the getCause().
When using eclipse, F5 key did not call on Configure.getString().
Another case, TestTestEchoName works fine.
Any advice will help me.

Thanks in advance.

-< Stack Trace >-
D:\_Axis\axis-bin-1_4\axis-1_4>java Test5Client TestTestShowName Me
endpoint:http://localhost:8080/axis/TestTest5.jws
method  :TestTestShowName
sTring  :Me
Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.reflect.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
{http://xml.apache.org/axis/}hostname:FM-B05870457267

java.lang.reflect.InvocationTargetException
at 
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at 
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at 
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement
(XMLDocumentFragmentScannerImpl.java:1774)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next
(XMLDocumentFragmentScannerImpl.java:2930)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at 
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(XMLDocumentFragmentScannerImpl.java:510)
at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at 
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at 
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine

[Axis2] Null array

2009-05-07 Thread Thallapragada, Sowmi
I have a nillable object array in my schema. If I set this to NULL in my
service code, the client is getting an array with size 1, and the
element at index 0 is NULL. Is this the expected behavior? Shouldn't the
array itself be set to NULL?

 

- Sowmi

 

Sowmitra Thallapragada | TeleNav Inc. | +1 408 207 4116 |
sow...@telenav.com | www.telenav.com

 



java.lang.reflect.InvocationTargetException occurred when using Configure.getString()

2009-05-07 Thread Norio Sasagawa
Dear all,

Please help me!
I'm using axis 1.4 and Tomcat 6.0.
When I making Configure.class with getString() method, the following error 
occurred.
What is wrong?
I can not catch the Exception.
So, I'm not sure which Exception was thrown out.
And I can not get the getCause().
When using eclipse, F5 key did not call on Configure.getString().
Another case, TestTestEchoName works fine.
Any advice will help me.

Thanks in advance.

-< Stack Trace >-
D:\_Axis\axis-bin-1_4\axis-1_4>java Test5Client TestTestShowName Me
endpoint:http://localhost:8080/axis/TestTest5.jws
method  :TestTestShowName
sTring  :Me
Exception in thread "main" AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: java.lang.reflect.InvocationTargetException
 faultActor:
 faultNode:
 faultDetail:
{http://xml.apache.org/axis/}hostname:FM-B05870457267

java.lang.reflect.InvocationTargetException
at 
org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
at 
org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
at 
org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement
(XMLDocumentFragmentScannerImpl.java:1774)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next
(XMLDocumentFragmentScannerImpl.java:2930)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at 
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at 
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument
(XMLDocumentFragmentScannerImpl.java:510)
at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:807)
at 
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at 
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at 
com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at 
com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
at 
org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
at 
org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at Test5Client.main(Test5Client.java:44)

-<.jws>-
public class TestTest5 {
private static String workName = "TestTest5";
public static String getString(){
return workName;
}
public String TestTestShowName(String inputString) {
  String workString = Configure.getString();
  return("Norio Sasagawa" + workString);
}
public String TestTestEchoName(String inputString) {
  String workString = TestTest5.getString();
  return(inputString + workString);
}

-< Configure.java >-
public class Configure {
private static String workName = "Configure";
public static String getString(){
return workName;
}
}

-< TestClient >-
public class TestTest5 {
private static String workName = "TestTest5";
public static String getString(){
return workName;
}
public String TestTestShowName(String inputString) {
  String workString = Configure.getString();
  return("Norio Sasagawa" + workString);
}
public String TestTestEchoName(String inputString) {
  String workString = TestTest5.getString();
  return(inputString + workString);
}
}

-< http://localhost:8080/axis/TestTest5.jws?wsdl Result >-
   
  http://localhost:8080/axis/TestTest5.jws"; 
xmlns:apachesoap="http://xml.apache.org/xml-soap"; 
xmlns:impl="http://localhost:8080/axis/TestTest5.jws"; 
xmlns:intf="http://localhost:8080/axis/TestTest5.jws"; 
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema

Help Axis don't work under https - First Element must contain the local name, Envelope , but found html

2009-05-07 Thread Cesar de Almeida Correia
Hello all,

I have some services under apache axis. It work fine under http, but with
https fail. Finished certs configuration in service and client, I am
getting the folowing error. Is missing some exta configuration to use
https?

Thanks in advance.

INFO org.apache.axis2.builder.BuilderUtil - OMException in getSOAPBuilder
org.apache.axiom.soap.SOAPProcessingException: First Element must contain
the local name, Envelope , but found html
  at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.constructNode(
StAXSOAPModelBuilder.java:251)
  at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createOMElement(
StAXSOAPModelBuilder.java:209)
  at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.createNextOMElement
(StAXSOAPModelBuilder.java:191)
  at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(
StAXOMBuilder.java:172)
  at
org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(
StAXSOAPModelBuilder.java:156)
  at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.(
StAXSOAPModelBuilder.java:105)
  at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(
BuilderUtil.java:677.)
  at org.apache.axis2.transport.TransportUtils.createDocumentElement(
TransportUtils.java:182)
  at org.apache.axis2.transport.TransportUtils.createSOAPMessage(
TransportUtils.java:112)
  at org.apache.axis2.transport.TransportUtils.createSOAPMessage(
TransportUtils.java:88)
  at
org.apache.axis2.description.OutInAxisOperationClient.handleResponse(
OutInAxisOperation.java:353)
  at org.apache.axis2.description.OutInAxisOperationClient.send(
OutInAxisOperation.java:416)
  at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(
OutInAxisOperation.java:228)
  at org.apache.axis2.client.OperationClient.execute(
OperationClient.java:163)
  at
br.ufmg.lcc.pcollecta.ws.client.PCollectaServiceStub.getRequestItemStatus(
PCollectaServiceStub.java:2010)
  at
br.ufmg.lcc.pcollecta.ws.client.PCollectaWebServiceClient.getRequestItemStatus
(
PCollectaWebServiceClient.java:266)
  at
br.ufmg.lcc.pcollecta.model.data.PCollectaWSDAO.getRequestItemStatus(
PCollectaWSDAO.java:246)
  at
br.ufmg.lcc.pcollecta.model.EtlProcessBO.waitForHarvestItemApproval(
EtlProcessBO.java:640)
  at br.ufmg.lcc.pcollecta.model.EtlProcessBO.prepareToRun(
EtlProcessBO.java:513)
  at br.ufmg.lcc.pcollecta.model.EtlProcessBO.processEtl(
EtlProcessBO.java:91)
  at br.ufmg.lcc.pcollecta.model.ImportProcessBO.doTransferProcess(
ImportProcessBO.java:866)
  at br.ufmg.lcc.pcollecta.model.ImportProcessBO.runEtls(
ImportProcessBO.java:425)
  at br.ufmg.lcc.pcollecta.model.ImportProcessBO.runProcessScheduled(
ImportProcessBO.java:210)
  at br.ufmg.lcc.pcollecta.model.PcollectaFacade.runProcessScheduled(
PcollectaFacade.java:58)
  at br.ufmg.lcc.pcollecta.controller.ScheduleAgentController
$ScheduleThread$1.run(ScheduleAgentController.java:878)

https client - defining the keystore path

2009-05-07 Thread Nuno Feliciano
Hi,

I’m trying to use an axis client to consume an https webservice.
I set the following properties

System.setProperty("axis.socketSecureFactory", 
"org.apache.axis.components.net.SunJSSESocketFactory");
System.setProperty("javax.net.ssl.keyStore", "C:\\Program 
Files\\Java\\jdk1.5.0_14\\.keystore");
System.setProperty("javax.net.ssl.passwordStore", "");  
System.setProperty("javax.net.ssl.trustStore", "C:\\Program 
Files\\Java\\jdk1.5.0_14\\jre\\lib\\security\\cacerts");


But axis complains because it can’t find the keystore file in my user.home

java.io.FileNotFoundException: D:\Documents and Settings\\.keystore (The 
system cannot find the file specified)


I thought the purpose of setting the "javax.net.ssl.keyStore" property was to 
tell axis not to look in the default place for the keystore, so why is it 
looking in my user.home folder, and how can I change that?

Re: MTOM works only with base64 or it supports other types as well ?

2009-05-07 Thread Andreas Veithen
Sudhir,

The XOP specification (on which MTOM is based) indeed explicitly
restricts the scope to base64Binary items.

Andreas

On Thu, May 7, 2009 at 16:32, Sudhir Mongia  wrote:
> Hi,
> Just needed confirmation from the experts.
> I was reading through internet that MTOM is supported for the elements
> defined as base64Binary in the wsdl. Is this true ? Can't we use MTOM to
> transfer objects of any type other then base64Binary?
> Thanks,
> Sudhir
>
>
>


Re: Queries regarding session managment in axsi2

2009-05-07 Thread Deepal Jayasinghe

> Hi All,
>  
> I am facing some problem in implementing session management while
> using axis2. It will be great if anyone can help me out with few queries.
>
> My Scenario: The scenario which I am trying to implement is very
> simple one. Basically I have a service implementation class which has
> a Login and couple of business methods. Now from a client when I call
> Login method of the service I  pass user name and password. At the
> server my service class authenticate the user and sends response back
> to client with the session id. I am trying to implement transport
> session so at client I am able to see session using this code snippet :
>
I understand what you are trying to do, but it is not something you can
do easily without changing the source code. But I think what you should
do is store the status of the client login in the servicecontext and
check the validity when he try to invoke the business methods. If you do
so, then you do not need to worry about the type of the session Id you
sent to the client.

Deepal
>
>  
>



MTOM works only with base64 or it supports other types as well ?

2009-05-07 Thread Sudhir Mongia
Hi,
Just needed confirmation from the experts.

I was reading through internet that MTOM is supported for the elements
defined as base64Binary in the wsdl. Is this true ? Can't we use MTOM to
transfer objects of any type other then base64Binary?

Thanks,
Sudhir


Queries regarding session managment in axsi2

2009-05-07 Thread amardeep singh khera
Hi All,

I am facing some problem in implementing session management while using
axis2. It will be great if anyone can help me out with few queries.

My Scenario: The scenario which I am trying to implement is very simple one.
Basically I have a service implementation class which has a Login and couple
of business methods. Now from a client when I call Login method of the
service I  pass user name and password. At the server my service class
authenticate the user and sends response back to client with the session id.
I am trying to implement transport session so at client I am able to see
session using this code snippet :



stub = *new* MyStub(*serviceUrl*);

client = stub._getServiceClient();

Options opt = client.getOptions();

opt.setTimeOutInMilliSeconds(60);

opt.setManageSession(*true*);

client.getServiceContext().getProperty(HTTPConstants.HEADER_COOKIE);



Sample value of session id:JSESSIONID=61F54A15234AD93EB70F63B05DC0A6C1;


This is all fine till here. Now if in the Login method the user
authentication fails the session id which the server should sent to the
client should be null , so that if the user tries to access my other
business methods he should not be able to do that. Basically I need a way to
control sessionId at the server only.
Right now i am trying to set sessionId to null using this code snippet:


MessageContext msgContext=MessageContext.*getCurrentMessageContext*();

SessionContext sessionContext=msgContext.getSessionContext();

sessionContext.setProperty(HTTPConstants.
*HEADER_COOKIE*,*null*);

msgContext.setSessionContext(sessionContext);

But at my client i am still getting the sesssionId as not-nCan you please
suggest a way of doing this.



Thanks in advance.

Amardeep Singh Khera


Remote endpoint

2009-05-07 Thread Massimiliano Masi

Hi

Is there a way for obtaining the remote endpoint (server and client side?)
In the server side I get the Addressing info by using

(in the Message Receiver: MessageContext inMessage, in the
invokeBusinessLogic)

EndpointReference from = inMessage.getFrom();

But I would like to compare it with the real (eg, httpclient) endpoint.

The same in the client side: I've the From: in the Header, but I
would like to compare it with the IP of the server that is
responding.


How to do it?


This message was sent using IMP, the Internet Messaging Program.




Re: Axis2 Performance Tips

2009-05-07 Thread ibrahim demir
Thanks Amila. Very helpful post.

I will try it and will share the performance incerease (if it happens) with 
this mail group

Yours.

 Ibrahim DEMIR
CyberSoft Yazilim Muh.
http://www.ibrahimdemir.org

 
   
 





From: Amila Suriarachchi 
To: axis-user@ws.apache.org
Sent: Thursday, May 7, 2009 11:21:40 AM
Subject: Re: Axis2 Performance Tips

this[1] may help you.

thanks,
Amila.


[1] 
http://amilachinthaka.blogspot.com/2009/05/improving-axis2-client-http-transport.html


On Wed, May 6, 2009 at 11:10 AM, ibrahim demir  wrote:

Hi David;

Thanks for the tips. That was what I really wanted to see here. Sharing these 
informations are much more valuable than referencing to the guides.

I am on the both side. I am serving some services and calling some .NET 
services also. But what I want to speed is the client side.

I will start searching over the internet for implementing your offers till you 
share some sample code :)


Yours.

 Ibrahim DEMIR
CyberSoft Yazilim Muh.
http://www.ibrahimdemir.org

 
   
 





From: David Rees 
To: axis-user@ws.apache.org
Sent: Tuesday, May 5, 2009 11:33:01 PM
Subject: Re: Axis2 Performance Tips


On Tue, May 5, 2009 at 1:29 AM, ibrahim demir  wrote:
> I woner if there is performance tips and tricks guide for Axis2. I have
> tried to optimize my sevice and tried to make it simpler in order to have
> fast response but I believe that is not enough.

Yes, there are a number of things you can do to speed up Axis2.
However, are you creating a web service or are you accessing a web
service?

I haven't focused on web service performance, as it seems to be pretty
good already, but if you are using axis2 as a client there are a
number of things you can do.

> So can you share your experiences or tips here on performance optimizations
> about Axis2. For example using the
> HTTPConstants.REUSE_HTTP_CLIENT
> HTTPConstants.CACHED_HTTP_CLIENT
>
> options has an effect on performance or not?

These options definitely make a difference in performance especially
if you are accessing services on a high latency network in rapid
succession.

Some of the things I do:

1. Use Commons-Pool to maintain a pool of Stubs.  Stub creation is expensive!
2. For each stub, set REUSE_HTTP_CLIENT to true and CACHED_HTTP_CLIENT
to your own cached HttpClient.
3. For each HttpClient, you will likely want to increase the
DefaultMaxConnections and MaxTotalConnections using your own
MultiThreadedHttpConnectionManager.  In addition, also make sure you
set the Version to HTTP_1_1 of your HttpClient, too.

IMO Axis2 should provide a framework for doing all of those things
easily by default.  Perhaps I will contribute some code when I get
some time to abstract it out. :-)

-Dave




-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/



  

Re: How to turn off stdout messages when using WSDL 2.0 ?

2009-05-07 Thread Deyan Popov
I just opened a JIRA bug for the Axis2 project:
https://issues.apache.org/jira/browse/AXIS2-4334.


Re: Custom module engagement in Axis2

2009-05-07 Thread Amila Suriarachchi
On Wed, May 6, 2009 at 12:52 AM, Makesh Rao  wrote:

> Hi
> We are planning to build a custom module in Axis2 that is required to get
> enabled in INOnly, INOUT & OutOnly patterns.
> We have a webservice that will use this implementation. I had some doubts
> on how Axis2 behaves in the OutOnly mode (or even OutIn).
>

At the server side axis2 handles the MEP (message exchange pattern at the
Message receiver level). So you handler can  be used in both cases without
any problem.

>
> The use case is that our service calls another client webservice and the
> request has to go through our cus
> tom module --> OutIn or OutOnly
> Similarly when any other service calls our service the request should go
> through the custom module again. -> InOut.
>
> 1. For OutOnly or OutIn, do we have to use the generated client
> implementation and engage the custom module in that ?
>

yes.

> 2. How will the response to that request be handled ? Will it come in
> through the "server" axis listener ?
>

This depends on the way you do the invocation. If you use a synchronous
(default mode) invocation response comes in the back channel. This is almost
same as you invoke it as a separate client.

this article[1] may help you.

thanks,
Amila.

[1] http://wso2.org/library/articles/extending-axis2

>
> Any help is appreciated..
>
> Thanks
> Makesh
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


Re: [Axis2] RuntimeException on timestamp = "" when timestamp minOccurs="0",

2009-05-07 Thread Dennis Sosnoski
Your server is generating invalid XML. minOccurs="0" means that the 
element can be left out of the XML document, but if the element is 
present the content must match the TimeStampType. The empty string does 
not match this type, even ignoring the regular expression part, because 
the type definition says the string must be exactly 14 characters in 
length (minLength==maxLength==14).


 - Dennis

--
Dennis M. Sosnoski
SOA and Web Services in Java
Axis2 Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117



ChunTung POON wrote:

An update about the case

Here is the Time Stamp Type
===
  

  
  
  

  
===
 
===

the response for the timestamp is



is it still valid?





2009/5/6 ChunTung POON
  

Hi All,

I am running my client on java 1.4 with axis2 1.4.1

I am able to send the server message. However, axis2 seems like cannot
construct the response from the soap message the server replied.

Following exception occurred when the client tried to construct the
response from the soap message.
It was caused the by axis2 cannot set the timestamp of the message.
When I look at the the soap xml. The Timestamp is

and when i check the schema of the response message.

Its minOccurs="0" is correct. So, is axis2 cannot handle timestamp
having minOccurs=0 ? or Did I do something wrong?


thanks,
Chun Tung

org.apache.axis2.AxisFault
   at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub.fromOM(SmsSendServiceStub.java:12211)
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub.SendSms(SmsSendServiceStub.java:209)
   at testM1wb.main(testM1wb.java:85)
Caused by: java.lang.RuntimeException
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub$TimeStampType.setTimeStampType(SmsSendServiceStub.java:7957)
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub$TimeStampType$Factory.parse(SmsSendServiceStub.java:8311)
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub$DestinationResponseType$Factory.parse(SmsSendServiceStub.java:11050)
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub$DestinationResponseListType$Factory.parse(SmsSendServiceStub.java:5132)
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub$SendSmsResponseType$Factory.parse(SmsSendServiceStub.java:5925)
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub$SendSmsResponseElement$Factory.parse(SmsSendServiceStub.java:7532)
   at 
.sdp.ws.sms.wsdl.send.SmsSendServiceStub.fromOM(SmsSendServiceStub.java:12191)
   ... 2 more
Exception in thread "main"



Here is the soap response

http://schemas.xmlsoap.org/soap/envelope/";>
   
   http:///sdp/ws/sms/wsdl/acm";
xmlns:ns2="http:///sdp/ws/sms/wsdl/header";
xmlns:ns3="http:///sdp/ws/sms/wsdl/application";
xmlns:ns4="http:///sdp/ws/sms/wsdl/send";
xmlns:ns5="http:///sdp/ws/sms/wsdl/common";
xmlns:ns6="http:///sdp/ws/sms/wsdl/error";>
   109050614180004
   4001
   System.
   
   
   
   
   
   
   
   
   




XSD


http://www.w3.org/2001/XMLSchema";
   xmlns:smscmn="http:///sdp/ws/sms/wsdl/common";
   xmlns:app="http:///sdp/ws/sms/wsdl/application";
   xmlns:tns="http:///sdp/ws/sms/wsdl/deliver";
targetNamespace="http:///sdp/ws/sms/wsdl/deliver";
elementFormDefault="qualified">
 http:///sdp/ws/sms/wsdl/application";
schemaLocation="Application-Definitions.xsd" />
 http:///sdp/ws/sms/wsdl/common";
schemaLocation="SMS-Common-Definitions.xsd"/>
 
   
 
   
 
 
   
 
 
 
 
   
 
 
   
 
 
   
 
 
   
 
 
 
 
 
   
 
 
 
 
 





  




Re: Axis2 Performance Tips

2009-05-07 Thread Amila Suriarachchi
this[1] may help you.

thanks,
Amila.


[1]
http://amilachinthaka.blogspot.com/2009/05/improving-axis2-client-http-transport.html

On Wed, May 6, 2009 at 11:10 AM, ibrahim demir wrote:

> Hi David;
>
> Thanks for the tips. That was what I really wanted to see here. Sharing
> these informations are much more valuable than referencing to the guides.
>
> I am on the both side. I am serving some services and calling some .NET
> services also. But what I want to speed is the client side.
>
> I will start searching over the internet for implementing your offers till
> you share some sample code :)
>
> Yours.
>
> Ibrahim DEMIR
> CyberSoft Yazilim Muh.
> http://www.ibrahimdemir.org
>
>
>
>
>
> --
> *From:* David Rees 
> *To:* axis-user@ws.apache.org
> *Sent:* Tuesday, May 5, 2009 11:33:01 PM
> *Subject:* Re: Axis2 Performance Tips
>
> On Tue, May 5, 2009 at 1:29 AM, ibrahim demir 
> wrote:
> > I woner if there is performance tips and tricks guide for Axis2. I have
> > tried to optimize my sevice and tried to make it simpler in order to have
> > fast response but I believe that is not enough.
>
> Yes, there are a number of things you can do to speed up Axis2.
> However, are you creating a web service or are you accessing a web
> service?
>
> I haven't focused on web service performance, as it seems to be pretty
> good already, but if you are using axis2 as a client there are a
> number of things you can do.
>
> > So can you share your experiences or tips here on performance
> optimizations
> > about Axis2. For example using the
> > HTTPConstants.REUSE_HTTP_CLIENT
> > HTTPConstants.CACHED_HTTP_CLIENT
> >
> > options has an effect on performance or not?
>
> These options definitely make a difference in performance especially
> if you are accessing services on a high latency network in rapid
> succession.
>
> Some of the things I do:
>
> 1. Use Commons-Pool to maintain a pool of Stubs.  Stub creation is
> expensive!
> 2. For each stub, set REUSE_HTTP_CLIENT to true and CACHED_HTTP_CLIENT
> to your own cached HttpClient.
> 3. For each HttpClient, you will likely want to increase the
> DefaultMaxConnections and MaxTotalConnections using your own
> MultiThreadedHttpConnectionManager.  In addition, also make sure you
> set the Version to HTTP_1_1 of your HttpClient, too.
>
> IMO Axis2 should provide a framework for doing all of those things
> easily by default.  Perhaps I will contribute some code when I get
> some time to abstract it out. :-)
>
> -Dave
>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


Problem with wsdl2java

2009-05-07 Thread Andrea Turli
Hi all,

I'm trying to consume a secure Axis Web service from a Globus Toolkit 4
service. I generated stubs with standard Axis' wsdl2java from a wsdl
(glite-security-voms-admin-2.0.2.wsdl)where all wsdl:operation are described
this way:

 

 
   http://schemas.xmlsoap.org/soap/encoding/"; namespace="
http://glite.org/wsdl/services/org.glite.security.voms.service.admin";
use="encoded"/>
 

http://schemas.xmlsoap.org/soap/encoding/"; namespace="
http://glite.org/wsdl/services/org.glite.security.voms.service.admin";
use="encoded"/>
 

http://schemas.xmlsoap.org/soap/encoding/"; name="VOMSException" namespace="
http://glite.org/wsdl/services/org.glite.security.voms.service.admin";
use="encoded"/>
 
 

Let me underline the soapAction="". As far as I understood, in Globus
Toolkit environment, stubs should be generated from a wsdl that "expect
soapAction to be populated".

So for test, I've tried to specify, in a given operation of that wsdl, the
correct soapAction. Then I've re-generated the stubs and everything works!

After this long explaination (sorry) my question is: could it be possible
(using some option in wsdl2java command) to inject the correct soapAction at
stub creation time, in order to have GT4 compliant stubs? Or could you
suggest me another workaround?

Thank you very much,

Andrea


Re: [Axis2] RuntimeException on timestamp = "" when timestamp minOccurs="0",

2009-05-07 Thread Amila Suriarachchi
I think this is a problem with parsing validating the timestamp string.

please go inside the setTimeStampType() method and check wether the regular
expression correctly validate
your string.

thanks,
Amila.

On Thu, May 7, 2009 at 1:03 PM, ChunTung POON  wrote:

> An update about the case
>
> Here is the Time Stamp Type
> ===
>  
>
>  
>  
>  
>
>  
> ===
>   maxOccurs="1" minOccurs="0"/>
> ===
>
> the response for the timestamp is
>
> 
>
> is it still valid?
>
>
>
>
>
> 2009/5/6 ChunTung POON
> > Hi All,
> >
> > I am running my client on java 1.4 with axis2 1.4.1
> >
> > I am able to send the server message. However, axis2 seems like cannot
> > construct the response from the soap message the server replied.
> >
> > Following exception occurred when the client tried to construct the
> > response from the soap message.
> > It was caused the by axis2 cannot set the timestamp of the message.
> > When I look at the the soap xml. The Timestamp is
> > 
> > and when i check the schema of the response message.
> >  > maxOccurs="1" minOccurs="0"/>
> > Its minOccurs="0" is correct. So, is axis2 cannot handle timestamp
> > having minOccurs=0 ? or Did I do something wrong?
> >
> >
> > thanks,
> > Chun Tung
> >
> > org.apache.axis2.AxisFault
> >at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub.fromOM(SmsSendServiceStub.java:12211)
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub.SendSms(SmsSendServiceStub.java:209)
> >at testM1wb.main(testM1wb.java:85)
> > Caused by: java.lang.RuntimeException
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$TimeStampType.setTimeStampType(SmsSendServiceStub.java:7957)
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$TimeStampType$Factory.parse(SmsSendServiceStub.java:8311)
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$DestinationResponseType$Factory.parse(SmsSendServiceStub.java:11050)
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$DestinationResponseListType$Factory.parse(SmsSendServiceStub.java:5132)
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$SendSmsResponseType$Factory.parse(SmsSendServiceStub.java:5925)
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$SendSmsResponseElement$Factory.parse(SmsSendServiceStub.java:7532)
> >at
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub.fromOM(SmsSendServiceStub.java:12191)
> >... 2 more
> > Exception in thread "main"
> >
> >
> >
> > Here is the soap response
> >
> > http://schemas.xmlsoap.org/soap/envelope/";>
> >
> >http:///sdp/ws/sms/wsdl/acm";
> > xmlns:ns2="http:///sdp/ws/sms/wsdl/header";
> > xmlns:ns3="http:///sdp/ws/sms/wsdl/application";
> > xmlns:ns4="http:///sdp/ws/sms/wsdl/send";
> > xmlns:ns5="http:///sdp/ws/sms/wsdl/common";
> > xmlns:ns6="http:///sdp/ws/sms/wsdl/error";>
> >109050614180004
> >4001
> >System.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > 
> >
> >
> >
> > XSD
> >
> > 
> > http://www.w3.org/2001/XMLSchema";
> >xmlns:smscmn="http:///sdp/ws/sms/wsdl/common";
> >xmlns:app="http:///sdp/ws/sms/wsdl/application";
> >xmlns:tns="http:///sdp/ws/sms/wsdl/deliver";
> > targetNamespace="http:///sdp/ws/sms/wsdl/deliver";
> > elementFormDefault="qualified">
> >  http:///sdp/ws/sms/wsdl/application";
> > schemaLocation="Application-Definitions.xsd" />
> >  http:///sdp/ws/sms/wsdl/common";
> > schemaLocation="SMS-Common-Definitions.xsd"/>
> >  
> >
> >   > type="smscmn:SegmentType"/>
> >
> >  
> >  
> >
> >   > minOccurs="0"/>
> >   > maxOccurs="1" minOccurs="1"/>
> >  
> >   > maxOccurs="1" minOccurs="1"/>
> >
> >  
> >  
> >
> >   > minOccurs="1"/>
> >   > minOccurs="0"/>
> >
> >  
> >  
> >
> >  
> >   > maxOccurs="1" minOccurs="1"/>
> >   > maxOccurs="1" minOccurs="0"/>
> >   > minOccurs="0"/>
> >   > maxOccurs="1" minOccurs="0"/>
> >
> >  
> >   > type="tns:DeliverSmsRequestType"/>
> >   > type="tns:DeliverSmsResponseType"/>
> >   > type="tns:SmsDeliveryStatusType"/>
> >  
> > 
> >
>



-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


Re: Handling Large data in a method call

2009-05-07 Thread Amila Suriarachchi
On Wed, May 6, 2009 at 10:12 AM, Sudhir Mongia wrote:

> Hi Dennis,
> We are not using WS-Security. Still its paining us.
>
> The problem we are facing is memory consumption while  serialization.
>
> We are using xmlbeans databinding, we couldn't go for ADB as it doesn't
> supports Complex type extension and restrictions and we have not evaluated
> other binding options as of now.
>

What is the Axis2 version you use? ADB supports Complex type extension and
restrictions.  But again there is a possibility it won't support for all
variations.

Generally Xmlbeans slower than other data bindings. so you can try jibx and
jaxbri as well.

thanks,
Amila.


> Thanks,
> Sudhir
>
>
> On Wed, May 6, 2009 at 3:01 AM, Dennis Sosnoski  wrote:
>
>> Hi Sudhir,
>>
>> Are you using WS-Security for the service? WS-Security builds an in-memory
>> model of the XML if you're using signatures (and perhaps at other times - I
>> haven't checked, but there appeared to be some issues in this area).
>>
>> If you're not using WS-Security this type of data should not be causing
>> problems. What data binding approach are you using? (ADB, XMLBeans, JiBX,
>> JAXB?)
>>
>>  - Dennis
>>
>> --
>> Dennis M. Sosnoski
>> SOA and Web Services in Java
>> Axis2 Training and Consulting
>> http://www.sosnoski.com - http://www.sosnoski.co.nz
>> Seattle, WA +1-425-939-0576 - Wellington, NZ +64-4-298-6117
>>
>>
>> Sudhir Mongia wrote:
>>
>>> Hi,
>>>
>>> Has anyone got any experience in this type of problem ? One possible
>>> solution we used temporarily is, pass data fragment in in a call and do
>>> multiple calls to send the complete data.But we are reluctant to go with
>>> this approach in production.
>>>
>>> Any help/pointer ?
>>>
>>> Thanks,
>>> Sudhir
>>>
>>> On Mon, May 4, 2009 at 2:23 PM, Sudhir Mongia 
>>> >> sudhir.mon...@gmail.com>> wrote:
>>>
>>>Hi,
>>>
>>>We have a web method exposed by .net app and we using client stubs
>>>generated through Axis2. This method accepts an array of objects.
>>>The object is very heavy object containing 25+ members variables
>>>of double and string type.
>>>The calls to this method fails sometimes due to memory when we are
>>>trying to send large number of objects e.g. 10-20.
>>>
>>>Any suggestions/idea , how can we compress the size of data to fix
>>>this problem? We have control up to some extent on server side as
>>>well.
>>>
>>>Thanks,
>>>Sudhir
>>>
>>>
>>>
>


-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


Re: [Axis2] RuntimeException on timestamp = "" when timestamp minOccurs="0",

2009-05-07 Thread ChunTung POON
An update about the case

Here is the Time Stamp Type
===
  

  
  
  

  
===
 
===

the response for the timestamp is



is it still valid?





2009/5/6 ChunTung POON
> Hi All,
>
> I am running my client on java 1.4 with axis2 1.4.1
>
> I am able to send the server message. However, axis2 seems like cannot
> construct the response from the soap message the server replied.
>
> Following exception occurred when the client tried to construct the
> response from the soap message.
> It was caused the by axis2 cannot set the timestamp of the message.
> When I look at the the soap xml. The Timestamp is
> 
> and when i check the schema of the response message.
>  maxOccurs="1" minOccurs="0"/>
> Its minOccurs="0" is correct. So, is axis2 cannot handle timestamp
> having minOccurs=0 ? or Did I do something wrong?
>
>
> thanks,
> Chun Tung
>
> org.apache.axis2.AxisFault
>        at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub.fromOM(SmsSendServiceStub.java:12211)
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub.SendSms(SmsSendServiceStub.java:209)
>        at testM1wb.main(testM1wb.java:85)
> Caused by: java.lang.RuntimeException
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$TimeStampType.setTimeStampType(SmsSendServiceStub.java:7957)
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$TimeStampType$Factory.parse(SmsSendServiceStub.java:8311)
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$DestinationResponseType$Factory.parse(SmsSendServiceStub.java:11050)
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$DestinationResponseListType$Factory.parse(SmsSendServiceStub.java:5132)
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$SendSmsResponseType$Factory.parse(SmsSendServiceStub.java:5925)
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub$SendSmsResponseElement$Factory.parse(SmsSendServiceStub.java:7532)
>        at 
> .sdp.ws.sms.wsdl.send.SmsSendServiceStub.fromOM(SmsSendServiceStub.java:12191)
>        ... 2 more
> Exception in thread "main"
>
>
>
> Here is the soap response
>
> http://schemas.xmlsoap.org/soap/envelope/";>
>        
>        http:///sdp/ws/sms/wsdl/acm";
> xmlns:ns2="http:///sdp/ws/sms/wsdl/header";
> xmlns:ns3="http:///sdp/ws/sms/wsdl/application";
> xmlns:ns4="http:///sdp/ws/sms/wsdl/send";
> xmlns:ns5="http:///sdp/ws/sms/wsdl/common";
> xmlns:ns6="http:///sdp/ws/sms/wsdl/error";>
>        109050614180004
>        4001
>        System.
>        
>        
>        
>        
>        
>        
>        
>        
>        
> 
>
>
>
> XSD
>
> 
> http://www.w3.org/2001/XMLSchema";
>    xmlns:smscmn="http:///sdp/ws/sms/wsdl/common";
>    xmlns:app="http:///sdp/ws/sms/wsdl/application";
>    xmlns:tns="http:///sdp/ws/sms/wsdl/deliver";
> targetNamespace="http:///sdp/ws/sms/wsdl/deliver";
> elementFormDefault="qualified">
>  http:///sdp/ws/sms/wsdl/application";
> schemaLocation="Application-Definitions.xsd" />
>  http:///sdp/ws/sms/wsdl/common";
> schemaLocation="SMS-Common-Definitions.xsd"/>
>  
>    
>       type="smscmn:SegmentType"/>
>    
>  
>  
>    
>       minOccurs="0"/>
>       maxOccurs="1" minOccurs="1"/>
>      
>       maxOccurs="1" minOccurs="1"/>
>    
>  
>  
>    
>       minOccurs="1"/>
>       minOccurs="0"/>
>    
>  
>  
>    
>      
>       maxOccurs="1" minOccurs="1"/>
>       maxOccurs="1" minOccurs="0"/>
>       minOccurs="0"/>
>       maxOccurs="1" minOccurs="0"/>
>    
>  
>   type="tns:DeliverSmsRequestType"/>
>   type="tns:DeliverSmsResponseType"/>
>   type="tns:SmsDeliveryStatusType"/>
>  
> 
>