-
1. How to pass <xs:any> type of element from JBoss ESB to Webservice?
kcbabo Feb 14, 2011 9:32 AM (in response to amandal)Are you saying that the request message coming out of the ESB is wrong in some way? Or are you looking for help in defining the JAX-WS service implementation for the external web service?
-
2. How to pass <xs:any> type of element from JBoss ESB to Webservice?
amandal Feb 14, 2011 11:24 AM (in response to kcbabo)Hi Keith,
Thanks for the response. Here's clarifying your question-
I have my Webservice implentation already in place with the following signature -
@WebMethod(operationName = "Execute", action = "http://sg.com/esb/Execute")
@WebResult(name = "ExecuteResult", targetNamespace = "http://sg.com/esb/")
@RequestWrapper(localName = "Execute", targetNamespace = "http://sg.com/esb/", className = "com.sg.esb.Execute")
@ResponseWrapper(localName = "ExecuteResponse", targetNamespace = "http://sg.com/esb/", className = "com.sg.esb.ExecuteResponse")
public com.sg.esb.ExecuteResponse.ExecuteResult execute(
@WebParam(name = "Request", targetNamespace = "http://sg.com/esb/")
com.sg.esb.Execute.Request request)
If you have noticed the <xs:choice> element in the Sample.xsd attched in the original post, it is that which is the cause of my problem. Even though I set the Execute.Request.xmlPayload key of the OGNL requestMap in ESB Action class, I cannot unmarshall it back as an XmlPayload class in the Webservice. Please look at the XmlPayload.java from the original post. The getAny() method returns null always. Basically the choice object is goofing it up.
Is there a way by which we could successfuly marshall and unmarshall an xs:any type object from ESB to Webservice?
Thanks for the help,
Aps
-
3. How to pass <xs:any> type of element from JBoss ESB to Webservice?
kcbabo Feb 14, 2011 11:59 AM (in response to amandal)Hi Aps,
What I'm trying to determine is if the SOAP message coming out of the ESB contains the esb:xmlPayload element. You posted a sample of what it should look like, but it's not clear to me if you have confirmed whether or not that's what is coming out of the ESB as the request content.
cheers,
keith
-
4. Re: How to pass <xs:any> type of element from JBoss ESB to Webservice?
amandal Feb 15, 2011 1:18 AM (in response to kcbabo)Keith,
Am attaching a snippet from the server.log that prints the OGNL Request map created in the Action class of the ESB -
2011-02-14 17:34:04,564 INFO [STDOUT] (pool-36-thread-1) Method name : createNewLandmark
2011-02-14 17:34:04,580 INFO [SvgLogger] (pool-36-thread-1) [com.sg.esb.landmark.action.LandmarkRequestAction] Request map is: {Execute.Request.MethodName=createNewLandmark, Execute.Request.xmlPayload=
<lmk:Landmarks xmlns:lmk="http://sg.com/lmk/UpdateLandmarks/" xmlns:esb="http://sg.com/esb/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<lmk:Landmark>
<lmk:startDate>startDate1</lmk:startDate>
<lmk:endDate>endDate1</lmk:endDate>
<lmk:LandmarkAddress>
<lmk:VehicleGeoCode>
<lmk:latitude>latitude1</lmk:latitude>
<lmk:longitude>longitude1</lmk:longitude>
</lmk:VehicleGeoCode>
<lmk:line>line1</lmk:line>
<lmk:city>lmk:city1</lmk:city>
<lmk:state>lmk:state1</lmk:state>
<lmk:zip>lmk:zip1</lmk:zip>
<lmk:crossStreet>lmk:crossStreet1</lmk:crossStreet>
<lmk:county>lmk:county1</lmk:county>
<lmk:country>lmk:country1</lmk:country>
</lmk:LandmarkAddress>
<lmk:employeeNumber>lmk:employeeNumber1</lmk:employeeNumber>
<lmk:LandmarkDetail>
<lmk:landmarkID>lmk:landmarkID1</lmk:landmarkID>
<lmk:landmarkType>lmk:landmarkType1</lmk:landmarkType>
<lmk:landmarkTimeZone>lmk:landmarkTimeZone1</lmk:landmarkTimeZone>
</lmk:LandmarkDetail>
<lmk:proximity>lmk:proximity1</lmk:proximity>
</lmk:Landmark>
<!-- lmk:Landmark>
<lmk:startDate>lmk:startDate2</lmk:startDate>
<lmk:endDate>lmk:endDate2</lmk:endDate>
<lmk:LandmarkAddress>
<lmk:VehicleGeoCode>
<lmk:latitude>lmk:latitude2</lmk:latitude>
<lmk:longitude>lmk:longitude2</lmk:longitude>
</lmk:VehicleGeoCode>
<lmk:line>lmk:line2</lmk:line>
<lmk:city>lmk:city2</lmk:city>
<lmk:state>lmk:state2</lmk:state>
<lmk:zip>lmk:zip2</lmk:zip>
<lmk:crossStreet>lmk:crossStreet2</lmk:crossStreet>
<lmk:county>lmk:county2</lmk:county>
<lmk:country>lmk:country2</lmk:country>
</lmk:LandmarkAddress>
<lmk:employeeNumber>lmk:employeeNumber2</lmk:employeeNumber>
<lmk:LandmarkDetail>
<lmk:landmarkID>lmk:landmarkID2</lmk:landmarkID>
<lmk:landmarkType>lmk:landmarkType2</lmk:landmarkType>
<lmk:landmarkTimeZone>lmk:landmarkTimeZone2</lmk:landmarkTimeZone>
</lmk:LandmarkDetail>
<lmk:proximity>lmk:proximity2</lmk:proximity>
</lmk:Landmark-->
</lmk:Landmarks>
}
2011-02-14 17:34:04,595
Even though I am setting the xmlPayoad using
requestMap.put("Execute.Request.xmlPayload", xmlPayload.xmlText());
the Webservice cannot interpret it. It is returning the choice object as class com.sg.esb.ParamListType which is the other element in the choice complex type. Actually this is a progress(?) made yesterday after changing the Execute.java class a bit. Execute.Result is the input to my webservice. Am attaching both.
The sysouts from the webservice are as below -
2011-02-14 17:34:04,595 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Inside execute method in Web service .......
2011-02-14 17:34:04,611 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Message receved : Method createNewLandmark
2011-02-14 17:34:04,611 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) ChoiceObj : class com.sg.esb.ParamListType
2011-02-14 17:34:04,611 INFO [STDOUT] (http-localhost%2F127.0.0.1-8080-1) Some other instance type
Thanks again Keith,
Aps
-
CreateUSLandmarkWS.java.zip 866 bytes
-
Execute.java.zip 1.7 KB
-
-
5. Re: How to pass <xs:any> type of element from JBoss ESB to Webservice?
amandal Feb 18, 2011 12:46 AM (in response to amandal)I figured out a solution that works.
The requestMap I created was of type HashMap<String, Object>. When trying to pass the <xs:any> type of element as an object it was not being detected at the Webservice end (for reasons I donot know!). So I changed the Map instance to a type of HashMap<String, String> and passes the xmltext() version of the xs:any type element as below -
requestMap.put("Execute.Request.xmlPayload", lmksDoc.xmlText());
At the Webservice end, I removed the choice complex type and instead added xmlPayload as String with minOccurs="0" rendering the Request inner class as
public static class Request { @XmlElement(name = "MethodName", required = true) protected String methodName; protected String xmlPayload; @XmlElement(name = "ParameterList") protected ParamListType parameterList;
That solved my problem and the lmksDoc gets unmarshalled at the Webservice in the xmlPayload element above.
However, why an Object of type choice, at the webservice end does not work I have no clue!
Am marking this as 'assumed answered'.
-
6. Re: How to pass <xs:any> type of element from JBoss ESB to Webservice?
ramanap May 25, 2012 8:03 AM (in response to amandal)I have the same problem in passing xs:any from the ESB to web service using SoapClient. I am printing the request in the handler before reaching the webservice, and the parameter passed is not sent to the web service. Here the problem looks like mapping OGNL from ESB to xs:any. When I use SOAP Ui and pass the same XML, it works fine.
If anybody has any clue, Please let me know.
Thanks,
RamJI
-
7. Re: How to pass <xs:any> type of element from JBoss ESB to Webservice?
tadayosi May 29, 2012 9:46 PM (in response to ramanap)Please see https://issues.jboss.org/browse/JBESB-3809 for the discussion of this issue.