Hi Ciaran, all,

Thanks for the reply. I looked in to the code on your suggestion. The
problem that you described seems to be in the following code.

OMElement zipPart = (OMElement) namePart.getNextOMSibling();

This code is vulnerable if a carriage return is present after the <name> tag
before <package> tag. AFAIK this happens because of the behaviour of Axiom.
Axiom creates an OMText node for the carriage return. So when
getNextOMSibling() is called instead of <package> element OMText is
selected. But since the OMText cannot be cast to OMElement a
ClassCastException occurs. This can be avoided by obtaining zipart OMElement
with a call to getChild() or any related method which returns an OMElement
reference. I can provide a patch for this if necessary.

I tested the Deployment Web Service with sendsoap script with variations of
the SOAP message. I found the following SOAP message to be working with
sendsoap.

<soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";><soap:Body><deploy
xmlns="http://www.apache.org/ode/deployapi";>
<name>HelloBPEL</name><package>
<zip xmlns:xmlmime="http://www.w3.org/2005/05/xmlmime";
xmlmime:contentType="application/zip">base64encodedzip</zip></package>
</deploy>
</soap:Body>
</soap:Envelope>

But the problem is this is not working when I use my own HttpClient. I am
using SAAJ api (javax.xml.soap.MessageFactory) to create SOAP message.
Created message is then serialised to a string which then gets written to a
byte array stream.
In this case Axis complains that it is unable to dipatch to the operation
using the SOAP body. Following is the respective output on the console.

DEBUG - GeronimoLog.debug(66) | Checking for Operation using SOAP message
body's first child's local name : Envelope
WARN - GeronimoLog.warn(92) | No operation has been found!

I think the problem is in the way I am preparing the SOAP document. The SOAP
body first element should be "deploy" for correct dispatching. So far I am
having no luck for getting it to work and code seems fine to me.

I am looking forward to hearing from anybody who has tried using HttpClient
to succesfully invoke Deployment web service before. I have attached the
SOAPMessage creation code part with this mail for furthur reference if
necessary. Any help in this regard is greatly appreciated.

Best Regards,
Chamith

On Mon, Apr 20, 2009 at 1:10 PM, Ciaran <[email protected]> wrote:

> Rough guess, (and this is something that surprised me a while back until I
> read the code)  Try re-formatting your SOAP request so it looks like :
>
> <pmapi:deploy xmlns:pmapi="http://www.apache.org/ode/pmapi"; xmlns:dep="
> http://www.apache.org/ode/deployapi"; xmlns:xmlmime="
> http://www.w3.org/2005/05/xmlmime
> "><dep:name>xxx</dep:name><dep:package><dep:zip
>
> xmlmime:contentType="application/zip">base64encodedzip</dep:zip></dep:package></pmapi:deploy>
>
> (that is all on one line.)  Iirc when there's a carriage return either
> before or after the name then you get strange null pointer exceptions in
> the
> DeploymentWebservice code as it expects the Xml to be in a particular form
> and text-nodes in the DOM *really* make it un-happy.   *HOWEVER* this
> doesn't sound like your un-deployment problem!    Fwiw I've never reported
> this as a bug as it seems so deliberate I figure I'm mis-understanding
> something on my end (I look forward to being corrected by smarter folks
> shortly ! :) )
>
> - Cj.
>
> P.s. for those who care on current ODE 1_XX branch (r766055) the lines of
> interest are 112 - 114 on the DeploymentWebService.java
>
>
> On Mon, Apr 20, 2009 at 7:41 AM, buddhika chamith
> <[email protected]>wrote:
>
> > Hi all,
> >
> > I am trying to use ODE deployment web service to deploy and undeploy
> > processes. I am using an commons HttpClient to invoke the deployment
> > service. I tested the deployment web service of both ode-1.2 and ode
> -2.0.
> > In ode-2.0 I was successful in deploying the service. But when i invoke
> the
> > undeploy operation a strange thing happen. The process repository
> directory
> > gets deleted altogether resulting in nullpointer exception in
> undeployment
> > codes (ode successfully dispacthes to the undeploy operation in this case
> > as
> > well).
> >
> > When i try to deploy the process using the same logic (with same
> > SOAPMessage
> > body and service URLs etc.) ode-1.2 doesnot correctly dispatch to the
> > service operation. But in this case the problem occurs at Axis2 transport
> > before going to ODE engine. (error message indicates that EPR for
> operation
> > cannot be found.)
> >
> > The SOAPBody is roughly in the following format
> >
> > <pmapi:deploy xmlns:pmapi="http://www.apache.org/ode/pmapi"; xmlns:dep="
> > http://www.apache.org/ode/deployapi"; xmlns:xmlmime="
> > http://www.w3.org/2005/05/xmlmime";>
> >      <dep:name>xxx</dep:name>
> >      <dep:package>
> >               <dep:zip
> > xmlmime:contentType="application/zip">base64encodedzip</dep:zip>
> >      </dep:package>
> > </pmapi:deploy>
> >
> > I greatly appreciate any help or comment in this regard. I want to know
> any
> > changes present in those two ODE versions regarding process deployment,
> as
> > well.(like changes in WSDL etc)
> >
> > Thanks
> > Chamith
> >
>

Reply via email to