-
1. Re: Understanding Doc/Lit wrapped style response parameter u
anil.saldhana Feb 21, 2006 2:01 AM (in response to anil.saldhana)I have a usecase for Portal wsrp (Julien asked me to assist) where the response message is:
<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'> <env:Header/> <env:Body> <ns1:getServiceDescriptionResponse xmlns:ns1='urn:oasis:names:tc:wsrp:v1:types ' xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'> <ns1:requiresRegistration>false</ns1:requiresRegistration> </ns1:getServiceDescriptionResponse> </env:Body> </env:Envelope>
Now the mapping is:<wsdl-return-value-mapping> <method-return-value>org.jboss.portal.wsrp.core.ServiceDescription</method-return-value> <wsdl-message xmlns:wsdlMsgNS="urn:oasis:names:tc:wsrp:v1:intf">wsdlMsgNS:getServiceDescriptionResponse</wsdl-message> <wsdl-message-part-name>getServiceDescriptionResponse</wsdl-message-part-name> </wsdl-return-value-mapping>
So the response from the WS call is a wrapped bean called ServiceDescription, but JBossWS returns a Boolean after unwrapping, taking into account the value of a variable inside this bean. If JBossWS does not attempt to unwrap the return value (ie. ServiceDescription), then everything is fine.
From the wsdl.<element name="getServiceDescriptionResponse" type="types:ServiceDescription"/> <wsdl:message name="getServiceDescriptionResponse"> <wsdl:part name="getServiceDescriptionResponse" element="types:getServiceDescriptionResponse"/> </wsdl:message>
-
2. Re: Understanding Doc/Lit wrapped style response parameter u
jason.greene Feb 21, 2006 9:16 AM (in response to anil.saldhana)I think you are misunderstanding the difference between wrapped and bare styles.
If the jaxrpc-mapping.xml file has "<wrapped-element>" in the service-endpoint-method-mapping, then the parameters in method-param-parts-mapping will be wrapped in a javabean that is mapped to the single element in the doc/literal message. This also means that when unmarshalling the message it will first be mapped to the javabean, and then unwrapped to build the method signature.
If "wrapped-element" is not specified, this is called bare style, which means there can only be one parameter and it becomes the full body of the message.
Take a look at: webservice/test/resources/samples/chap02/wrapped
webservice/test/resources/samples/chap02/bare
-Jason -
3. Re: Understanding Doc/Lit wrapped style response parameter u
anil.saldhana Feb 21, 2006 12:11 PM (in response to anil.saldhana)Some trace:
2006-02-21 00:48:22,781 TRACE [org.jboss.ws.metadata.OperationMetaData] new OperationMetaData: [xmlName={urn:oasis:names:tc:wsrp:v1:intf}getServiceDescription,javaName=getServiceDescription] 2006-02-21 00:48:22,781 TRACE [org.jboss.ws.metadata.JSR109MetaDataBuilder] buildParameterMetaDataDoc: {urn:oasis:names:tc:wsrp:v1:intf}getServiceDescription 2006-02-21 00:48:22,781 TRACE [org.jboss.ws.metadata.JSR109MetaDataBuilder] isWrapParameters based on wrapped-element: false 2006-02-21 00:48:22,796 TRACE [org.jboss.ws.metadata.JSR109MetaDataBuilder] isWrapParameters based on matching parts: true 2006-02-21 00:48:22,796 TRACE [org.jboss.ws.metadata.OperationMetaData] addParameter: ParameterMetaData: xmlName={urn:oasis:names:tc:wsrp:v1:types}getServiceDescription xmlType={urn:oasis:names:tc:wsrp:v1:types}>getServiceDescription javaType=org.jboss.portal.wsrp.core.GetServiceDescription mode=IN inHeader=false 2006-02-21 00:48:22,796 TRACE [org.jboss.ws.metadata.OperationMetaData] setReturnParameter: ParameterMetaData: xmlName={urn:oasis:names:tc:wsrp:v1:types}getServiceDescriptionResponse xmlType={urn:oasis:names:tc:wsrp:v1:types}ServiceDescription javaType=org.jboss.portal.wsrp.core.ServiceDescription mode=IN inHeader=false
My issue is with this:[org.jboss.ws.metadata.JSR109MetaDataBuilder] isWrapParameters based on matching parts: true
-
4. Re: Understanding Doc/Lit wrapped style response parameter u
jason.greene Feb 21, 2006 12:17 PM (in response to anil.saldhana)Create a jira issue with a test case.
-Jason -
5. Re: Understanding Doc/Lit wrapped style response parameter u
anil.saldhana Feb 21, 2006 2:47 PM (in response to anil.saldhana)http://jira.jboss.com/jira/browse/JBWS-717
The overall problem is the inability to advice the jaxrpc client layer that the response is not a wrapped element. There is no support from jsr109 on this. -
6. Re: Understanding Doc/Lit wrapped style response parameter u
jason.greene Feb 22, 2006 12:48 PM (in response to anil.saldhana)I spoke with Anil, there was no real issue here. He just needed to switch to bare since the wsdl is not under our control
-Jason -
7. Re: Understanding Doc/Lit wrapped style response parameter u
anil.saldhana Feb 23, 2006 12:09 PM (in response to anil.saldhana)Converting to doc/lit bare solved the issue, but I am told that the wsrp spec mandates the following contract:
public ServiceDescription getServiceDescription(RegistrationContext rc, String[] locales)
plus the wsdl is unchangable.
With the doc/lit wrapped case, this particular wsrp usecase needs that the return value should not be unwrapped. I need to look at the wsrp spec in some detail (will do next week).
For the uninitiated,
This usecase is not a generalization of JBossWS support of doc/lit wrapped support. -
8. Re: Understanding Doc/Lit wrapped style response parameter u
jason.greene Feb 23, 2006 1:01 PM (in response to anil.saldhana)By looking at the WSDL it is obvious that they did not design it to follow the wrapped convention.
The interface descriptions you are referring to are purely semantic. They are just there to represent the form of the web service request and responses. Remember that a web service and its consumer have no notion of the other's underlying platform or language. For all we know, the language does not even have the concept of parameters.
If it is desired that the Java API mirror the semantic descriptions then the solution is to add a simple layer on top of the ws proxy objects.
This topic though should be moved to either the WSRP design form or the JBossWS user form.
-Jason