[ http://jira.codehaus.org/browse/XFIRE-790?page=comments#action_82695 ] Dustin Breese commented on XFIRE-790: -------------------------------------
I've implemented a custom Type mapping as a workaround, but have hit two issues which has stopped me. Our sample doc looks very similar to this (also reflected in Adrian's sample WSDL): <soap:Body wsu:Id="id-b834ed9ab4b20ae75ac5131c6b926fef69dee5ed" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <myResponse xmlns="http://sdk.bt.com"> <myCustomType xmlns="http://sdk.bt.com" xsi:type="xsd:anyType"> <SomeElement/> 1) When I register my custom type as follows, it seems the "xsi:type" attribute for the element causes my custom mapping to be overriden. It appears that the logic finds the custom type, but looks in an "overrideType" collection IF a "type" attribute is given. TypeMapping typeMapping = ((AegisBindingProvider) svc.getBindingProvider()).getTypeMapping(svc); typeMapping.register(new BTSamlAssertionType()); WORKAROUND: So, I have to remove the anyType mapping as follows -- Type badObjectTypeOverride = typeMapping.getType(new QName("http://www.w3.org/2001/XMLSchema","anyType","")); typeMapping.removeType(badObjectTypeOverride); 2) Now I am hitting an issue in my custom type -- all I want to do is get the CONTENTS of "myCustomType" and store the XML in a string. I have to be very careful with the raw contents because it contains a signed chunk of XML. Question -- HOW DO I GET JUST THE RAW XML? I've tried the following, but keep getting an exception any time i try to get the raw text of the element: public Object readObject(MessageReader reader, MessageContext context) { XMLStreamReader xmlReader = context.getInMessage().getXMLStreamReader(); String data = xmlReader.getElementText(); return data; } The exception trace is: com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT. at [row,col {unknown-source}]: [16,1020] at com.ctc.wstx.sr.StreamScanner.throwParseError(StreamScanner.java:451) at com.ctc.wstx.sr.BasicStreamReader.getElementText(BasicStreamReader.java:649) ..... I'm hoping this is an easy one you may be able to guide me on? > Client processing xs:anyType causes StackOverflowError > ------------------------------------------------------ > > Key: XFIRE-790 > URL: http://jira.codehaus.org/browse/XFIRE-790 > Project: XFire > Issue Type: Bug > Affects Versions: 1.2.3 > Environment: Windows XP Java 1.5 > Reporter: Adrian Smith > Assigned To: Dan Diephouse > Fix For: 1.2.4 > > Attachments: anytype.wsdl > > > If a service returns an xs:anyType, the XFire client cannot deserialize and > throws a StackOverflowError -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email
