cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chengy <chy108.2...@yahoo.com.cn>
Subject Re: A WADL Representation bug?
Date Mon, 26 Jul 2010 03:07:55 GMT

some handleOperation codeļ¼š
------------------------------------------------------------------------------------------
     if (ori.getMethodToInvoke().getParameterTypes().length != 0) {
            sb.append("<request>");
            if (isFormRequest(ori)) {
                handleRepresentation(sb, jaxbTypes, qnameResolver, clsMap,
ori, null, false);
            } else {
                for (Parameter p : ori.getParameters()) {        
                    handleParameter(sb, jaxbTypes, qnameResolver, clsMap,
ori, p);             
                }
            }
            sb.append("</request>");
        }
--------------------------------------------------------------------------------------------

handleRepresentation method:
--------------------------------------------------------------------------------------------
    private void handleRepresentation(StringBuilder sb, Set<Class<?>>
jaxbTypes, 
                                      ElementQNameResolver qnameResolver,
                                      Map<Class<?>, QName> clsMap,
OperationResourceInfo ori, 
                                      Class<?> type, boolean inbound) {
        List<MediaType> types = inbound ? ori.getConsumeTypes() :
ori.getProduceTypes();
--------------------------------------------------------------------------------------------

if "false",indicate that it's not "inbound". the form request will use
OperationResourceInfo's ProduceType,that is to say,it will use
@Produces.So,I cann't use cxf generate wadl like below:

<resource path="/createInstances">
	<method name="POST">
		<request>
		 <representation mediaType="application/x-www-form-urlencoded">
		   
		   
		   
		   
		   
		 </representation>
		</request>
		<response>
		 <!--  Primitive type : xs:int --> 
		 <representation mediaType="text/html" /> 
		</response>
	</method>
</resource>

my java code:
----------------------------------------------------------------------------------------------
@POST
@Consumes(MediaType.APPLICATION_FORM_URLENCODED)
@Produces(MediaType.TEXT_HTML)
@Path("/createInstances")
public int createInstances(@FormParam("workflowDefUUID") String
workflowDefUUID, @FormParam("createUserId") String createUserId,
@FormParam("participantId") String participantId, @FormParam("title") String
title,@FormParam("boDatas") String boDatas) throws WSDKException;
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Re-A-WADL-Representation-bug-tp1842811p2206703.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Mime
View raw message