Re: AXIS2-813 - Fixed? Inner static classes

2008-11-08 Thread Amila Suriarachchi
On Fri, Nov 7, 2008 at 5:25 PM, <[EMAIL PROTECTED]> wrote:

> Hi,
>
> I've the problem, that values in inner static classes will not transmitted
> from client to server or vice versa.
>
> The bug report for this problem
> https://issues.apache.org/jira/browse/AXIS2-813 tells me, that the problem
> should be fixed. Is it fixed in 1.4.1?
>
> The attached patch for SchemaGenerator.diff seems not to be applied in
> 1.4.1 for me, but this class seems to be refactored to
> DefaultSchemaGenerator, so perhaps I'm wrong.
>
> However, can anybody tell me how to transfer values for inner classes. I
> have attached example.zip at the 813-Bugreport. I don't find any example.


I think this is fixed in the current Axis2 turnk. Please have a look at with
a nightly build.

thanks,
Amila.

>
>
> Thanks and Cheers,
> Daniel
>
>
>
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: Custom Configurator

2008-11-08 Thread Amila Suriarachchi
On Fri, Nov 7, 2008 at 11:53 PM, Manuel Darveau <[EMAIL PROTECTED]>wrote:

> Hi Amila,
>
> Thanks for the reply. The article explain how to write a custom deployer
> but the Deployer interface in Axis2 assume that services will be loaded from
> the file system (and thus are binded to a file extension).


What I wanted to tell you is that by getting the ConfigurationContext you
can do anything. Don't warry about the file extension. Just put some dummy
file with an extension to make deployer invoke. Or else you can use a
DeploymentLifeCycleListner and implement the postDeploy method.

public interface DeploymentLifeCycleListener {

/**
 * calls before creating the configuration context to do any
initializing work.
 * @param axisConfig
 * @throws AxisFault
 */
public void preDeploy(AxisConfiguration axisConfig) throws AxisFault;

/**
 * calls after starting the configuration context to resume any
activity.
 * @param configurationContext
 * @throws AxisFault
 */
public void postDeploy(ConfigurationContext configurationContext) throws
AxisFault;

}

But if you want to keep even Axis2.xml details in the Database then this is
not an option.

thanks,
Amila.


> I think this assumtion is right in most case but Axis should also support
> deployer that have their own persistence mecanism (a database for example).
>
> Also, my biggest problem is not really the deployer. In fact, I already
> sublassed the AxisServlet to load my services when the servlet is
> initialized. My biggest problem is with the AxisConfigurator.
> Did you looked at the NullPointerException I get when using
> loadFromClassPath?


>
> Again, thank you for your time.
>
> Manuel
>
>
> On Fri, Nov 7, 2008 at 4:44 AM, Amila Suriarachchi <
> [EMAIL PROTECTED]> wrote:
>
>>
>>
>> On Fri, Nov 7, 2008 at 4:01 AM, Manuel Darveau <[EMAIL PROTECTED]>wrote:
>>
>>> Hi,
>>>
>>> I am trying to write a custom Configurator since my deployment is a bit
>>> special.
>>> I don't want to rely on file system at all. My axis configuration will be
>>> comming from a database and I want to load services programatically. All
>>> service classes will already be in the classpath and the list of service
>>> will be dynamic and controlled by a remote interface.
>>
>>
>> If you can keep Axis2.xml and modules in the file system, and only to load
>> the services from the Database you can use a custom deployer[1].
>> Custom deployers gives you the configuration context object using which
>> you can do any thing. You can register a custom deployer with some extension
>> into some folder.
>> e.g service.ds
>> This file may contain user name password details to database. Then at the
>> deploy method you can extract the data from the database and add services.
>>
>> thanks,
>> Amila.
>>
>>
>> [1] http://wso2.org/library/3708
>>
>>>
>>>
>>> I created a MemoryAxisServlet  since everything will be deployed in
>>> embedded Jetty:
>>> public class MemoryAxisServlet extends AxisServlet{
>>>   protected ConfigurationContext initConfigContext(ServletConfig config)
>>> throws ServletException {
>>> ConfigurationContext configContext =
>>> ConfigurationContextFactory.createConfigurationContext(new
>>> MemoryAxisConfigurator());
>>> configContext.setProperty(Constants.CONTAINER_MANAGED,
>>> Constants.VALUE_TRUE);
>>> return configContext;
>>>   }
>>> }
>>>
>>> public class MemoryAxisConfigurator extends DeploymentEngine{
>>>   public MemoryAxisConfigurator(){
>>> InputStream in = ...;
>>> populateAxisConfiguration(in);
>>>   }
>>>
>>>   public void engageGlobalModules() throws AxisFault {
>>>   engageModules();
>>>   }
>>>
>>>   public AxisConfiguration getAxisConfiguration() throws AxisFault {
>>> // Load modules from classpath
>>> loadFromClassPath();
>>> axisConfig.setConfigurator(this);
>>> return axisConfig;
>>>   }
>>>
>>>   public void setConfigContext(ConfigurationContext configContext) {
>>> // setting ServletContext into configctx
>>> configContext.setProperty(HTTPConstants.MC_HTTP_SERVLETCONTEXT,
>>> config.getServletContext());
>>>
>>> // TODO Is this property really needed?
>>> try {
>>>   Parameter servletConfigParam = new Parameter();
>>>   servletConfigParam.setName(HTTPConstants.HTTP_SERVLETCONFIG);
>>>   servletConfigParam.setValue(config);
>>>
>>> configContext.getAxisConfiguration().addParameter(servletConfigParam);
>>> } catch (AxisFault axisFault) {
>>>   log.error(axisFault.getMessage(), axisFault);
>>> }
>>> super.setConfigContext(configContext);
>>>   }
>>> }
>>>
>>> My problem is that I get a:
>>> java.lang.NullPointerException
>>> at
>>> org.apache.axis2.deployment.DeploymentEngine.loadServices(DeploymentEngine.java:131)
>>> at
>>> org.apache.axis2.context.ConfigurationContextFactory.createConfigurationContext(ConfigurationContextFactory.java:82)
>>> at
>>> com.eightd.ftk.webservices.MemoryAxisServlet.initConfigC

Re: Extraneous Error Message with Working Service

2008-11-08 Thread Amila Suriarachchi
On Sat, Nov 8, 2008 at 12:02 AM, John Cabral <[EMAIL PROTECTED]> wrote:

> I have an error that is being printed out by my Java Axis2 client,
> however, the service is working properly, the service returns the
> expected payload.   Does anyone know the source of this kind of error
> message and how to fix it.  I can't tell if it's cosmetic or an
> indication of something deeper I should be trying to fix.  Below is
> the error message and then a snippet that describes the client.
>
> [START ERROR]
>
> - Unable to sendViaPost to url[
> http://localhost:8080/axis2/services/TestService]
> org.apache.axis2.AxisFault: Transport error: 500 Error: Internal Server
> Error
>at
> org.apache.axis2.transport.http.HTTPSender.handleResponse(HTTPSender.java:293)
>at
> org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:192)
>at
> org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
>at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327)
>at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206)
>at
> org.apache.axis2.engine.AxisEngine$TransportNonBlockingInvocationWorker.run(AxisEngine.java:516)
>at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
>at
> edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
>at java.lang.Thread.run(Thread.java:595)
> - [MessageContext: logID=urn:uuid:FF25FAAE86487F7B661226078018207]
> Transport error: 500 Error: Internal Server Error
>
> [END ERROR]
> [START CLIENT SNIPPET ]
> OMElement result2 = null;
> OMElement requestedPayload = getPayload(result);
>
> Options options = new Options();
> options.setTo(registrationEPR);
> options.setTimeOutInMilliSeconds(36);
> options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
>
> ServiceClient sender = new ServiceClient();
> sender.setOptions(options);
>
> sender.fireAndForget(requestedPayload);

I think the problem is here. Can you check the response code for this in
only operation? This should be 202 accepted if there is no problem.

thanks,
Amila.

>
> result2 = sender.sendReceive(requestedPayload);
> [END CLIENT]
>
> thank you
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


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


Re: Obtain the SOAP envelope as DOM document or String

2008-11-08 Thread Matt Friedman
Thank you. This worked for me.



2008/11/6 Amila Suriarachchi <[EMAIL PROTECTED]>:
> Have a look at here[1]. you can use the toString of the soap envelop to get
> the soap envelop. But since ADB consume the stream you may not see the body
> there.
>
> thanks,
> Amila.
>
> [1]
> http://amilachinthaka.blogspot.com/2008/11/accessing-axis2-information-at-client.html
>
> On Thu, Nov 6, 2008 at 10:43 AM, Amila Suriarachchi
> <[EMAIL PROTECTED]> wrote:
>>
>> sorry forget the link :)
>>
>> [1] http://wso2.org/library/2068
>>
>> On Thu, Nov 6, 2008 at 10:42 AM, Amila Suriarachchi
>> <[EMAIL PROTECTED]> wrote:
>>>
>>> Hope this[1] helps you to get the xml string using returned ADB classes.
>>>
>>> thanks,
>>> Amila.
>>>
>>> On Wed, Nov 5, 2008 at 9:00 PM, Matt Friedman <[EMAIL PROTECTED]>
>>> wrote:

 That is correct. Thanks,
 Matt.

 2008/11/5 Amila Suriarachchi <[EMAIL PROTECTED]>:
 >
 >
 > On Wed, Nov 5, 2008 at 4:19 AM, Matt Friedman
 > <[EMAIL PROTECTED]>
 > wrote:
 >>
 >> Hi Amila,
 >>
 >> Thanks for this but I wonder if you could be a little more specific.
 >>
 >> I tried calling toString on the stub and on the search request
 >> parameter object, both of which return the Object's implementation of
 >> toString
 >>
 >> Could you let me know which object I should be calling toString on?
 >
 > Are you using a Client with ADB data binding and you want to get the
 > soap
 > envelop at  your client.
 > is that your requirement?
 >
 > thanks,
 > Amila.
 >>
 >>
 >> Thanks,
 >> Matt
 >>
 >> 2008/11/4 Amila Suriarachchi <[EMAIL PROTECTED]>:
 >> > use toString method.
 >> >
 >> > thanks,
 >> > Amila.
 >> >
 >> > On Tue, Nov 4, 2008 at 6:42 AM, Matt Friedman
 >> > <[EMAIL PROTECTED]>
 >> > wrote:
 >> >>
 >> >> I'm writing some code to produce xml files that contain the XML
 >> >> SOAP
 >> >> envelope.
 >> >>
 >> >> I'm doing this because I'm creating random search requests for
 >> >> part of
 >> >> our testing/benchmarking etc...
 >> >>
 >> >> I can create the client stub, configure it, and execute the search
 >> >> request, but I need to grab the SOAP envelope somehow.
 >> >>
 >> >> Is there a bit of the API that I can hook into so that I can do
 >> >> this?
 >> >>
 >> >> --
 >> >> -- Matt Friedman
 >> >>
 >> >>
 >> >> -
 >> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
 >> >> For additional commands, e-mail: [EMAIL PROTECTED]
 >> >>
 >> >
 >> >
 >> >
 >> > --
 >> > Amila Suriarachchi
 >> > WSO2 Inc.
 >> > blog: http://amilachinthaka.blogspot.com/
 >> >
 >>
 >>
 >>
 >> --
 >> -- Matt Friedman
 >>
 >> -
 >> To unsubscribe, e-mail: [EMAIL PROTECTED]
 >> For additional commands, e-mail: [EMAIL PROTECTED]
 >>
 >
 >
 >
 > --
 > Amila Suriarachchi
 > WSO2 Inc.
 > blog: http://amilachinthaka.blogspot.com/
 >



 --
 -- Matt Friedman

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

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



-- 
-- Matt Friedman

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



String index out of range faultstring when invoking REST service

2008-11-08 Thread strutsAwhile

Hi,
I'm trying to invoke the service (WSDL attached) using the url
http://localhost:8080/axis2/services/ProductService/products?callingSystem=ABC
and it gives the following fault
String index out of range: -41
The other operation :
http://localhost:8080/axis2/services/ProductService/getAllProducts works
fine.

The service method signature is : 
public String getProducts(ProductServiceParameter criteria); 
I'm suspecting it's something to do with the input argument being a
complextype rather than a simple String, but not able to figure anything
further since i don't see any other message on the axis2server console. 
Is there any way i can see the exception trace whenever a faultstring is
returned? . 
Also, is it REST conceptwise correct to encapsulate the search parameters in
a complextype and pass them separately as part of a GET request?
http://www.nabble.com/file/p20399284/ProductService.wsdl ProductService.wsdl 
Any inputs on this error will be really helpful.



-- 
View this message in context: 
http://www.nabble.com/String-index-out-of-range-faultstring-when-invoking-REST-service-tp20399284p20399284.html
Sent from the Axis - User mailing list archive at Nabble.com.


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