If you use Axis2 for the above case you dont need to edit your WSDL. In this
case you can provide an OMElement as the request. This is the simplest way
to create an OMElemet.

String str = "<echo><echoString>XML echo string</echoString></echo>";
StAXOMBuilder staxOMBuilder = new StAXOMBuilder(new
ByteArrayInputStream(str.getBytes()));
OMElement element =  staxOMBuilder.getDocumentElement();

If you generate a stub for this WSDL using Axis2 the dataType of request
will be an OMElement too.

Thanks,
Keith.

On Thu, Jun 26, 2008 at 6:08 PM, Bartolomeo Nicolotti <[EMAIL PROTECTED]>
wrote:

> Hi there!
>
> I've a wsdl for a web service that I've to consume with elements of this
> kind:
>
> <s:element maxOccurs="1" minOccurs="0" name="Request">
>        <s:complexType>
>                <s:sequence>
>                        <s:any/>
>                </s:sequence>
>        </s:complexType>
> </s:element>
>
> both in the request and in the response messages.
>
> The goal of doing this is to put generic xml in Request tag.
>
> The documentation of the web service suggests that to use this wsdl with
> axis1 you have to replace the above with:
>
> <s:element maxOccurs="1" minOccurs="0" name="Request"
> type="apachesoap:Element"/>
>
> If I do this wsdl2java gives an error because it cannot find
> apachesoap:Element. Which xmlns must I include so that the Request
> should be binded to the org.w3c.dom.Element type?
>
> Is there a better way to handle <s:any> in axis2? Or in general to put
> generic xml in a tag?
>
> Many thanks in advance.
>
> Bye!
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
Keith Chapman
Senior Software Engineer
WSO2 Inc.
Oxygenating the Web Service Platform.
http://wso2.org/

blog: http://www.keith-chapman.org

Reply via email to