You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsrf-dev@ws.apache.org by Kheng Kok Mar <kh...@yahoo.com> on 2005/03/24 10:42:39 UTC

generating the queryresource properties programmatically

I am generating the client stub classes based on the
sample FileSystem file. I am trying to construct a
QueryExpression from the generated
QueryExpressionType. 
queryExpresion contains xsd:any as a element.  From
the xmlbean generated QueryExpressionType, this turns
out to be a generic MessageElement[], which is passed
in  as a parameter in its constructor. How can I
generate a messageElement that contains “*” without
any enclosing element tags, in other words, I am
trying to generate the following XML fragments (same
as the sample soap xml files provided in the Apollo
requests folder): 

<wsrp:QueryResourceProperties
xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
     <wsrp:QueryExpression
Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">
     *
     </wsrp:QueryExpression>
</wsrp:QueryResourceProperties>

Best rgds
KhengKok




__________________________________________________
Do You Yahoo!?
Log on to Messenger with your mobile phone!
http://sg.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: apollo-dev-help@ws.apache.org


Re: generating the queryresource properties programmatically

Posted by Stefan Lischke <li...@novacom.net>.
Hi,

I hope i understand you right, you are using the Axis WSDL2Java Tool to 
generate the client classes. Right?
Apollo is using XMLBeans as xml represantation, but unfortunatly there 
are is no client stub generator (not yet).

So i propose to use XMLBeans to generate the request document... i have 
made a small program thats doing the stuff:
The Program prints out the following:

<QueryResourceProperties 
xmlns="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
<QueryExpression>*</QueryExpression>
</QueryResourceProperties>

--
import 
org.oasisOpen.docs.wsrf.x2004.x06.wsrfWSResourceProperties12Draft01.*;
import org.apache.xmlbeans.XmlCursor;

public class qexprTester {

/** Creates a new instance of dfdf */
public static void main(String[] args) {
QueryResourcePropertiesDocument qrpdom = 
QueryResourcePropertiesDocument.Factory.newInstance();
QueryResourcePropertiesDocument.QueryResourceProperties qrp = 
qrpdom.addNewQueryResourceProperties();
QueryExpressionType qext = QueryExpressionType.Factory.newInstance();
XmlCursor xc = qext.newCursor();
xc.setTextValue("*");
qrp.setQueryExpression(qext);
System.out.println(qrpdom.toString());
}

}

Kheng Kok Mar wrote:

>I am generating the client stub classes based on the
>sample FileSystem file. I am trying to construct a
>QueryExpression from the generated
>QueryExpressionType. 
>queryExpresion contains xsd:any as a element.  From
>the xmlbean generated QueryExpressionType, this turns
>out to be a generic MessageElement[], which is passed
>in  as a parameter in its constructor. How can I
>generate a messageElement that contains “*” without
>any enclosing element tags, in other words, I am
>trying to generate the following XML fragments (same
>as the sample soap xml files provided in the Apollo
>requests folder): 
>
><wsrp:QueryResourceProperties
>xmlns:wsrp="http://docs.oasis-open.org/wsrf/2004/06/wsrf-WS-ResourceProperties-1.2-draft-01.xsd">
>     <wsrp:QueryExpression
>Dialect="http://www.w3.org/TR/1999/REC-xpath-19991116">
>     *
>     </wsrp:QueryExpression>
></wsrp:QueryResourceProperties>
>
>Best rgds
>KhengKok
>
>
>
>
>__________________________________________________
>Do You Yahoo!?
>Log on to Messenger with your mobile phone!
>http://sg.messenger.yahoo.com
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
>For additional commands, e-mail: apollo-dev-help@ws.apache.org
>
>
>  
>


-- 
My place : http://user.cs.tu-berlin.de/~lischke


---------------------------------------------------------------------
To unsubscribe, e-mail: apollo-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: apollo-dev-help@ws.apache.org