Re: [Axis2] AXIOM Custom Serializer/Deserializer

2007-05-03 Thread Xinjun Chen

Hi Glen,

Thanks for the pointer.

I agree with your point 1), 2), and 3).
Regarding your guess, I need to do in-server debugging to confirm.

If "needToThrowEndDocument" is different for two different scenarios, it is
possible that hasNext() return different boolean values. But the problem I
face below is that hasNext() in two scenarios return the same boolean value
(TRUE), but next() in different scenario executes different logic.

Anyway, I will download the source of AXIOM 1.2.2 to do the in server
debugging and revert to this forum.


Regards,
Xinjun


On 5/4/07, Glen Mazza <[EMAIL PROTECTED]> wrote:


Here is the source code of OMStAXWrapper:
http://tinyurl.com/33k5m7

Here are some things I noticed:
1.)  The NPE occurs at generateEvents on line 1115 because the passed-in
"node" parameter is null.

2.)  Method next(), which calls generateEvents() at line 911, does not
check to see if the currentNode parameter is null.  So apparently we
have a case where the state is NAVIGABLE but currentNode is null.  (This
I believe is OK, because client code should call hasNext() before
calling next().)

3.)  Your code calls method hasNext() at line 797 before calling next().
But you can see the AXIOM implementation of hasNext() has a different
business logic depending on the boolean value of
"needToThrowEndDocument".

So my guess would be that the needToThrowEndDocument value is different
between standalone usage and web service usage, which changes the
business logic of hasNext().  Further, the business logic for standalone
is correct but not working properly under certain circumstances for web
service usage (i.e., it returns true when it should be false, causing
your code to call next() erroneously, causing the NPE.)

Glen


Am Freitag, den 04.05.2007, 11:36 +0800 schrieb Xinjun Chen:
> I have tried to invoke the EPaymentHandler from JSP directly, it works
> fine. The EPaymentHandler.execute() invokes
> CreditCardPaymentRequestBinder.toObject.
>
> But when I invoke the EPaymentHandler from inside a child class of
> org.apache.axis2.receivers.RawXMLINOutMessageReceiver, then I get the
> NPE.
> The child class of RawXMLINOutMessageReceiver override the
> invokeBusinessLogic method as follows:
>
>  public void invokeBusinessLogic(MessageContext msgContext,
> MessageContext newmsgContext) throws AxisFault {
>
>log.debug("EPaymentHandler invoked.");
>try {
>epayHandler.execute (msgContext, newmsgContext);
>// epayHandler will invoke CreditCardPaymentRequestBinder.
>} catch (Exception e) {
>log.error(e);
>throw new AxisFault(e);
>}
>  }
>
> As can be seen, this method does not contain any code dealing with
> StAX parser.
> I am wondering which step affects the StAX parser and cause the
> org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(
OMStAXWrapper.java:1115) NPE.
> I am not familiar with the implementation of AXIOM, and now cannot
> proceed.
>
> As far as I know, wstx-asl-3.2.0.jar is the implementation of
> stax-api. How about the axiom-impl-1.2.2.jar? Does it use
> wstx-asl-3.2.0?
>
> Regards,
> Xinjun
>
>
> On 5/4/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:
> Hi Dims,
>
> The same soap request works with my standalone program. The
> same method toObject runs correctly gives correct result.
>
> Regards,
> Xinjun
>
> On 5/3/07, Davanum Srinivas <[EMAIL PROTECTED] > wrote:
> Xinjun,
>
> can you run tcpmon to capture the soap request and use
> that xml with
> your stand alone program to see if that works?
>
> -- dims
>
> On 5/3/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi,
> >
> > I wrote a sample custom serializer/deserializer to
> serialize an object. When
> > I use a standalone program to test the serializer,
> it works fine. But when I
> > deploy the serializer as part of a web service and
> and invoke the web
> > service through a SOAP request, I got the following
> null pointer execption.
> > I googled but didn't find the reason of this. Why
> does the NPE occur only
> > when I deploy the binder as part of the web service?
> I used the same
> > SOAPEnvelope to test.
> >
> >
> >
> > java.lang.NullPointerException
> > at
> >
>
org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(OMStAXWrap
> > per.java:1115)
> > at
> > org.apache.axiom.om.impl.llom.OMStAXWrapper.next
> (OMStAXWrapper.java:9
> >  11)
> > at
> 

Re: [Axis2] AXIOM Custom Serializer/Deserializer

2007-05-03 Thread Glen Mazza
Here is the source code of OMStAXWrapper:
http://tinyurl.com/33k5m7

Here are some things I noticed:
1.)  The NPE occurs at generateEvents on line 1115 because the passed-in
"node" parameter is null.

2.)  Method next(), which calls generateEvents() at line 911, does not
check to see if the currentNode parameter is null.  So apparently we
have a case where the state is NAVIGABLE but currentNode is null.  (This
I believe is OK, because client code should call hasNext() before
calling next().)

3.)  Your code calls method hasNext() at line 797 before calling next().
But you can see the AXIOM implementation of hasNext() has a different
business logic depending on the boolean value of
"needToThrowEndDocument".

So my guess would be that the needToThrowEndDocument value is different
between standalone usage and web service usage, which changes the
business logic of hasNext().  Further, the business logic for standalone
is correct but not working properly under certain circumstances for web
service usage (i.e., it returns true when it should be false, causing
your code to call next() erroneously, causing the NPE.)

Glen


Am Freitag, den 04.05.2007, 11:36 +0800 schrieb Xinjun Chen:
> I have tried to invoke the EPaymentHandler from JSP directly, it works
> fine. The EPaymentHandler.execute() invokes
> CreditCardPaymentRequestBinder.toObject.
>  
> But when I invoke the EPaymentHandler from inside a child class of
> org.apache.axis2.receivers.RawXMLINOutMessageReceiver, then I get the
> NPE. 
> The child class of RawXMLINOutMessageReceiver override the
> invokeBusinessLogic method as follows:
> 
>  public void invokeBusinessLogic(MessageContext msgContext,
> MessageContext newmsgContext) throws AxisFault {
>   
>log.debug("EPaymentHandler invoked.");
>try {
>epayHandler.execute (msgContext, newmsgContext);
>// epayHandler will invoke CreditCardPaymentRequestBinder.
>} catch (Exception e) {
>log.error(e);
>throw new AxisFault(e);
>}
>  }
>  
> As can be seen, this method does not contain any code dealing with
> StAX parser. 
> I am wondering which step affects the StAX parser and cause the
> org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(OMStAXWrapper.java:1115)
>  NPE. 
> I am not familiar with the implementation of AXIOM, and now cannot
> proceed. 
>  
> As far as I know, wstx-asl-3.2.0.jar is the implementation of
> stax-api. How about the axiom-impl-1.2.2.jar? Does it use
> wstx-asl-3.2.0?  
>  
> Regards, 
> Xinjun
> 
>  
> On 5/4/07, Xinjun Chen <[EMAIL PROTECTED]> wrote: 
> Hi Dims, 
>  
> The same soap request works with my standalone program. The
> same method toObject runs correctly gives correct result. 
>  
> Regards, 
> Xinjun
>  
> On 5/3/07, Davanum Srinivas <[EMAIL PROTECTED] > wrote: 
> Xinjun,
> 
> can you run tcpmon to capture the soap request and use
> that xml with
> your stand alone program to see if that works? 
> 
> -- dims
> 
> On 5/3/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi,
> >
> > I wrote a sample custom serializer/deserializer to
> serialize an object. When 
> > I use a standalone program to test the serializer,
> it works fine. But when I
> > deploy the serializer as part of a web service and
> and invoke the web 
> > service through a SOAP request, I got the following
> null pointer execption. 
> > I googled but didn't find the reason of this. Why
> does the NPE occur only
> > when I deploy the binder as part of the web service?
> I used the same 
> > SOAPEnvelope to test.
> >
> >
> >
> > java.lang.NullPointerException
> > at
> >
> 
> org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(OMStAXWrap
> > per.java:1115)
> > at 
> > org.apache.axiom.om.impl.llom.OMStAXWrapper.next
> (OMStAXWrapper.java:9
> >  11)
> > at
> >
> 
> com.mycom.CreditCardPaymentRequestBinder.toObject(CreditCardPaymentRequestBinder.java:138)
> >
> >
> >
> > The toObject method definition is as follows: 
> >
> >  public CreditCardPaymentRequest toObject(QName
> qname, XMLStreamReader
> > reader) throws XMLStreamException {
> >   CreditCardPaymentRequ

Re: [Axis2] AXIOM Custom Serializer/Deserializer

2007-05-03 Thread Xinjun Chen

I have tried to invoke the EPaymentHandler from JSP directly, it works fine.
The EPaymentHandler.execute() invokes
CreditCardPaymentRequestBinder.toObject.

But when I invoke the EPaymentHandler from inside a child class of
org.apache.axis2.receivers.RawXMLINOutMessageReceiver, then I get the NPE.
The child class of RawXMLINOutMessageReceiver override the
invokeBusinessLogic method as follows:

public void invokeBusinessLogic(MessageContext msgContext, MessageContext
newmsgContext) throws AxisFault {

  log.debug("EPaymentHandler invoked.");
  try {
  epayHandler.execute(msgContext, newmsgContext);
  // epayHandler will invoke CreditCardPaymentRequestBinder.
  } catch (Exception e) {
  log.error(e);
  throw new AxisFault(e);
  }
}

As can be seen, this method does not contain any code dealing with StAX
parser.
I am wondering which step affects the StAX parser and cause the
org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(
OMStAXWrapper.java:1115) NPE.
I am not familiar with the implementation of AXIOM, and now cannot proceed.

As far as I know, wstx-asl-3.2.0.jar is the implementation of stax-api. How
about the axiom-impl-1.2.2.jar? Does it use wstx-asl-3.2.0?

Regards,
Xinjun


On 5/4/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:


Hi Dims,

The same soap request works with my standalone program. The same method
toObject runs correctly gives correct result.

Regards,
Xinjun

 On 5/3/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
>
> Xinjun,
>
> can you run tcpmon to capture the soap request and use that xml with
> your stand alone program to see if that works?
>
> -- dims
>
> On 5/3/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi,
> >
> > I wrote a sample custom serializer/deserializer to serialize an
> object. When
> > I use a standalone program to test the serializer, it works fine. But
> when I
> > deploy the serializer as part of a web service and and invoke the web
> > service through a SOAP request, I got the following null pointer
> execption.
> > I googled but didn't find the reason of this. Why does the NPE occur
> only
> > when I deploy the binder as part of the web service? I used the same
> > SOAPEnvelope to test.
> >
> >
> >
> > java.lang.NullPointerException
> > at
> > org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(OMStAXWrap
> > per.java:1115)
> > at
> > org.apache.axiom.om.impl.llom.OMStAXWrapper.next (OMStAXWrapper.java:9
> >  11)
> > at
> > com.mycom.CreditCardPaymentRequestBinder.toObject(
> CreditCardPaymentRequestBinder.java:138)
> >
> >
> >
> > The toObject method definition is as follows:
> >
> >  public CreditCardPaymentRequest toObject(QName qname, XMLStreamReader
> > reader) throws XMLStreamException {
> >   CreditCardPaymentRequest obj = new CreditCardPaymentRequest();
> >
> >   String rootElementName = qname.getLocalPart ();
> >   String uri = qname.getNamespaceURI();
> >
> >   if(!rootNsUri.equals(uri)) {
> >throw new XMLStreamException("Invalid namespace " + uri + ".
> Expected
> > namespace uri is " + rootNsUri);
> >   }
> >
> >   while(reader.hasNext()) {
> >int type = reader.next(); // Line number: 138
> >
> >if(XMLStreamConstants.START_ELEMENT == type){
> > String element = reader.getLocalName ();
> >
> > if( rootLocalName.equals(element) ) {
> >  continue;
> > } else if( element.equals("cardNumber") ){
> >  obj.setCardNumber(reader.getElementText());
> > } else if( element.equals("expiryMonth") ) {
> >  obj.setExpiryMonth(reader.getElementText());
> > } else if( element.equals("expiryYear") ) {
> >  obj.setExpiryYear(reader.getElementText());
> > } else if( element.equals("brand") ) {
> >  obj.setBrand(reader.getElementText());
> > } else if( element.equals("totalAmount") ) {
> >  obj.setTotalAmount(reader.getElementText ());
> > } else if( element.equals("currency") ) {
> >  obj.setCurrency(reader.getElementText());
> > } else if( element.equals("systemId") ) {
> >  obj.setSystemId(reader.getElementText ());
> > } else if( element.equals("referenceNumber") ) {
> >  obj.setReferenceNumber(reader.getElementText());
> > } else if( element.equals("op") ) {
> >  obj.setOp(reader.getElementText ());
> > } else {
> >  throw new RuntimeException("Unexpected element " + element);
> > }
> >}
> >
> >if(XMLStreamConstants.END_ELEMENT == type){
> > if(reader.getLocalName ().equals(rootElementName)){
> >  break;
> > }
> >}
> >
> >   }
> >
> >   return obj;
> >  }
> >
> >
> >
> >
> >
> > Regards,
> >
> > Xinjun
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Re: WSDL2Java: WSDLProcessingException: Encoded use is not supported?

2007-05-03 Thread Amila Suriarachchi

if you have put that into production, that means for the services it does
not use the encoding
work fine. So what we can do in Axis2 is to proceed by giving a waring
message as in earlier.

Shall we do it giving only an warning message?

amila.

On 5/4/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:


Stefan,

Is this an Axis2 based service in production? and you have a custom wsdl?

-- dims

On 5/3/07, stefan_dragnev <[EMAIL PROTECTED]> wrote:
>
> Dims,
>
> I'm sure the wsdl uses rpc/encoded because it contains the following
> section:
>
> 
> http://schemas.xmlsoap.org/soap/http";
> style="document"/>
> 
>soapAction="http://www.openuri.org/UpdateCategoriesReq"; style="rpc"/>
>   
> http://www.openuri.org/";
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>   
>   
> http://www.openuri.org/";
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>   
> 
> 
>   http://www.openuri.org/BPDataReq";
> style="rpc"/>
>   
> http://www.openuri.org/";
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>   
>   
> http://www.openuri.org/";
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
>   
> 
> ..
> 
>
> I know that rpc/encoded is not supported in WS-I basic profile but this
WSDL
> was developed some time ago and is used in production so I'm not sure
> whether I will be allowed to modify. If I'm allowed to modify it what
will
> be the best way to do it so Axis2 1.2's wsdl2java will not throw errors?
>
> Thanks.
> Stefan
>
>
> >I believe we are throwing better exceptions now...if you post the wsdl
> >in a bug report, we can take a look to confirm that it is indeed an
> >rpc/encoded wsdl which we don't support.
> >
> >thanks,
> >dims
>
> --
> View this message in context:
http://www.nabble.com/WSDL2Java%3A-WSDLProcessingException%3A-Encoded-use-is-not-supported--tf3678548.html#a10312820
> Sent from the Axis - User mailing list archive at Nabble.com.
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


--
Davanum Srinivas :: http://davanum.wordpress.com

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





--
Amila Suriarachchi,
WSO2 Inc.


Re: [Axis2] AXIOM Custom Serializer/Deserializer

2007-05-03 Thread Xinjun Chen

I have tried to invoke the EPaymentHandler from JSP directly, it works fine.
The EPaymentHandler.execute() invokes
CreditCardPaymentRequestBinder.toObject.

But when I invoke the EPaymentHandler from inside a child class of
org.apache.axis2.receivers.RawXMLINOutMessageReceiver, then I get the NPE.
The child class of RawXMLINOutMessageReceiver override the
invokeBusinessLogic method as follows:

public void invokeBusinessLogic(MessageContext msgContext, MessageContext
newmsgContext) throws AxisFault {

  log.debug("EPaymentHandler invoked.");
  try {
  epayHandler.execute(msgContext, newmsgContext);
  // epayHandler will invoke CreditCardPaymentRequestBinder.
  } catch (Exception e) {
  log.error(e);
  throw new AxisFault(e);
  }
}

As can be seen, this method does not contain any code dealing with StAX
parser.
I am wondering which step affects the StAX parser and cause the
org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(
OMStAXWrapper.java:1115) NPE.
I am not familiar with the implementation of AXIOM, and now cannot proceed.

As far as I know, wstx-asl-3.2.0.jar is the implementation of stax-api. How
about the axiom-impl-1.2.2.jar? Does it use wstx-asl-3.2.0?

Regards,
Xinjun


On 5/4/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:


Hi Dims,

The same soap request works with my standalone program. The same method
toObject runs correctly gives correct result.

Regards,
Xinjun

 On 5/3/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:
>
> Xinjun,
>
> can you run tcpmon to capture the soap request and use that xml with
> your stand alone program to see if that works?
>
> -- dims
>
> On 5/3/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi,
> >
> > I wrote a sample custom serializer/deserializer to serialize an
> object. When
> > I use a standalone program to test the serializer, it works fine. But
> when I
> > deploy the serializer as part of a web service and and invoke the web
> > service through a SOAP request, I got the following null pointer
> execption.
> > I googled but didn't find the reason of this. Why does the NPE occur
> only
> > when I deploy the binder as part of the web service? I used the same
> > SOAPEnvelope to test.
> >
> >
> >
> > java.lang.NullPointerException
> > at
> > org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(OMStAXWrap
> > per.java:1115)
> > at
> > org.apache.axiom.om.impl.llom.OMStAXWrapper.next (OMStAXWrapper.java:9
> >  11)
> > at
> > com.mycom.CreditCardPaymentRequestBinder.toObject(
> CreditCardPaymentRequestBinder.java:138)
> >
> >
> >
> > The toObject method definition is as follows:
> >
> >  public CreditCardPaymentRequest toObject(QName qname, XMLStreamReader
> > reader) throws XMLStreamException {
> >   CreditCardPaymentRequest obj = new CreditCardPaymentRequest();
> >
> >   String rootElementName = qname.getLocalPart ();
> >   String uri = qname.getNamespaceURI();
> >
> >   if(!rootNsUri.equals(uri)) {
> >throw new XMLStreamException("Invalid namespace " + uri + ".
> Expected
> > namespace uri is " + rootNsUri);
> >   }
> >
> >   while(reader.hasNext()) {
> >int type = reader.next(); // Line number: 138
> >
> >if(XMLStreamConstants.START_ELEMENT == type){
> > String element = reader.getLocalName ();
> >
> > if( rootLocalName.equals(element) ) {
> >  continue;
> > } else if( element.equals("cardNumber") ){
> >  obj.setCardNumber(reader.getElementText());
> > } else if( element.equals("expiryMonth") ) {
> >  obj.setExpiryMonth(reader.getElementText());
> > } else if( element.equals("expiryYear") ) {
> >  obj.setExpiryYear(reader.getElementText());
> > } else if( element.equals("brand") ) {
> >  obj.setBrand(reader.getElementText());
> > } else if( element.equals("totalAmount") ) {
> >  obj.setTotalAmount(reader.getElementText ());
> > } else if( element.equals("currency") ) {
> >  obj.setCurrency(reader.getElementText());
> > } else if( element.equals("systemId") ) {
> >  obj.setSystemId(reader.getElementText ());
> > } else if( element.equals("referenceNumber") ) {
> >  obj.setReferenceNumber(reader.getElementText());
> > } else if( element.equals("op") ) {
> >  obj.setOp(reader.getElementText ());
> > } else {
> >  throw new RuntimeException("Unexpected element " + element);
> > }
> >}
> >
> >if(XMLStreamConstants.END_ELEMENT == type){
> > if(reader.getLocalName ().equals(rootElementName)){
> >  break;
> > }
> >}
> >
> >   }
> >
> >   return obj;
> >  }
> >
> >
> >
> >
> >
> > Regards,
> >
> > Xinjun
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Re: [Axis2] AXIOM Custom Serializer/Deserializer

2007-05-03 Thread Xinjun Chen

Hi Dims,

The same soap request works with my standalone program. The same method
toObject runs correctly gives correct result.

Regards,
Xinjun

On 5/3/07, Davanum Srinivas <[EMAIL PROTECTED]> wrote:


Xinjun,

can you run tcpmon to capture the soap request and use that xml with
your stand alone program to see if that works?

-- dims

On 5/3/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:
>
>
> Hi,
>
> I wrote a sample custom serializer/deserializer to serialize an object.
When
> I use a standalone program to test the serializer, it works fine. But
when I
> deploy the serializer as part of a web service and and invoke the web
> service through a SOAP request, I got the following null pointer
execption.
> I googled but didn't find the reason of this. Why does the NPE occur
only
> when I deploy the binder as part of the web service? I used the same
> SOAPEnvelope to test.
>
>
>
> java.lang.NullPointerException
> at
> org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(OMStAXWrap
> per.java:1115)
> at
> org.apache.axiom.om.impl.llom.OMStAXWrapper.next(OMStAXWrapper.java:9
>  11)
> at
> com.mycom.CreditCardPaymentRequestBinder.toObject(
CreditCardPaymentRequestBinder.java:138)
>
>
>
> The toObject method definition is as follows:
>
>  public CreditCardPaymentRequest toObject(QName qname, XMLStreamReader
> reader) throws XMLStreamException {
>   CreditCardPaymentRequest obj = new CreditCardPaymentRequest();
>
>   String rootElementName = qname.getLocalPart ();
>   String uri = qname.getNamespaceURI();
>
>   if(!rootNsUri.equals(uri)) {
>throw new XMLStreamException("Invalid namespace " + uri + ". Expected
> namespace uri is " + rootNsUri);
>   }
>
>   while(reader.hasNext()) {
>int type = reader.next(); // Line number: 138
>
>if(XMLStreamConstants.START_ELEMENT == type){
> String element = reader.getLocalName();
>
> if( rootLocalName.equals(element) ) {
>  continue;
> } else if( element.equals("cardNumber") ){
>  obj.setCardNumber(reader.getElementText());
> } else if( element.equals("expiryMonth") ) {
>  obj.setExpiryMonth(reader.getElementText());
> } else if( element.equals("expiryYear") ) {
>  obj.setExpiryYear(reader.getElementText());
> } else if( element.equals("brand") ) {
>  obj.setBrand(reader.getElementText());
> } else if( element.equals("totalAmount") ) {
>  obj.setTotalAmount(reader.getElementText());
> } else if( element.equals("currency") ) {
>  obj.setCurrency(reader.getElementText());
> } else if( element.equals("systemId") ) {
>  obj.setSystemId(reader.getElementText());
> } else if( element.equals("referenceNumber") ) {
>  obj.setReferenceNumber(reader.getElementText());
> } else if( element.equals("op") ) {
>  obj.setOp(reader.getElementText());
> } else {
>  throw new RuntimeException("Unexpected element " + element);
> }
>}
>
>if(XMLStreamConstants.END_ELEMENT == type){
> if(reader.getLocalName().equals(rootElementName)){
>  break;
> }
>}
>
>   }
>
>   return obj;
>  }
>
>
>
>
>
> Regards,
>
> Xinjun


--
Davanum Srinivas :: http://davanum.wordpress.com

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




Re: Appropriate place for transaction code?

2007-05-03 Thread Glen Mazza
Reading the third sentence of your email, you said the service is just
*retrieving* data from the database (i.e. SQL SELECT), is that correct?
If so, commits would not be a concern for you--you may be able to keep
your service in application scope[1] and just initialize an instance
variable to hold the session factory.

Otherwise, I don't know if you're using Spring but the Axis2 Spring
guide[2] may give you some ideas until someone else can get you a better
answer.

[1] http://www.developer.com/java/web/article.php/10935_3620661_2
[2] http://ws.apache.org/axis2/1_2/spring.html

Glen


Am Donnerstag, den 03.05.2007, 16:26 -0400 schrieb
[EMAIL PROTECTED]:
> Hi,
> 
> I'm new to Axis. I'm using Axis2 1.1.1.
> 
> I'm creating a service that retrieves data from a database. I'm using 
> Hibernate. For those of you not familiar with it, the basic pattern of usage 
> is that you create something called a SessionFactory once when the 
> application starts, and then for each request/response cycle you create a 
> Session. When the response finishes, you commit the session.
> 
> In regular web applications I create the session factory in the 
> ApplicationContext. Then I make a servlet filter that creates the session and 
> starts a transaction on the way in, and then commits the transaction and 
> closes the session on the way out.
> 
> I'm trying to figure out how to do this in Axis. I created a module called 
> hibernateTransactionModule. I've got two handlers, one for the way in and one 
> for the way out, each attached to a new phase. Right now they're just saying 
> 'hello world' and it works, they do execute when I expect them to.
> 
> So I've got three classes:
> 
> HibernateTransactionModule implements org.apache.axis2.modules.Module
> HibernateTransactionHandlerBegin extends AbstractHandler implements Handler
> HibernateTransactionHandlerEnd extends AbstractHandler implements Handler
> 
> My intuition tells me that HibernateTransactionModule.init() would be the 
> appropriate place to create the hibernate session factory, 
> HibernateTransactionHandlerBegin.invoke() could create a session for a 
> request and put it into the messageContext, and 
> HibernateTransactionHandlerEnd.invoke() could commit the transaction and 
> close the session.
> 
> But I can't see a place where I can store the session factory where it can be 
> accessible to the handlers.
> 
> One possibility would be to use a static field in 
> HibernateTransactionHandlerBegin but that would be an ugly hack. Any 
> suggestions?
> 
> Thanks
> Michael Davis
> www.damaru.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]



RE: Axis/Wss4j Websphere NoClassDefFoundError

2007-05-03 Thread Spies, Brennan
I haven't played around with v6.1 yet, but in 5.x Axis is included as part of
the base WAS libraries in /lib. Since these libs are loaded first,
it can interfere with any Axis installation on your own app path.

You may want to try PARENT_LAST classloading.


-Original Message-
From: Michelle Vogt [mailto:[EMAIL PROTECTED] 
Sent: Thursday, May 03, 2007 4:11 PM
To: axis-user@ws.apache.org; Martin Gainty
Subject: Re: Axis/Wss4j Websphere NoClassDefFoundError

We already have the relevant axis and wss4j jar files in our app lib
directory.
And, this was working previously on the previous.

On 5/4/07, Martin Gainty <[EMAIL PROTECTED]> wrote:
> download axis-src-1_4.zip from http://apache.osuosl.org/ws/axis/1_4/
> (and compile the package)
>
> M--
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
> - Original Message -
> From: "Michelle Vogt" <[EMAIL PROTECTED]>
> To: 
> Sent: Thursday, May 03, 2007 6:37 PM
> Subject: Axis/Wss4j Websphere NoClassDefFoundError
>
>
> > We are trying to use Websphere 6.1 with axis and wss4j security.
> > When the security is enabled, the following exception is thrown when
> > the web service is called:
> >
> > NoClassDefFoundError: org.apache.axis.Handler
> >
> > This is part of the wsdd config file specifying the handler:
> > 
> >
> > If security is disabled then the web service works fine.  And, also if
> > the handler type is replaced with a type in our own app, then it works
> > fine also.
> >
> > Has anybody been able to get anything similar working, or had similar
> > problems with this on websphere?
> >
> > We're using axis 1.4, and wss4j 1.5
> >
> > thanks
> >
> > -
> > 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]
>
>

-
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]



Re: Axis/Wss4j Websphere NoClassDefFoundError

2007-05-03 Thread Michelle Vogt

We already have the relevant axis and wss4j jar files in our app lib directory.
And, this was working previously on the previous.

On 5/4/07, Martin Gainty <[EMAIL PROTECTED]> wrote:

download axis-src-1_4.zip from http://apache.osuosl.org/ws/axis/1_4/
(and compile the package)

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message -
From: "Michelle Vogt" <[EMAIL PROTECTED]>
To: 
Sent: Thursday, May 03, 2007 6:37 PM
Subject: Axis/Wss4j Websphere NoClassDefFoundError


> We are trying to use Websphere 6.1 with axis and wss4j security.
> When the security is enabled, the following exception is thrown when
> the web service is called:
>
> NoClassDefFoundError: org.apache.axis.Handler
>
> This is part of the wsdd config file specifying the handler:
> 
>
> If security is disabled then the web service works fine.  And, also if
> the handler type is replaced with a type in our own app, then it works
> fine also.
>
> Has anybody been able to get anything similar working, or had similar
> problems with this on websphere?
>
> We're using axis 1.4, and wss4j 1.5
>
> thanks
>
> -
> 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]




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



Re: Axis/Wss4j Websphere NoClassDefFoundError

2007-05-03 Thread Martin Gainty

download axis-src-1_4.zip from http://apache.osuosl.org/ws/axis/1_4/
(and compile the package)

M--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Michelle Vogt" <[EMAIL PROTECTED]>

To: 
Sent: Thursday, May 03, 2007 6:37 PM
Subject: Axis/Wss4j Websphere NoClassDefFoundError



We are trying to use Websphere 6.1 with axis and wss4j security.
When the security is enabled, the following exception is thrown when
the web service is called:

NoClassDefFoundError: org.apache.axis.Handler

This is part of the wsdd config file specifying the handler:


If security is disabled then the web service works fine.  And, also if
the handler type is replaced with a type in our own app, then it works
fine also.

Has anybody been able to get anything similar working, or had similar
problems with this on websphere?

We're using axis 1.4, and wss4j 1.5

thanks

-
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]



Re: [Axis2] Other ways of doing sessions w/o addressing

2007-05-03 Thread robert lazarski

http://braziloutsource.com/wss2.html

Search for 'SWA Session State' . The explanation and javadoc are in
portuguese - if google translate isn't clear enough feel free to ask here.

UUIDCache in that code is managed by ehcache - here's the config:



   

   


I use spring to set up ehcache as:


   
   
   
   
   com.siemens.swa.webservices.security.UUIDCache
   


UUIDCache is:

package com.siemens.swa.webservices.security;

import java.util.Collections;
import java.util.HashMap;
import java.util.Map;

/** Manage UUID's and its variables via a Singleton. **/
public class UUIDCache {

   /** Singleton instance. */
   private static UUIDCache _instance;

   /** Used to hold references to web vars resources for re-use. */
   private Map < String, Long > timeCache;

   /**
   Constructor.

   intializes the static server properties
   */
   private UUIDCache() {
   try {
   timeCache = Collections.synchronizedMap(
   new HashMap< String, Long >());
   } catch (Exception ex) {
   throw new IllegalStateException("Cache constructor exception: "
   + ex.toString());
   }
   }

   //Instatiate singleton with a static initializer
   static {
   try {
   _instance = new UUIDCache();
   System.out.println("Simple cache started successfully");
   } catch (Exception e) {
   throw new ExceptionInInitializerError(e);
   }
   }

   /**
   returns the instance of the UUIDCache.
   
@return UUIDCache - the singleton.
   */
   public static UUIDCache getInstance() {
   return _instance;
   }

   /**
   Verify user has logged in.

   @param  who  The Session key
   @return Integer webId
   */
   public boolean hasSOAPSession(String who) {
   return timeCache.containsKey(who);
   }

   /**
   Gets timestamp var as Long.

   @param  who  The Session key
   @return timestamp timeout var
   */
   public Long getTimeStamp(String who) {
   Long timestamp = null;
   try {
   if (timeCache.containsKey(who)) {
   timestamp = timeCache.get(who);
   } else {
   throw new IllegalStateException(
   "Corrupted cache detected - "
   + " getTimeStamp() can't find key: "
   + who);
   }
   } catch (Exception ex) {
   throw new IllegalStateException(
   "Cache getWebID exception: " + ex.toString());
   }

   return timestamp;
   }

   /**
   Put webId into cache.

   @param  who  The Session key
   @param  timestamp timeout var
   */
   public void putTimeStamp(String who, Long timestamp) {
   if (timeCache.containsKey(who)) {
   // remove old lease
   timeCache.remove(who);
   }
   timeCache.put(who, timestamp);
   }

}

Its pretty simple code really.

HTH,
Robert

On 5/3/07, Vickram Jain <[EMAIL PROTECTED]> wrote:


 Robert,

Do you have any code samples on how you setup and used ehcache w/ axis2?
Would appreciate anything you could send my way.

Thanks,
Vickram

- Original Message -
*From:* robert lazarski <[EMAIL PROTECTED]>
*To:* axis-user@ws.apache.org
*Sent:* Wednesday, May 02, 2007 2:13 PM
*Subject:* Re: [Axis2] Other ways of doing sessions w/o addressing

You can manage the sessions yourself by generating your own token via a
return value and mandate the passing of it back in a future calls, but then
you have to manage the token yourself. That does have the advantage of after
a few days work its stable and flexible. I've done that with both ehcache /
UUID and alternatively ejb stateful session beans.

HTH,
Robert

On 5/2/07, Glen Mazza <[EMAIL PROTECTED]> wrote:
>
> Can't answer your second question, but the first one may be "no".  The
> bottom of page 1 of the below article states "Managing a SOAP session
> requires you to engage addressing modules on both the server side and
> client side":
>
> http://www.developer.com/java/web/article.php/3620661
>
> Hopefully a more advanced user can think of another option for you.
>
> Glen
>
>
> Am Mittwoch, den 02.05.2007, 12:37 -0400 schrieb Vickram Jain:
> > Is there a way to generate sessions without using the WS-Addressing
> > module?
> >
> > The consumer for my application has trouble dealing with XML as it is,
>
> > and so keeping our message pared down is important. I'd hate to have
> > to fatten up my messages at this point.
> >
> > If this is not possible, then one other question: is addressing module
> > only set to respond with a session token only if the caller uses the
> > addressing headers?
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



Axis/Wss4j Websphere NoClassDefFoundError

2007-05-03 Thread Michelle Vogt

We are trying to use Websphere 6.1 with axis and wss4j security.
When the security is enabled, the following exception is thrown when
the web service is called:

NoClassDefFoundError: org.apache.axis.Handler

This is part of the wsdd config file specifying the handler:


If security is disabled then the web service works fine.  And, also if
the handler type is replaced with a type in our own app, then it works
fine also.

Has anybody been able to get anything similar working, or had similar
problems with this on websphere?

We're using axis 1.4, and wss4j 1.5

thanks

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



Re: WSDL2Java: WSDLProcessingException: Encoded use is not supported?

2007-05-03 Thread Davanum Srinivas

Stefan,

Is this an Axis2 based service in production? and you have a custom wsdl?

-- dims

On 5/3/07, stefan_dragnev <[EMAIL PROTECTED]> wrote:


Dims,

I'm sure the wsdl uses rpc/encoded because it contains the following
section:


http://schemas.xmlsoap.org/soap/http";
style="document"/>

  http://www.openuri.org/UpdateCategoriesReq"; style="rpc"/>
  
http://www.openuri.org/";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  
  
http://www.openuri.org/";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  


  http://www.openuri.org/BPDataReq";
style="rpc"/>
  
http://www.openuri.org/";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  
  
http://www.openuri.org/";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  

..


I know that rpc/encoded is not supported in WS-I basic profile but this WSDL
was developed some time ago and is used in production so I'm not sure
whether I will be allowed to modify. If I'm allowed to modify it what will
be the best way to do it so Axis2 1.2's wsdl2java will not throw errors?

Thanks.
Stefan


>I believe we are throwing better exceptions now...if you post the wsdl
>in a bug report, we can take a look to confirm that it is indeed an
>rpc/encoded wsdl which we don't support.
>
>thanks,
>dims

--
View this message in context: 
http://www.nabble.com/WSDL2Java%3A-WSDLProcessingException%3A-Encoded-use-is-not-supported--tf3678548.html#a10312820
Sent from the Axis - User mailing list archive at Nabble.com.


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





--
Davanum Srinivas :: http://davanum.wordpress.com

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



Re: [Axis2] Other ways of doing sessions w/o addressing

2007-05-03 Thread Vickram Jain
Robert,

Do you have any code samples on how you setup and used ehcache w/ axis2? Would 
appreciate anything you could send my way.

Thanks,
Vickram
  - Original Message - 
  From: robert lazarski 
  To: axis-user@ws.apache.org 
  Sent: Wednesday, May 02, 2007 2:13 PM
  Subject: Re: [Axis2] Other ways of doing sessions w/o addressing


  You can manage the sessions yourself by generating your own token via a 
return value and mandate the passing of it back in a future calls, but then you 
have to manage the token yourself. That does have the advantage of after a few 
days work its stable and flexible. I've done that with both ehcache / UUID and 
alternatively ejb stateful session beans. 

  HTH,
  Robert 


  On 5/2/07, Glen Mazza <[EMAIL PROTECTED]> wrote:
Can't answer your second question, but the first one may be "no".  The
bottom of page 1 of the below article states "Managing a SOAP session
requires you to engage addressing modules on both the server side and 
client side":

http://www.developer.com/java/web/article.php/3620661

Hopefully a more advanced user can think of another option for you. 

Glen


Am Mittwoch, den 02.05.2007, 12:37 -0400 schrieb Vickram Jain:
> Is there a way to generate sessions without using the WS-Addressing
> module?
>
> The consumer for my application has trouble dealing with XML as it is, 
> and so keeping our message pared down is important. I'd hate to have
> to fatten up my messages at this point.
>
> If this is not possible, then one other question: is addressing module
> only set to respond with a session token only if the caller uses the 
> addressing headers?


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





Re: WSDL2Java: WSDLProcessingException: Encoded use is not supported?

2007-05-03 Thread stefan_dragnev

Dims,

I'm sure the wsdl uses rpc/encoded because it contains the following
section:


http://schemas.xmlsoap.org/soap/http";
style="document"/>

  http://www.openuri.org/UpdateCategoriesReq"; style="rpc"/>
  
http://www.openuri.org/";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  
  
http://www.openuri.org/";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  


  http://www.openuri.org/BPDataReq";
style="rpc"/>
  
http://www.openuri.org/";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  
  
http://www.openuri.org/";
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
  

..


I know that rpc/encoded is not supported in WS-I basic profile but this WSDL
was developed some time ago and is used in production so I'm not sure
whether I will be allowed to modify. If I'm allowed to modify it what will
be the best way to do it so Axis2 1.2's wsdl2java will not throw errors?

Thanks.
Stefan


>I believe we are throwing better exceptions now...if you post the wsdl
>in a bug report, we can take a look to confirm that it is indeed an
>rpc/encoded wsdl which we don't support.
>
>thanks,
>dims

-- 
View this message in context: 
http://www.nabble.com/WSDL2Java%3A-WSDLProcessingException%3A-Encoded-use-is-not-supported--tf3678548.html#a10312820
Sent from the Axis - User mailing list archive at Nabble.com.


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



Appropriate place for transaction code?

2007-05-03 Thread Michael.Davis
Hi,

I'm new to Axis. I'm using Axis2 1.1.1.

I'm creating a service that retrieves data from a database. I'm using 
Hibernate. For those of you not familiar with it, the basic pattern of usage is 
that you create something called a SessionFactory once when the application 
starts, and then for each request/response cycle you create a Session. When the 
response finishes, you commit the session.

In regular web applications I create the session factory in the 
ApplicationContext. Then I make a servlet filter that creates the session and 
starts a transaction on the way in, and then commits the transaction and closes 
the session on the way out.

I'm trying to figure out how to do this in Axis. I created a module called 
hibernateTransactionModule. I've got two handlers, one for the way in and one 
for the way out, each attached to a new phase. Right now they're just saying 
'hello world' and it works, they do execute when I expect them to.

So I've got three classes:

HibernateTransactionModule implements org.apache.axis2.modules.Module
HibernateTransactionHandlerBegin extends AbstractHandler implements Handler
HibernateTransactionHandlerEnd extends AbstractHandler implements Handler

My intuition tells me that HibernateTransactionModule.init() would be the 
appropriate place to create the hibernate session factory, 
HibernateTransactionHandlerBegin.invoke() could create a session for a request 
and put it into the messageContext, and HibernateTransactionHandlerEnd.invoke() 
could commit the transaction and close the session.

But I can't see a place where I can store the session factory where it can be 
accessible to the handlers.

One possibility would be to use a static field in 
HibernateTransactionHandlerBegin but that would be an ugly hack. Any 
suggestions?

Thanks
Michael Davis
www.damaru.com

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



AbstractHTTPSender not releasing connection

2007-05-03 Thread Kang, Kamaljeet K.
Hi,

As per HTTPClient documentation if you are using
MultiThreadedhttpConnectionManager then for every
HttpClient.executeMethod there has to be corresponding
'releaseConnection' call. I do not see AbstractHttpSender releasing
connection anywhere in the code. Is this the reason why even after using
REUSE_HTTP_CLIENT, we see new HTTP connection created for every
request/response?



Thanks

Kamal

The information contained in this message may be privileged
and confidential and protected from disclosure. If the reader
of this message is not the intended recipient, or an employee
or agent responsible for delivering this message to the
intended recipient, you are hereby notified that any reproduction,
dissemination or distribution of this communication is strictly
prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and
deleting it from your computer. Thank you. Tellabs


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



Re: HELP - The attachments stream can only be accessed once; either by using the IncomingAttachmentStreams class or by getting a collection of AttachmentPart objects. They cannot both be called within

2007-05-03 Thread Glen Mazza
When debugging, work backwards.  The first error line of your stack
trace says go to line 546 of AttachmentsImpl[1], which appears to
indicate a mistake similar to what I mentioned earlier.  You are not
showing us your code, so I cannot help you further, but I think you are
making an invalid series of function calls to cause that error to occur.
Follow the Axis1 source code[1] and your own code to figure out what
sequence of calls you are making to cause that error to occur, and then
reimplement your code so you don't do that anymore.

If I may generalize your problem, this is your error message:
"You have called function foo() after calling function bar(), which is
disallowed."

And this is your source code:
a.bar();
a.foo();

Can you simplify your problem to this level, and then come back to this
ML for help in reimplementation?  I.e. "Hello everybody, this is what
I'm coding to accomplish X, but Axis 1.4 says this ordering of function
calls is disallowed.  How can I code it differently?"

Glen

[1] http://preview.tinyurl.com/32t97a


Am Donnerstag, den 03.05.2007, 12:46 -0500 schrieb Prasad Viswatmula:
> Here is my stack trace.  It's not from AXIOM.
> 
> java.lang.IllegalStateException: The attachments stream can only be
> accessed once; either by using the IncomingAttachmentStreams class or
> by getting a collection of AttachmentPart objects.  They cannot both
> be called within the life time of the same service request.
>   at 
> org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:546)
>   at org.apache.axis.Message.getContentLength(Message.java:511)
>   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>   at java.lang.reflect.Method.invoke(Unknown Source)
>   at 
> org.apache.axis.utils.BeanPropertyDescriptor.get(BeanPropertyDescriptor.java:127)
>   at 
> org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:192)
>   at 
> org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
>   at 
> org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
>   at 
> org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
>   at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
>   at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
>   at 
> org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
>   at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
>   at 
> org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
>   at 
> org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
>   at org.apache.axis.client.Call.invoke(Call.java:2757)
>   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 
> com.walsworth.od2.FileWebServiceSoapBindingStub.put(FileWebServiceSoapBindingStub.java:334)
>   at com.walsworth.od2.FileWSClient.main(FileWSClient.java:51)
> 
> On 5/2/07, Glen Mazza <[EMAIL PROTECTED]> wrote:
> > This may be related to AXIOM internally (I don't know if AXIOM is used
> > in Axis 1, however).  I googled the error message and it seems like the
> > only thing that could cause that error message to occur (search on "The
> > attachments stream" within [1]) is that you called *both* getPart() and
> > getIncomingAttachmentStreams() -- but you can only call one of the
> > methods.
> >
> > Glen
> >
> > [1]
> > http://mail-archives.apache.org/mod_mbox/ws-commons-dev/200703.mbox/%
> > [EMAIL PROTECTED]
> >
> > Am Mittwoch, den 02.05.2007, 16:20 -0500 schrieb Prasad Viswatmula:
> > > I am using Axis 1.4 and getting the above error.
> > >
> > > Thanks,
> > > Prasad
> > >



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



Re: HELP - The attachments stream can only be accessed once; either by using the IncomingAttachmentStreams class or by getting a collection of AttachmentPart objects. They cannot both be called within

2007-05-03 Thread Prasad Viswatmula

Here is my stack trace.  It's not from AXIOM.

java.lang.IllegalStateException: The attachments stream can only be
accessed once; either by using the IncomingAttachmentStreams class or
by getting a collection of AttachmentPart objects.  They cannot both
be called within the life time of the same service request.
at 
org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:546)
at org.apache.axis.Message.getContentLength(Message.java:511)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at 
org.apache.axis.utils.BeanPropertyDescriptor.get(BeanPropertyDescriptor.java:127)
at 
org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:192)
at 
org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1504)
at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:980)
at 
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:801)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:208)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:433)
at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
at 
org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:478)
at 
org.apache.axis.message.MessageElement.output(MessageElement.java:1208)
at org.apache.axis.client.Call.invoke(Call.java:2757)
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 
com.walsworth.od2.FileWebServiceSoapBindingStub.put(FileWebServiceSoapBindingStub.java:334)
at com.walsworth.od2.FileWSClient.main(FileWSClient.java:51)

On 5/2/07, Glen Mazza <[EMAIL PROTECTED]> wrote:

This may be related to AXIOM internally (I don't know if AXIOM is used
in Axis 1, however).  I googled the error message and it seems like the
only thing that could cause that error message to occur (search on "The
attachments stream" within [1]) is that you called *both* getPart() and
getIncomingAttachmentStreams() -- but you can only call one of the
methods.

Glen

[1]
http://mail-archives.apache.org/mod_mbox/ws-commons-dev/200703.mbox/%
[EMAIL PROTECTED]

Am Mittwoch, den 02.05.2007, 16:20 -0500 schrieb Prasad Viswatmula:
> I am using Axis 1.4 and getting the above error.
>
> Thanks,
> Prasad
>
> -
> 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]




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



Re: [axis2] error generating skeletons from WSDL 2.0

2007-05-03 Thread Glen Mazza
I had this problem too (and was able to quickly replicate rickcr's error
below).  The solution I found was to avoid using wsdl2java.sh and
instead using the code directly in that shell script:

./axis2.sh org.apache.axis2.wsdl.WSDL2Java  (place your params like -uri
here)

For some reason, that worked for me.  

Another option--one I would recommend--is to use the Apache Ant task for
code generation instead:
http://ws.apache.org/axis2/tools/1_1/CodegenToolReference.html#ant

Glen


Am Donnerstag, den 03.05.2007, 09:46 -0700 schrieb rickcr:
> 
> 
> Hans-Ulrich Klein wrote:
> > 
> > I wrote a wsdl 2.0 file and tried to generate skeletons with
> > wsdl2java.sh (axis2-1.2). After some unsuccessful attempts I used the
> > wsdl-file given in the w3c wsdl-primer (example 2-1):
> > http://www.w3.org/TR/2007/WD-wsdl20-primer-20070326/#basics-greath-scenario
> > (I attached the wsdl-file at the end of this mail.)
> > 
> > 
> > The first weird error appeared in the axis2.sh:
> > 
> > $ /opt/axis2-1.2/bin/wsdl2java.sh -uri myTest.wsdl -o . -s -d xmlbeans
> > -wv 2 -ss -sd
> > Using AXIS2_HOME:   /opt/axis2-1.2
> > Using JAVA_HOME:   /usr/lib/jvm/java-6-sun
> > /opt/axis2-1.2/bin/axis2.sh: line 38: [: !=: unary operator expected
> > Unrecognized option: -uri
> > Could not create the Java virtual machine.
> >  
> 
> I am receiving an identical error. Just doing wsdl2java.sh -uri  will
> generate the problem described above. (I'm trying it with just  wsdl2java.sh
> -uri pathToMyWsdl and getting the same error.)
> 
> Is there a fix for this? Thanks.


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



Re: [axis2] error generating skeletons from WSDL 2.0

2007-05-03 Thread rickcr



Hans-Ulrich Klein wrote:
> 
> I wrote a wsdl 2.0 file and tried to generate skeletons with
> wsdl2java.sh (axis2-1.2). After some unsuccessful attempts I used the
> wsdl-file given in the w3c wsdl-primer (example 2-1):
> http://www.w3.org/TR/2007/WD-wsdl20-primer-20070326/#basics-greath-scenario
> (I attached the wsdl-file at the end of this mail.)
> 
> 
> The first weird error appeared in the axis2.sh:
> 
> $ /opt/axis2-1.2/bin/wsdl2java.sh -uri myTest.wsdl -o . -s -d xmlbeans
> -wv 2 -ss -sd
> Using AXIS2_HOME:   /opt/axis2-1.2
> Using JAVA_HOME:   /usr/lib/jvm/java-6-sun
> /opt/axis2-1.2/bin/axis2.sh: line 38: [: !=: unary operator expected
> Unrecognized option: -uri
> Could not create the Java virtual machine.
>  

I am receiving an identical error. Just doing wsdl2java.sh -uri  will
generate the problem described above. (I'm trying it with just  wsdl2java.sh
-uri pathToMyWsdl and getting the same error.)

Is there a fix for this? Thanks.
-- 
View this message in context: 
http://www.nabble.com/-axis2--error-generating-skeletons-from-WSDL-2.0-tf3677500.html#a10308784
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: mtom and XMLBeans

2007-05-03 Thread robert lazarski

You have to use adb. There is a jira for xmlbeans and mtom but no work has
been started yet:

http://issues.apache.org/jira/browse/AXIS2-1031

Robert

On 5/3/07, alby < [EMAIL PROTECTED]> wrote:



Hi all,
I'm getting start with axis2 and I have a doubt...: is it possible to use
MTOM with XMLBeans databinding or do I have to use ADB? I tried to adapt
the
MTOM guide example to XMLBeans but i wasn't able to make it work...
dario
--
View this message in context:
http://www.nabble.com/Axis2%3A-mtom-and-XMLBeans-tf3686992.html#a10306530
Sent from the Axis - User mailing list archive at Nabble.com.


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




Axis2: mtom and XMLBeans

2007-05-03 Thread alby

Hi all,
I'm getting start with axis2 and I have a doubt...: is it possible to use
MTOM with XMLBeans databinding or do I have to use ADB? I tried to adapt the
MTOM guide example to XMLBeans but i wasn't able to make it work...
dario
-- 
View this message in context: 
http://www.nabble.com/Axis2%3A-mtom-and-XMLBeans-tf3686992.html#a10306530
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: Hot deployment problem

2007-05-03 Thread Deepal Jayasinghe
Could you please send me your service aar file,

Thanks
Deepal

>Hi all,
>
>I try to undeploy a axis2 archive by deleting the aar file in
>WEB-INF/services/.aar
>
>But , i've this message
>3 mai 2007 17:18:26 org.apache.axis2.deployment.DeploymentEngine
>unDeploy
>INFO: org.apache.axis2.deployment.DeploymentException: The 
>service group name is not valid.
>
>I try different MATA-INF/services.xml
> 1
>
>
>MyService
>
>   locked="false">mypackage.myCLasse
>
>http://www.w3.org/2004/08/wsdl/in-only";
> 
>class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
>http://www.w3.org/2004/08/wsdl/in-out";
> 
>class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>
> 
> /1
>
>
>
> 2
>
>
>
>MyService
>
>   locked="false">mypackage.myCLasse
>
>http://www.w3.org/2004/08/wsdl/in-only";
> 
>class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
>http://www.w3.org/2004/08/wsdl/in-out";
> 
>class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>
>
>
> /2
>
> 3
>
>
>
>MyService
>
>   locked="false">mypackage.myCLasse
>
>http://www.w3.org/2004/08/wsdl/in-only";
> 
>class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver"/>
>http://www.w3.org/2004/08/wsdl/in-out";
> 
>class="org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
>
>
>
> /3
>
>Any Idea?
>
>Olivier.
>
>
>Environnement : 
>Axis2 1.2
>Tomcat 5.5.23
>jdk1.5.0_11
>Windows XP
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>  
>

-- 
Thanks,
Deepal

"The highest tower is built one brick at a time"



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



Re: newbie help - how to build up an ADBBean?

2007-05-03 Thread no spam
thanks, Amila.  This and your other message are by far the most helpful 
responses I've gotten.  

Bob

- Original Message 
From: Amila Suriarachchi <[EMAIL PROTECTED]>
To: axis-user@ws.apache.org
Sent: Thursday, May 3, 2007 4:49:08 AM
Subject: Re: newbie help - how to build up an ADBBean?

hi this is your schema


  


  

  

  

  


  

the element  GetListItemsResult has a complex type which contains an s:any 
element 
So ADB generates a seperate class for this type with an OMElement (
i.e the  localExtraElement) So any xml element you want to send within the 
GetListItemsResult Element can be set using getter and setter methods of this 
class.

You can simply instanciate any ADB class using the new operator.


GetListItemsResponse getListItemsResponse = new GetListItemsResponse();
GetListItemsResult_type result = new GetListItemsResult_type():
result.setLocalExtraElement(set the OMElement);

and set variables with getter and setter methods.





eg. 

On 5/2/07, no spam <[EMAIL PROTECTED]> wrote:
Thanks, Anne, and also Martin.  Here is the complete WSDL file.  It's 
GetListItems and GetListItemChanges that I'm concerned with.


I think this stuff is unnecessarily a brain-twister.  Generating a new type 
which has almost nothing in it except "implements ADBBean" and some 
"extraElement" stuff which is never explained (and what IS that for, anyway?  
what's an "extra element"?) is not at all helpful to the implementor.  If all I 
want to do is provide some XML which is completely unconstrained (sequence of 
any), there ought to be a very intuitive way to do it.


Bob

- Original Message 
From: Anne Thomas
 Manes <[EMAIL PROTECTED]>
To: 
axis-user@ws.apache.org
Sent: Tuesday, May 1, 2007 2:27:18 AM
Subject: Re: newbie help - how to build up an ADBBean?

Bob,

Your challenge is that the element contains an . That's a

wildcard. ADB has no way of knowing what it might contain, therefore
it gives you an OMElement. It can't map it to a more defined object
because it doesn't know what kind of object it is. You must process it

as an OMElement.

How does the viewFields type relate to the request/response messages?
Can you provide more of the schema?

Anne

On 4/30/07, no spam <
[EMAIL PROTECTED]> wrote:
>
> thank you and I did read that, but it gives me no idea at all how to get the
> ADBBean from the OMElement (or whatever).  ADB javadocs, which I've also
> looked at, seem completely disconnected from everything else.

>
> Bob
>
> -
 Original Message 
> From: Davanum Srinivas <[EMAIL PROTECTED]>
> To: 
axis-user@ws.apache.org
> Sent: Monday, April 30, 2007 1:26:28 PM
> Subject: Re: newbie help - how to build up an ADBBean?
>
> see the OM tutorial -
> 
http://ws.apache.org/commons/axiom/OMTutorial.html
>
>
> On 4/30/07, no spam <[EMAIL PROTECTED]
> wrote:
> >
> >
> > I've generated some ADB code from Microsoft SharePoint WSDL, using the ADB
> > bindings.  Can someone give me some basic orientation?  Here are relevant

> > details:
> >
> > a schema fragment (useless, imho) from the wsdl is is:
> >
> >   
> >
 
> >   
> >  > name="GetListItemsResult">
> >   

> > 
> >   
> > 
> >   
>
 > 
> >   
> > 
> >   
> >
> > there is a setViewFields() call which I'd like to make.  It takes a

> > ViewFields_type14, which also tells me nothing:
> >
> > public static class ViewFields_type14
> > implements org.apache.axis2.databinding.ADBBean{
> > /* This type was generated from the piece of schema that had

> > name =
 viewFields_type14
> > Namespace URI =
> > http://schemas.microsoft.com/sharepoint/soap/

> > Namespace Prefix = ns1
> > */
> > /**
> > * field for ExtraElement
>
 > */
> > protected org.apache.axiom.om.OMElement
> > localExtraElement ;
> >/**
> >* Auto generated getter method

> >* @return
 org.apache.axiom.om.OMElement
> >*/
> >public
> org.apache.axiom.om.OMElement
> > getExtraElement(){
> >return localExtraElement;

> >}
>
 > /**
> >* Auto generated setter
> method
> >* @param param
> ExtraElement
> >*/

>
 >public void
> > setExtraElement(org.apache.axiom.om.OMElement param){
> >
> > this.localExtraElement=param;
> >}

> >
> >
> > the ADBBean interface also

Re: Issue with ADB and parsing a response message (namespaces)

2007-05-03 Thread Jorge Fernandez
I had a look at the JIRA. 'll try to do it. Thanks

Amila Suriarachchi <[EMAIL PROTECTED]> escribió:  earlier I have tested the adb 
server with adb client. but for xmlbeans server with adb client problem still 
exits.
see my comment on the https://issues.apache.org/jira/browse/AXIS2-2578 

  On 4/28/07, Jorge Fernandez <[EMAIL PROTECTED]> wrote:  Hi again Amila,
I've just downloaded and installed axis2 1.2. I built again the project from my 
wsdl and still get the same problem.

Thanks and Regards,

Jorge Fernández

Jorge Fernandez < [EMAIL PROTECTED]> escribió:In my test I was using axiom 
1.2.4 and I had the same problem as with 1.2.2

Amila Suriarachchi < [EMAIL PROTECTED]> escribió:  I ran your code with the 
branch code and the axiom-SNAPSHOT and it works fine. 
So the problem is with the axiom 1.2.2 you have to use the 1.2.4

Please try with the next RC.

  On 4/24/07, Jorge Fernandez < [EMAIL PROTECTED]> wrote:  Hi Amila, 

I tried again without the addressing module and I had the same exception I was 
having with axiom 1.2.2.

Regards,

Jorge Fernández Rodríguez



Amila Suriarachchi < [EMAIL PROTECTED]> escribió:  

On 4/23/07, Jorge Fernandez < [EMAIL PROTECTED]> wrote:  Sorry, I don't 
know what you mean.  
I think you use the  Axis2-1.2-RC2 release.  In that release you have a lib 
directory which contain axiom 1.2.3 jars. (i.e. axiom-api-1.2.3.jar, 
axiom-impl-1.2.3.jar ,axiom-dom-1.2.3.jar). Get the Axiom 1.2.4 release from 
here
http://ws.apache.org/commons/axiom/download.cgi and replace the 1.2.3 jars with 
the 1.2.4 jars. 

It seems that now you are getting some addressing problem. So please check it 
without addressing.


  Regards,

Jorge Fernández

Martin Gainty <[EMAIL PROTECTED]> escribió:  Jorge
  
I cannot display the url for your first namespace 
  http://external.communication_data_model.medici_link/xsd 
   
  M--
  This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is 
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
  From: Jorge Fernandez 
  To: axis-user@ws.apache.org ; [EMAIL PROTECTED] 
  Sent: Sunday, April 22, 2007 8:40 PM
  Subject: Re: Issue with ADB and parsing a response message (namespaces)
  

Hi,

I couldn't reproduce the error again. If you want I can open a JIRA but I can't 
attach any code. 

I had found another problem related with ADB parsing when there is some 
hierarchy and I raised JIRA 2578. 

Regards,

Jorge Fernández

Anne Thomas Manes < [EMAIL PROTECTED]> escribió:   Please file a JIRA.

On 4/20/07, Jorge Fernandez wrote:
> Hi all,
>
>
> I'm having problems with the namespaces of a response message like this:
>
> 
> xmlns:ns3=" http://op_messages.medici_link/xsd";>
> 
> xmlns:ns0=" http://external.communication_data_model.medici_link/xsd "
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance "
> xsi:type="ns0:extConfiguration">
> ..
> 
> xsi:type="ns0:extAbstractParameterDesc">
> .. 
> 
> ..
> 
> xsi:type="ns0:extPrimitiveParameterDesc">
> .
> 
> .. 
> 
> 
> 
> 
>
> 
> I have this exception when parsing the first element
> (ns0:abstractParameters):
>
> java.lang.RuntimeException: java.lang.RuntimeException : Unsupported type
> null extPrimitiveParameterDesc 
> at client.Medici_LinkStub.fromOM(Medici_LinkStub.java:5210)
> at
> client.Medici_LinkStub.getDetailedMonitoringStages(Medici_LinkStub.java:1945)
> at
> client.ClientUtilities.getDetailedMonitoringStagesTest 
> (ClientUtilities.java:244)
> at client.Client.main (Client.java:53)
> Caused by: java.lang.RuntimeException: Unsupported type null
> extPrimitiveParameterDesc
> at
> medici_link.op_messages.xsd.ExtensionMapper.getTypeObject(ExtensionMapperjava:181)
>  
> at
> medici_link.communication_data_model.external.xsd.ExtParameterDesc$Factory.parse(ExtParameterDesc.java:1171)
>  
> at
> medici_link.communication_data_model.external.xsd.ExtAbstractParameterDesc$Factory.parse(
>  ExtAbstractParameterDesc.java:1311)
> at
> medici_link.communication_data_model.external.xsd.ExtConfiguration$Factory.parse(
>  ExtConfiguration.java:923)
> at
> medici_link.communication_data_model.external.xsd.ExtStage$Factory.parse(ExtStage.java:650)
> at
> medici_link.op_messages.xsd.GetDetailedMonitoringStagesResponse$Factory.parse(
>  GetDetailedMonitoringStagesResponse.java :424)
> at client.Medici_LinkStub.fromOM(Medici_LinkStub.java:4833)
> .. 3 more
>
> I have a hierachy of classes:
>
> ExtAbstractParameterDesc and ExtPrimitiveParameterDesc that extend 
> ExtParameterDesc.
>
> I've been diving in my code that was created with WSDL2Java and ADB (Axis
> 1.1.1) and I could see that for 

Hot deployment problem

2007-05-03 Thread Olivier DUGAST


Hi all,

I try to undeploy a axis2 archive by deleting the aar file in
WEB-INF/services/.aar

But , i've this message
3 mai 2007 17:18:26 org.apache.axis2.deployment.DeploymentEngine
unDeploy
INFO: org.apache.axis2.deployment.DeploymentException: The 
service group name is not valid.

I try different MATA-INF/services.xml
 1


MyService

mypackage.myCLasse

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



 2



MyService

mypackage.myCLasse

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

 
 /2

 3



MyService

mypackage.myCLasse

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

 
 /3

Any Idea?

Olivier.


Environnement : 
Axis2 1.2
Tomcat 5.5.23
jdk1.5.0_11
Windows XP


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



Re: [Axis2] AXIOM Custom Serializer/Deserializer

2007-05-03 Thread Davanum Srinivas

Xinjun,

can you run tcpmon to capture the soap request and use that xml with
your stand alone program to see if that works?

-- dims

On 5/3/07, Xinjun Chen <[EMAIL PROTECTED]> wrote:



Hi,

I wrote a sample custom serializer/deserializer to serialize an object. When
I use a standalone program to test the serializer, it works fine. But when I
deploy the serializer as part of a web service and and invoke the web
service through a SOAP request, I got the following null pointer execption.
I googled but didn't find the reason of this. Why does the NPE occur only
when I deploy the binder as part of the web service? I used the same
SOAPEnvelope to test.



java.lang.NullPointerException
at
org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents(OMStAXWrap
per.java:1115)
at
org.apache.axiom.om.impl.llom.OMStAXWrapper.next(OMStAXWrapper.java:9
 11)
at
com.mycom.CreditCardPaymentRequestBinder.toObject(CreditCardPaymentRequestBinder.java:138)



The toObject method definition is as follows:

 public CreditCardPaymentRequest toObject(QName qname, XMLStreamReader
reader) throws XMLStreamException {
  CreditCardPaymentRequest obj = new CreditCardPaymentRequest();

  String rootElementName = qname.getLocalPart ();
  String uri = qname.getNamespaceURI();

  if(!rootNsUri.equals(uri)) {
   throw new XMLStreamException("Invalid namespace " + uri + ". Expected
namespace uri is " + rootNsUri);
  }

  while(reader.hasNext()) {
   int type = reader.next(); // Line number: 138

   if(XMLStreamConstants.START_ELEMENT == type){
String element = reader.getLocalName();

if( rootLocalName.equals(element) ) {
 continue;
} else if( element.equals("cardNumber") ){
 obj.setCardNumber(reader.getElementText());
} else if( element.equals("expiryMonth") ) {
 obj.setExpiryMonth(reader.getElementText());
} else if( element.equals("expiryYear") ) {
 obj.setExpiryYear(reader.getElementText());
} else if( element.equals("brand") ) {
 obj.setBrand(reader.getElementText());
} else if( element.equals("totalAmount") ) {
 obj.setTotalAmount(reader.getElementText());
} else if( element.equals("currency") ) {
 obj.setCurrency(reader.getElementText());
} else if( element.equals("systemId") ) {
 obj.setSystemId(reader.getElementText());
} else if( element.equals("referenceNumber") ) {
 obj.setReferenceNumber(reader.getElementText());
} else if( element.equals("op") ) {
 obj.setOp(reader.getElementText());
} else {
 throw new RuntimeException("Unexpected element " + element);
}
   }

   if(XMLStreamConstants.END_ELEMENT == type){
if(reader.getLocalName().equals(rootElementName)){
 break;
}
   }

  }

  return obj;
 }





Regards,

Xinjun



--
Davanum Srinivas :: http://davanum.wordpress.com

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



Re: [Axis2] stub sending text/xml instead of application/x-www-form-urlencoded

2007-05-03 Thread Davanum Srinivas

Brad,

Could you please log a bug in JIRA and upload your wsdl. Something is
seriously wrong esp with the StackOverflowError.

thanks,
dims

On 5/3/07, Brad <[EMAIL PROTECTED]> wrote:

Hi all,

I've generated client classes from a WSDL doc using the following command line:

wsdl2java.bat -pn xSoap -o src -d xmlbeans -uri xxx.wsdl

It all works fine but when I try to invoke the remote service I get
the following error:

org.apache.axis2.AxisFault: Transport error 500 . Error Message is
Request format is invalid: text/xml; charset=UTF-8.
;

Which is fair enough as the server is expecting content type
"application/x-www-form-urlencoded", as specified in the WSDL:




 






Is there any way to over ride the content type? I tried this:

Options opts = new Options();
opts.setProperty(Configuration.CONTENT_TYPE,
HTTPConstants.MEDIA_TYPE_X_WWW_FORM);
opts.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
client.setOptions(opts);

I get the same error though. I tried client.setOverrideOptions(opts)
as well but no change. Using them both causes a StackOverflowError :-)

Any help greatly appreciated!

Cheers,
Brad.

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





--
Davanum Srinivas :: http://davanum.wordpress.com

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



Re: WSDL2Java: WSDLProcessingException: Encoded use is not supported?

2007-05-03 Thread Davanum Srinivas

Stefan,

It was not supported even in earlier versions of Axis2..we were just
not throwing exceptions properly.

-- dims

On 5/3/07, stefan_dragnev <[EMAIL PROTECTED]> wrote:


I have the same problem as wolverine my and was wondering what is the reason
for rpc/encoded no longer being supported in axis2 version 1.2. Is there a
document which describes what WSDL features are supported by wsdl2java tool
in axis2 1.1.1 and axis2. 1.2. If there is such document I will appreciate
it to get a link to it.

Thanks,
Stefan
--
View this message in context: 
http://www.nabble.com/WSDL2Java%3A-WSDLProcessingException%3A-Encoded-use-is-not-supported--tf3678548.html#a10305922
Sent from the Axis - User mailing list archive at Nabble.com.


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





--
Davanum Srinivas :: http://davanum.wordpress.com

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



Re: WSDL2Java: WSDLProcessingException: Encoded use is not supported?

2007-05-03 Thread stefan_dragnev

I have the same problem as wolverine my and was wondering what is the reason
for rpc/encoded no longer being supported in axis2 version 1.2. Is there a
document which describes what WSDL features are supported by wsdl2java tool
in axis2 1.1.1 and axis2. 1.2. If there is such document I will appreciate
it to get a link to it.

Thanks,
Stefan
-- 
View this message in context: 
http://www.nabble.com/WSDL2Java%3A-WSDLProcessingException%3A-Encoded-use-is-not-supported--tf3678548.html#a10305922
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: wsdl2java -u option question

2007-05-03 Thread Michael Davis
Thanks!

I just noticed, after sending that message, that wsdl2java still
generates 5MB of source code with the -u option, it just spreads it out
over many classes and packages.

I'm still surprised at the quantity of generated code, just to all one
trivial service! I'm not complaining, I'm just baffled. I've looked at
some random generated classes and see nothing specific to my service.

cheers
Michael Davis



Quoting Amila Suriarachchi <[EMAIL PROTECTED]>:

> On 5/2/07, Michael Davis <[EMAIL PROTECTED]> wrote:
> >
> > Hello,
> >
> > I'm new to Axis. I'm using the latest version, 1.2, and I've
> created a
> > simple web service that takes three strings and returns a string.
> >
> > I created a client using wsdl2java. It works fine, but it creates
> three
> > source files that are 5M in size. Is this expected behaviour, or is
> it
> > a clue that something's wrong?
> >
> > If I use the -u option (which unpacks the databinding classes),
> then the
> > generated files are all under 30k. (Still large, but much smaller
> than
> > 5M.) So given that the code is 100x smaller with the -u option,
> what
> > functionality gets left out when using it?
>
>
> nothing. The compact version is use full if you concern about the
> number of
> classes.
>
> Thanks,
> > Michael Davis
> > www.damaru.com
> >
> >
> >
> >
> >
> >
> >
> >
> -
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
>
>
> --
> Amila Suriarachchi,
> WSO2 Inc.
>


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



Re: Axis2 performance and listener process construction

2007-05-03 Thread Sanjiva Weerawarana
Perhaps I can help .. on a Linux box multiple Java threads sometimes get 
listed as different processes using "ps". Are you on a Linux box?


We do NOT create multiple processes for anything .. so what you're 
observing is some weird reporting of the threads in the system.


Now that doesn't give any explanation for why your second listener isn't 
gracefully going away after the interactions are over; it is most 
certainly supposed to!


Sanjiva.

Paul Fremantle wrote:

Toon

Two things:

1) you can modify the default Sandesha timing parameters by editing
the module.xml inside META-INF in sandesha2.mar. The default timing
parameters are:
RetransmissionInterval 6s (6000ms)
InactivityTimeout 60s

2) When you do setUseSeparateListener, Axis2 does not spawn a new
process. It spawns a thread. So I'm still confused as to what is going
on!.

Paul



On Wed, 2007-05-02 at 13:34 +0200, Toon Wouters wrote:
> Paul
>
> Thanks for your reply. You're right about the timing, seems there was
> a communication problem with my colleague, my appologies. I just tried
> it without Sandesha and it is indeed quite fast.
>
> To get back to the listener question what I mean is the seperate
> listener logic which comes with Axis2 to provide a seperate transport
> channel back from the server to the client to receive responses on (so
> you can receive asynchronous responses at any time for example). The
> listener process listens on port 6060 by default. The code to enable
> the seperate transport channel in java is:
>
> clientOptions.setUseSeparateListener(true);
>
> After which we set the options for our ServiceClient instance. Hopes
> this clarifies it.
> The reason i'm asking about this is because we're having some
> cleanup/rebinding issues with this process. Often when the client
> exits the listener process keeps running en suddenly goes berserk
> consuming all cpu time. This shows in windows task manager as a
> seperate java process.
>
> Toon
>
> On 5/2/07, Paul Fremantle <[EMAIL PROTECTED]> wrote:
> Toon
>
> I'm surprised you are getting those results. The Sandesha2
> code isn't
> tuned and the timing parameters are not optimized for fast
> exchange,
> but without Sandesha2 the Axis2 calls should take about 100ms
> for 10
> calls.
>
> Do you have some sample code I can try?
>
> Also I don't understand the comment about a separate process.
> As far
> as I know Axis2 and Sandesha never start new processes. Can
> you give
> us more details please?
>
> Paul
>
>
>
> On 5/2/07, T W <[EMAIL PROTECTED]> wrote:
> > Hi, we're fairly new to Axis2 in general but lately we've
> been writing a
> > small web service to test the Sandesha2 WS-RM stack with
> Axis2. We have
> > however two questions:
> >
> > 1. Is it normal that it takes about 15 seconds to make 10
> synchronous
> > requests? We are just calling a simple Web service operation
> which takes 3
> > integers as input parameters and returns an integer so the
> payload is never
> > large. We have even looked at the requests and responses
> being sent/received
> > on the wire and there is nothing out of the ordinary. To
> send our messages
> > we're calling the sendReceive() method on the ServiceClient
> interface. The
> > test is running locally (both sender and receiver) on a
> modern laptop (
> > 1.6ghz mobile). No special configuration of Axis2 has been
> done (besides
> > Sandesha2, but even before adding that it was just as
> slow).
> >
> > 2. Could anyone explain why when using a listener as a
> reponse channel this
> > appears to be a seperate process? Is the process shared by
> multiple clients?
> > And why did the developers not opt for a thread instead?
> When a request is
> > made from the client side, does it also pass through the
> listening process
> > (we're guessing no, as the listener is optional)? Does this
> have anything to
> > do with reusing the same socket as a response channel for
> multiple clients?
> >
> > Those are just some of the things we've noticed, if someone
> could clarify
> > this a little it would help us alot.
> >
> > Thanks,
> > Toon
> >
>
>
> --
> Paul Fremantle
> VP/Technology, WSO2 and OASIS WS-RX TC Co-chair
>
> http://bloglines.com/blog/paulfremantle
> [EMAIL PROTECTED]
>
> "Oxygenating the Web Service Platform", www.wso2.com
>
> 
-

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

Re: [Axis2] Rampart 1.2

2007-05-03 Thread Sanjiva Weerawarana

Its still coming ..

Sanjiva.

Damien Sauvageot wrote:

Hello,

Rampart 1.2 is missing from download page 
http://ws.apache.org/axis2/modules/index.html
It still refers to version 1.1 
http://www.apache.org/dyn/mirrors/mirrors.cgi/ws/rampart/1_1/rampart-1.1.zip 



I did not find rampart 1.2 anywhere. Could you please tell me where I 
can download it as for now I am stucked

with

java.lang.NoSuchMethodError: org.apache.axis2.context.MessageContext.isE
ngaged(Ljavax/xml/namespace/QName;)

which is apparently due to refactoring of this method in Axis version 1.2.

Thanks for your help,

Damien Sauvageot


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




--
Sanjiva Weerawarana, Ph.D.
Founder & Director; Lanka Software Foundation; http://www.opensource.lk/
Founder, Chairman & CEO; WSO2, Inc.; http://www.wso2.com/
Director; Open Source Initiative; http://www.opensource.org/
Member; Apache Software Foundation; http://www.apache.org/
Visiting Lecturer; University of Moratuwa; http://www.cse.mrt.ac.lk/

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



Re: Question on getFirstChildWithName(qName) within an iterator?

2007-05-03 Thread Martin Gainty

Craig-

you may have a constraint on your WSDL for maxOccurs ="1" for the element 
you are anticipating

will be a list
Please post the wsdl to verify

Martin--
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

- Original Message - 
From: "Hickman, Craig" <[EMAIL PROTECTED]>

To: 
Sent: Tuesday, May 01, 2007 7:49 PM
Subject: Question on getFirstChildWithName(qName) within an iterator?




Working for a company that wants to hide much of the complexity of the 
Axis2

api.

I've been building some helper methods to allow the ability to use a set 
of

beans to manipulate and bind the xml to the POJO's without the need for
using the code generation tools, which is something the developers at this
company wish to refrain from using if possible.

So here is my problem:

I get the root element and then

   //GET THE FIRST ELEMENT
   OMElement root = utils.getOMRootElement(envelope);
   // SET THE PARTNER SERVICE OBJECTS
   QName serviceQN = new QName(WSConstants.SERVICE_ELEMENT);
   Iterator serviceIter =  root.getChildrenWithName(serviceQN);
   getService(serviceIter);

 //-- private method --//
  private void getService(Iterator serv) {
Map aMap = new HashMap();

//-- pass in iterator and constants for simple xml element
parsing --//
try {
aMap = utils.getSimpleOMSubElement(serv,
this.getServiceConstants()); // the utility method as seen below
int mapsize = aMap.size();

Iterator keyValuePairs1 =
aMap.entrySet().iterator();
for (int i = 0; i < mapsize; i++)
{
  Map.Entry entry = (Map.Entry)
keyValuePairs1.next();
  Object key = entry.getKey();
  Object value = entry.getValue();
  logger.debug("< map values  "
+value.toString());
  getServiceElementsSwitch(key, value);
}
} catch (SOAPException e) {
logger.debug("getService SOAPException"
+e.getMessage());
e.printStackTrace();
} catch (XMLStreamException e) {
logger.debug("getService XMLStreamException"
+e.getMessage());
e.printStackTrace();
}
}

I pass in a list of the binded elements as strings in a list so that I can
iterate through them and then use the getChildWithNames iterator.
My only problem is that I can only get the first element text value even
though I loop through the list and pass I a new qName each time.
I have even tried another helper to get the text value taking in the
iterator and and the string value for the qName, but this still brings 
back

only one of the text values.

Am I missing something? I've logged it to make sure I'm iterating with the
correct elements for the binding, and have run test to make sure the 
payload

of text value is correct.


  /**
* Walk the xml tree of elements
* get the simple element and put
* in map object for return.
*
* @param serv
* @throws XMLStreamException
* @throws SOAPException
* @return Map map
*/
   public Map getSimpleOMSubElement(Iterator iter, List wsConstants)
throws SOAPException, XMLStreamException {
   int j = 1;
   String qName = "";
   String text = "";

   for (j = 0; j < wsConstants.size(); j++) {
   qName = (String)wsConstants.get(j);
   logger.debug("qName = " +qName);
   while (iter.hasNext()) {
   Object o = iter.next();

   if  (o instanceof OMElement) {
   OMElement c = (OMElement) o;
   OMElement element =
getOMElement(c, qName); // helpe method - takes element and constant 
string

   text = element.getText();
   }

   j++;
   logger.debug("text = " + j + "" +text);
   map.put(j, text);
   }
   }
   return map;
   }

   /**
 * Helper method to get the text elements in a type safe fashion
 *
* @param element
* @param name
* @return
*/
  public  OMElement getOMElement(OMElement result, String element)
   throws SOAPException, XMLStreamException {

   QName qName = new QName(element);
   if (qName == null) {
 throw new RuntimeException("Missing required method
element.");
   }

   Iterator i = result.getChildrenWithName(qName);
   if (! i.hasNext()) {
 throw new RuntimeException("Missing required  element.");
   }

   OMElement omElement = (OMElement

Re: what is "extraElement"?

2007-05-03 Thread Amila Suriarachchi

use minOccures and maxOccurs


On 5/3/07, Anne Thomas Manes <[EMAIL PROTECTED]> wrote:


The xsd:any (there's only one) will map to a single OMElement -- which
may in turn contain anything. Therefore, the xsd:any is the last
element (only element) in your sequence).

Anne

On 5/2/07, no spam <[EMAIL PROTECTED]> wrote:
>
> ok, but this seems to be thinking of an xsd:any element as the last item
in
> a sequence, for extensibility purposes, most likely.  That's not the
case
> here.
>
> In the WSDL case I sent earlier, Microsoft has kindly made "ViewFields"
> essentially nothing BUT a sequence of xsd:any.   It's like a C interface
> where everything is a void *.
>
> Excerpt:
>
>
>   
> 
>   
> 
>   
> 
>
> So I don't want just one "extra element", but N of them.   (or to be
more
> precise, there IS just one extra, but inside it is a sequence of a whole
> bunch of them.)
>
> Bob
>
>
> - Original Message 
> From: Davanum Srinivas <[EMAIL PROTECTED]>
> To: axis-user@ws.apache.org
> Sent: Tuesday, May 1, 2007 6:03:59 PM
> Subject: Re: what is "extraElement"?
>
> if your schema has xsd:any or similar construct, we generate code for
> attaching extra elements. You are supposed to construct OMElement's
> and call the setter for sending data and on the other side you can use
> the getter for the extra element to get the extra data corresponding
> to the schema construct.
>
> -- dims
>
> On 5/1/07, no spam <[EMAIL PROTECTED]> wrote:
> >
> > ok, here is a simpler question than my previous ones:
> >
> >  what is the purpose of the "extraElement" in all the generated Java
code?
> > I have not been able to find Word One of documentation anywhere on
this.
> I
> > did get a "extra element cannot be null" exception in some code that I
ran
> > as an experiment, so obviously it must do something.
> >
> > Bob
> >
> >  
> > Ahhh...imagining that irresistible "new car" smell?
> >  Check out new cars at Yahoo! Autos.
>
>
> --
> Davanum Srinivas :: http://davanum.wordpress.com
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>  
> Ahhh...imagining that irresistible "new car" smell?
>  Check out new cars at Yahoo! Autos.

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





--
Amila Suriarachchi,
WSO2 Inc.


Re: wsdl2java -u option question

2007-05-03 Thread Amila Suriarachchi

On 5/2/07, Michael Davis <[EMAIL PROTECTED]> wrote:


Hello,

I'm new to Axis. I'm using the latest version, 1.2, and I've created a
simple web service that takes three strings and returns a string.

I created a client using wsdl2java. It works fine, but it creates three
source files that are 5M in size. Is this expected behaviour, or is it
a clue that something's wrong?

If I use the -u option (which unpacks the databinding classes), then the
generated files are all under 30k. (Still large, but much smaller than
5M.) So given that the code is 100x smaller with the -u option, what
functionality gets left out when using it?



nothing. The compact version is use full if you concern about the number of
classes.

Thanks,

Michael Davis
www.damaru.com







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





--
Amila Suriarachchi,
WSO2 Inc.


Re: newbie help - how to build up an ADBBean?

2007-05-03 Thread Amila Suriarachchi

See this code sample

GetListResponse getListResponse = new GetListResponse();
   GetListResult_type0 getListResult_type0 = new GetListResult_type0();

   OMFactory omFactory = OMAbstractFactory.getOMFactory();
   OMNamespace omNamespace = omFactory.createOMNamespace("
http://test.com","ns1";);
   OMElement omElement = omFactory.createOMElement("test",omNamespace);
   omElement.setText("text");
   getListResult_type0.setExtraElement(omElement);

   getListResponse.setGetListResult(getListResult_type0);

   OMElement responseElement = getListResponse.getOMElement(
GetListResponse.MY_QNAME,OMAbstractFactory.getSOAP11Factory());
   try {
   String responseString = responseElement.toStringWithConsume();
   System.out.println("Response " + responseString);
   } catch (XMLStreamException e) {
   e.printStackTrace();  //To change body of catch statement use
File | Settings | File Templates.
   }

On 5/3/07, Amila Suriarachchi <[EMAIL PROTECTED]> wrote:


hi this is your schema


  

  

  

  

  

  

the element  GetListItemsResult has a complex type which contains an s:any
element
So ADB generates a seperate class for this type with an OMElement ( i.ethe 
localExtraElement) So any xml element you want to send within the
GetListItemsResult Element can be set using getter and setter methods of
this class.

You can simply instanciate any ADB class using the new operator.

GetListItemsResponse getListItemsResponse = new GetListItemsResponse();
GetListItemsResult_type result = new GetListItemsResult_type():
result.setLocalExtraElement(set the OMElement);

and set variables with getter and setter methods.




eg.

On 5/2/07, no spam <[EMAIL PROTECTED]> wrote:
>
> Thanks, Anne, and also Martin.  Here is the complete WSDL file.  It's
> GetListItems and GetListItemChanges that I'm concerned with.
>
> I think this stuff is unnecessarily a brain-twister.  Generating a new
> type which has almost nothing in it except "implements ADBBean" and some
> "extraElement" stuff which is never explained (and what IS that for,
> anyway?  what's an "extra element"?) is not at all helpful to the
> implementor.  If all I want to do is provide some XML which is completely
> unconstrained (sequence of any), there ought to be a very intuitive way to
> do it.
>
> Bob
>
> - Original Message 
> From: Anne Thomas Manes <[EMAIL PROTECTED]>
> To: axis-user@ws.apache.org
> Sent: Tuesday, May 1, 2007 2:27:18 AM
> Subject: Re: newbie help - how to build up an ADBBean?
>
> Bob,
>
> Your challenge is that the element contains an . That's a
> wildcard. ADB has no way of knowing what it might contain, therefore
> it gives you an OMElement. It can't map it to a more defined object
> because it doesn't know what kind of object it is. You must process it
> as an OMElement.
>
> How does the viewFields type relate to the request/response messages?
> Can you provide more of the schema?
>
> Anne
>
> On 4/30/07, no spam < [EMAIL PROTECTED]> wrote:
> >
> > thank you and I did read that, but it gives me no idea at all how to
> get the
> > ADBBean from the OMElement (or whatever).  ADB javadocs, which I've
> also
> > looked at, seem completely disconnected from everything else.
> >
> > Bob
> >
> > - Original Message 
> > From: Davanum Srinivas <[EMAIL PROTECTED]>
> > To: axis-user@ws.apache.org
> > Sent: Monday, April 30, 2007 1:26:28 PM
> > Subject: Re: newbie help - how to build up an ADBBean?
> >
> > see the OM tutorial -
> > http://ws.apache.org/commons/axiom/OMTutorial.html
> >
> >
> > On 4/30/07, no spam <[EMAIL PROTECTED] > wrote:
> > >
> > >
> > > I've generated some ADB code from Microsoft SharePoint WSDL, using
> the ADB
> > > bindings.  Can someone give me some basic orientation?  Here are
> relevant
> > > details:
> > >
> > > a schema fragment (useless, imho) from the wsdl is is:
> > >
> > >   
> > > 
> > >   
> > >  > > name="GetListItemsResult">
> > >   
> > > 
> > >   
> > > 
> > >   
> > > 
> > >   
> > > 
> > >   
> > >
> > > there is a setViewFields() call which I'd like to make.  It takes a
> > > ViewFields_type14, which also tells me nothing:
> > >
> > > public static class ViewFields_type14
> > > implements org.apache.axis2.databinding.ADBBean{
> > > /* This type was generated from the piece of schema that had
>
> > > name = viewFields_type14
> > > Namespace URI =
> > > http://schemas.microsoft.com/sharepoint/soap/
> > > Namespace Prefix = ns1
> > > */
> > > /**
> > > * field for ExtraElement
> > > */
> > > protect

Re: newbie help - how to build up an ADBBean?

2007-05-03 Thread Amila Suriarachchi

hi this is your schema

   
 
   
 
   
 
   
 
   
 
   
 

the element  GetListItemsResult has a complex type which contains an s:any
element
So ADB generates a seperate class for this type with an OMElement (i.e the
localExtraElement) So any xml element you want to send within the
GetListItemsResult Element can be set using getter and setter methods of
this class.

You can simply instanciate any ADB class using the new operator.

GetListItemsResponse getListItemsResponse = new GetListItemsResponse();
GetListItemsResult_type result = new GetListItemsResult_type():
result.setLocalExtraElement(set the OMElement);

and set variables with getter and setter methods.




eg.

On 5/2/07, no spam <[EMAIL PROTECTED]> wrote:


Thanks, Anne, and also Martin.  Here is the complete WSDL file.  It's
GetListItems and GetListItemChanges that I'm concerned with.

I think this stuff is unnecessarily a brain-twister.  Generating a new
type which has almost nothing in it except "implements ADBBean" and some
"extraElement" stuff which is never explained (and what IS that for,
anyway?  what's an "extra element"?) is not at all helpful to the
implementor.  If all I want to do is provide some XML which is completely
unconstrained (sequence of any), there ought to be a very intuitive way to
do it.

Bob

- Original Message 
From: Anne Thomas Manes <[EMAIL PROTECTED]>
To: axis-user@ws.apache.org
Sent: Tuesday, May 1, 2007 2:27:18 AM
Subject: Re: newbie help - how to build up an ADBBean?

Bob,

Your challenge is that the element contains an . That's a
wildcard. ADB has no way of knowing what it might contain, therefore
it gives you an OMElement. It can't map it to a more defined object
because it doesn't know what kind of object it is. You must process it
as an OMElement.

How does the viewFields type relate to the request/response messages?
Can you provide more of the schema?

Anne

On 4/30/07, no spam <[EMAIL PROTECTED]> wrote:
>
> thank you and I did read that, but it gives me no idea at all how to get
the
> ADBBean from the OMElement (or whatever).  ADB javadocs, which I've also
> looked at, seem completely disconnected from everything else.
>
> Bob
>
> - Original Message 
> From: Davanum Srinivas <[EMAIL PROTECTED]>
> To: axis-user@ws.apache.org
> Sent: Monday, April 30, 2007 1:26:28 PM
> Subject: Re: newbie help - how to build up an ADBBean?
>
> see the OM tutorial -
> http://ws.apache.org/commons/axiom/OMTutorial.html
>
>
> On 4/30/07, no spam <[EMAIL PROTECTED]> wrote:
> >
> >
> > I've generated some ADB code from Microsoft SharePoint WSDL, using the
ADB
> > bindings.  Can someone give me some basic orientation?  Here are
relevant
> > details:
> >
> > a schema fragment (useless, imho) from the wsdl is is:
> >
> >   
> > 
> >   
> >  > name="GetListItemsResult">
> >   
> > 
> >   
> > 
> >   
> > 
> >   
> > 
> >   
> >
> > there is a setViewFields() call which I'd like to make.  It takes a
> > ViewFields_type14, which also tells me nothing:
> >
> > public static class ViewFields_type14
> > implements org.apache.axis2.databinding.ADBBean{
> > /* This type was generated from the piece of schema that had
> > name = viewFields_type14
> > Namespace URI =
> > http://schemas.microsoft.com/sharepoint/soap/
> > Namespace Prefix = ns1
> > */
> > /**
> > * field for ExtraElement
> > */
> > protected org.apache.axiom.om.OMElement
> > localExtraElement ;
> >/**
> >* Auto generated getter method
> >* @return org.apache.axiom.om.OMElement
> >*/
> >public
> org.apache.axiom.om.OMElement
> > getExtraElement(){
> >return localExtraElement;
> >}
> > /**
> >* Auto generated setter
> method
> >* @param param
> ExtraElement
> >*/
> >public void
> > setExtraElement(org.apache.axiom.om.OMElement param){
> >
> > this.localExtraElement=param;
> >}
> >
> >
> > the ADBBean interface also has nothing in it but a getPullParser()
method.
> > So how can I build up a ViewFields_type14 such that the Java compiler
will
> > be happy?  I've spent at least an hour poring over the ADB
documentation
> and
> > so far extracted nothing actionable.  How about a code sample?
> >
> > Bob
> >
> >
> >  
> > Ahhh...imagini

[Axis] Rampart examples - Username token password verification

2007-05-03 Thread Stefan Magnus Landrø

Hi,

I've been looking at the rampart examples recently, but there are a
couple things that I don't understand:

How do the sample services in the rampart distribution verify the password?
Why do the services.xml include a reference to a password callback handler?

Cheers,

Stefan

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



Axis namespace rewriting on web service responses and WS-Security

2007-05-03 Thread Brian Nielsen
Hi.

I have a problem with Axis 1.4 regarding namespace rewriting and WS-Security.

I call a BEA ALSB Proxy Service that signs the response message. The response 
message includes WS-Addressing elements, using the namespace prefix "wsa", and 
they are included in the signature.
If I verify the signature using WSS4J directly (no Axis is involved) everything 
is fine. However, if I use WSS4J with Axis, the signature references to the 
WS-Adressing elements results in "Verification failed" (as seen in the WSS4J 
log). All other references in the signature results in "Verification 
successful". The difference in the two scenarios are that Axis seems to rewrite 
the "wsa" prefix to "ns1", "ns2" and so on for each WS-Addressing element. This 
obviously would cause the signature to become invalid. The funny thing is that 
only WS-Addressing elements are rewritten.

Below are snippets from the response in the two scenarios.

Is there anything I can do to avoid this problem other than changing the policy 
file on the ALSB to not include WS-Addressing in the signature?`
I have already inserted

in the client-config.wsdd file.


Snippet from response without Axis (i.e. what BEA ALSB sends as a response):

   http://schemas.xmlsoap.org/ws/2004/08/addressing";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
  http://xsd.efpi.dk/2007/03/30/eFPI-DokUdv/Header-eFPI-Kvittering";
 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>
 AfsenderAktoer
 
    
uuid:6d9d75a0-f88b-11db-9403-cce216df29cd
 
 
    Afsender Reference
 
  
  
 uuid:38adc450-f8b6-11db-b677-abd29d2f5002
  
  http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>
 http://localhost:7001/DokUdv.eFPI
  
  
 
http://service.efpi.dk/2007/03/30/DokUdv.eFPI/SendDokPak
  
  
 
    
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
 
  


Snippet from response using Axis client:


http://schemas.xmlsoap.org/soap/envelope/";>
   
  http://xsd.efpi.dk/2007/03/30/eFPI-DokUdv/Header-eFPI-Kvittering";
 
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";>
 AfsenderAktoer
 
    
uuid:6d9d75a0-f88b-11db-9403-cce216df29cd
 
 
    Afsender Reference
 
  
  http://schemas.xmlsoap.org/ws/2004/08/addressing";>
 uuid:4c4954e0-f8cd-11db-b9e2-a3c96c42c75e
  
  http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
     
xmlns:ns2="http://schemas.xmlsoap.org/ws/2004/08/addressing";>
 http://localhost:7001/DokUdv.eFPI
  
  http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd";
     
xmlns:ns3="http://schemas.xmlsoap.org/ws/2004/08/addressing";>
 
http://service.efpi.dk/2007/03/30/DokUdv.eFPI/SendDokPak
  
  http://schemas.xmlsoap.org/ws/2004/08/addressing";>
 
    
http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous
 
  


Regards,

Brian Nielsen


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



[Axis2] stub sending text/xml instead of application/x-www-form-urlencoded

2007-05-03 Thread Brad

Hi all,

I've generated client classes from a WSDL doc using the following command line:

wsdl2java.bat -pn xSoap -o src -d xmlbeans -uri xxx.wsdl

It all works fine but when I try to invoke the remote service I get
the following error:

org.apache.axis2.AxisFault: Transport error 500 . Error Message is
Request format is invalid: text/xml; charset=UTF-8.
;

Which is fair enough as the server is expecting content type
"application/x-www-form-urlencoded", as specified in the WSDL:


   
   

   
   
   
   


Is there any way to over ride the content type? I tried this:

Options opts = new Options();
opts.setProperty(Configuration.CONTENT_TYPE,
HTTPConstants.MEDIA_TYPE_X_WWW_FORM);
opts.setProperty(HTTPConstants.CHUNKED, Boolean.FALSE);
client.setOptions(opts);

I get the same error though. I tried client.setOverrideOptions(opts)
as well but no change. Using them both causes a StackOverflowError :-)

Any help greatly appreciated!

Cheers,
Brad.

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



[Axis2] AXIOM Custom Serializer/Deserializer

2007-05-03 Thread Xinjun Chen

Hi,

I wrote a sample custom serializer/deserializer to serialize an object. When
I use a standalone program to test the serializer, it works fine. But when
I deploy the serializer as part of a web service and and invoke the web
service through a SOAP request, I got the following null pointer execption.
I googled but didn't find the reason of this. Why does the NPE occur only
when I deploy the binder as part of the web service? I used the same
SOAPEnvelope to test.



java.lang.NullPointerException
   at org.apache.axiom.om.impl.llom.OMStAXWrapper.generateEvents
(OMStAXWrap
per.java:1115)
   at org.apache.axiom.om.impl.llom.OMStAXWrapper.next(
OMStAXWrapper.java:9
11)
   at com.mycom.CreditCardPaymentRequestBinder.toObject(
CreditCardPaymentRequestBinder.java:138)



The toObject method definition is as follows:

public CreditCardPaymentRequest toObject(QName qname, XMLStreamReader
reader) throws XMLStreamException {
 CreditCardPaymentRequest obj = new CreditCardPaymentRequest();

 String rootElementName = qname.getLocalPart();
 String uri = qname.getNamespaceURI();

 if(!rootNsUri.equals(uri)) {
  throw new XMLStreamException("Invalid namespace " + uri + ". Expected
namespace uri is " + rootNsUri);
 }

 while(reader.hasNext()) {
  *int type = reader.next(); // Line number: 138*

  if(XMLStreamConstants.START_ELEMENT == type){
   String element = reader.getLocalName();

   if( rootLocalName.equals(element) ) {
continue;
   } else if( element.equals("cardNumber") ){
obj.setCardNumber(reader.getElementText());
   } else if( element.equals("expiryMonth") ) {
obj.setExpiryMonth(reader.getElementText());
   } else if( element.equals("expiryYear") ) {
obj.setExpiryYear(reader.getElementText());
   } else if( element.equals("brand") ) {
obj.setBrand(reader.getElementText());
   } else if( element.equals("totalAmount") ) {
obj.setTotalAmount(reader.getElementText());
   } else if( element.equals("currency") ) {
obj.setCurrency(reader.getElementText());
   } else if( element.equals("systemId") ) {
obj.setSystemId(reader.getElementText());
   } else if( element.equals("referenceNumber") ) {
obj.setReferenceNumber(reader.getElementText());
   } else if( element.equals("op") ) {
obj.setOp(reader.getElementText());
   } else {
throw new RuntimeException("Unexpected element " + element);
   }
  }

  if(XMLStreamConstants.END_ELEMENT == type){
   if(reader.getLocalName().equals(rootElementName)){
break;
   }
  }

 }

 return obj;
}





Regards,

Xinjun


[Axis2] Rampart 1.2

2007-05-03 Thread Damien Sauvageot

Hello,

Rampart 1.2 is missing from download page 
http://ws.apache.org/axis2/modules/index.html
It still refers to version 1.1 
http://www.apache.org/dyn/mirrors/mirrors.cgi/ws/rampart/1_1/rampart-1.1.zip


I did not find rampart 1.2 anywhere. Could you please tell me where I 
can download it as for now I am stucked

with

java.lang.NoSuchMethodError: org.apache.axis2.context.MessageContext.isE
ngaged(Ljavax/xml/namespace/QName;)

which is apparently due to refactoring of this method in Axis version 1.2.

Thanks for your help,

Damien Sauvageot


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