Scott I dont map the Result as it does not seem to need it, but if i do i get the same problem so i dont think its that.
The problem manifests itself as follows;- If i map the B8DisplayContext in the B8ElementTile class (as a returned parameter called imageInfo) .. Note that i have also mapped the class in the sent parameter list as a B8DISPLAYCONTEXT so in effect its mapped twice. I find that SOAP ignores the mapping name (ie QName) and used the class as the reference when it receives or sends a class that need serializing. This seems wrong.. I can demonstrate it as follows. If i map the output parameter called viewContext (a B8DisplayContext) as follows (contains 6 doubles: blX, blY, trX, trY, width, height) smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "B8DISPLAYCONTEXT"), B8DisplayContext.class, new org.apache.soap.encoding.soapenc.BeanSerializer(), new org.apache.soap.encoding.soapenc.BeanSerializer()); (also the 6 doubles are mapped) And i map the input element (B8ElementTile) as follows (contains String url, int repositoryID, int mapLevelID, B8ElementContext imageInfo) .. note i have not mapped the imageInfo but commenting it out smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "url"), null, null, new org.apache.soap.encoding.soapenc.StringDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "repositoryID"), null, null, new org.apache.soap.encoding.soapenc.IntDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "mapLevelID"), null, null, new org.apache.soap.encoding.soapenc.IntDeserializer()); // smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "imageInfo"), B8DisplayContext.class, null, new org.apache.soap.encoding.soapenc.BeanSerializer()); I get the message [SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to deserialize a ':imageInfo' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.; targetException=java.lang.IllegalArgumentException: No Deserializer found to deserialize a ':imageInfo' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'. IE the imageInfo isnt mapped.... (as would be expected) The output XML payload is as follows;- (sensible results are returned from this message) <?xml version="1.0" encoding="UTF-8" ?> - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <SOAP-ENV:Body> - <ns1:GetImageIDs xmlns:ns1="http://blue8.uk.com/message/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <user xsi:type="xsd:string">user</user> <password xsi:type="xsd:string">password</password> <mapLevelID xsi:type="xsd:int">17</mapLevelID> - <viewContext xmlns:ns2="http://blue8.uk.com/type/" xsi:type="ns2:B8DISPLAYCONTEXT"> <blX xsi:type="xsd:double">10000.0</blX> <blY xsi:type="xsd:double">10000.0</blY> <height xsi:type="xsd:double">1000.0</height> <trX xsi:type="xsd:double">20000.0</trX> <trY xsi:type="xsd:double">20000.0</trY> <width xsi:type="xsd:double">1000.0</width> </viewContext> <imageID xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Array" ns3:arrayType="xsd:string[]" xsi:nil="true" /> </ns1:GetImageIDs> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Note the line <viewContext> .. has a type attribute of B8DISPLAYCONTEXT................. OK so i now add the mapping for the imageInfo into the B8ElementTile maps... its as above but i have uncommented the last line of the mapping so adding imageInfo.. I get the following returned XML error <?xml version="1.0" encoding="UTF-8" standalone="no" ?> - <SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> - <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> - <SOAP-ENV:Fault> <faultcode>SOAP-ENV:Server</faultcode> <faultstring>Server:XML Parser failed at linenumber 8, lineposition 35, reason is: Only a default namespace can have an empty URI.</faultstring> - <detail> - <mserror:errorInfo xmlns:mserror="http://schemas.microsoft.com/soap-toolkit/faultdetail/error/"> <mserror:returnCode>-2147467259 : Unspecified error</mserror:returnCode> - <mserror:serverErrorInfo> <mserror:description>Server:XML Parser failed at linenumber 8, lineposition 35, reason is: Only a default namespace can have an empty URI. HRESULT=0x80004005: Unspecified error - Server:Loading the request into SoapReader failed. HRESULT=0x80070057: The parameter is incorrect. - Server:One of the parameters supplied is invalid. HRESULT=0x80070057: The parameter is incorrect.</mserror:description> <mserror:source>Server</mserror:source> </mserror:serverErrorInfo> - <mserror:callStack> - <mserror:callElement> <mserror:component>Server</mserror:component> <mserror:description>XML Parser failed at linenumber 8, lineposition 35, reason is: Only a default namespace can have an empty URI.</mserror:description> <mserror:returnCode>-2147467259 : Unspecified error</mserror:returnCode> </mserror:callElement> - <mserror:callElement> <mserror:component>Server</mserror:component> <mserror:description>Loading the request into SoapReader failed.</mserror:description> <mserror:returnCode>-2147024809 : The parameter is incorrect.</mserror:returnCode> </mserror:callElement> - <mserror:callElement> <mserror:component>Server</mserror:component> <mserror:description>One of the parameters supplied is invalid.</mserror:description> <mserror:returnCode>-2147024809 : The parameter is incorrect.</mserror:returnCode> </mserror:callElement> </mserror:callStack> </mserror:errorInfo> </detail> </SOAP-ENV:Fault> </SOAP-ENV:Body> </SOAP-ENV:Envelope> where the referred to line 8 is <viewContext xmlns:ns2="" xsi:type="ns2:imageInfo"> Note that this is the output XML payload... I can confirm this by adding the correct namespace (http://blue8.uk.com/type/) to the imageInfo mapType line.. I get the following error then... [SOAPException: faultCode=SOAP-ENV:Client; msg=No Deserializer found to deserialize a ':imageInfo' using ncoding style 'http://schemas.xmlsoap.org/soap/encoding/'.; targetException=java.lang.IllegalArgumentException: No Deserializer found to deserialize a ':imageInfo' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.] which is the same error... but look at the output XML payload now... (sensible results are returned from this message) <?xml version="1.0" encoding="UTF-8" ?> - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <SOAP-ENV:Body> - <ns1:GetImageIDs xmlns:ns1="http://blue8.uk.com/message/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <user xsi:type="xsd:string">user</user> <password xsi:type="xsd:string">password</password> <mapLevelID xsi:type="xsd:int">17</mapLevelID> - <viewContext xmlns:ns2="http://blue8.uk.com/type/" xsi:type="ns2:imageInfo"> <blX xsi:type="xsd:double">10000.0</blX> <blY xsi:type="xsd:double">10000.0</blY> <height xsi:type="xsd:double">1000.0</height> <trX xsi:type="xsd:double">20000.0</trX> <trY xsi:type="xsd:double">20000.0</trY> <width xsi:type="xsd:double">1000.0</width> </viewContext> <imageID xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Array" ns3:arrayType="xsd:string[]" xsi:nil="true" /> </ns1:GetImageIDs> </SOAP-ENV:Body> </SOAP-ENV:Envelope> NOTE that the <viewContext>... line has a different namespace (ie imageInfo).... the one i added in the B8ElementTile mapping which is obviously wrong...... Is this due to the mapping of types using the class name and not the parameter name ????? By the way... i can put anything in the namespace and name in the mapTypes of imageInfo and it will ALWAYS get back sensible results but will fail to map the imageInfo back to its class. Note that the the <viewContext>.. line name changes accordingly when i change these strings.. The sensible output is as follows <?xml version="1.0" encoding="UTF-8" standalone="no" ?> - <SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> - <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> - <SOAPSDK4:GetImageIDsResponse xmlns:SOAPSDK4="http://blue8.uk.com/message/"> - <Result xmlns:SOAPSDK5="http://blue8.uk.com/type/" SOAPSDK3:arrayType="SOAPSDK5:B8ELEMENTTILE[1]" SOAPSDK3:offset="[0]" SOAPSDK2:type="SOAPSDK3:Array"> <SOAPSDK5:B8ELEMENTTILE href="#id1" /> </Result> </SOAPSDK4:GetImageIDsResponse> - <SOAPSDK6:B8ELEMENTTILE xmlns:SOAPSDK6="http://blue8.uk.com/type/" id="id1" SOAPSDK3:root="0"> <id>36438017</id> <url>\\B8_ops\Development\data\maps\wh100\key/000001.GIF</url> <imageInfo href="#id2" /> <repositoryID>139</repositoryID> <mapLevelID>17</mapLevelID> </SOAPSDK6:B8ELEMENTTILE> - <SOAPSDK7:B8DISPLAYCONTEXT xmlns:SOAPSDK7="http://blue8.uk.com/type/" id="id2" SOAPSDK3:root="0"> <blX>0</blX> <blY>0</blY> <trX>100000</trX> <trY>100000</trY> <width>1000</width> <height>1000</height> </SOAPSDK7:B8DISPLAYCONTEXT> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Any pointers would be most helpful... rgds Ian Minshall -----Original Message----- From: Scott Nichol [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 17:23 To: [EMAIL PROTECTED] Subject: Re: Complex types within complex types serialization/deserialization[Scanned] Ian, Do you also map Result, e.g. smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "Result"), B8ElementTile.class, null, new org.apache.soap.encoding.soapenc.BeanSerializer()); If so, it looks to me like Apache SOAP should be able to deserialize the response. If you do have this mapping and it does not deserialize, could you post the stack trace from the SOAP exception? As for the message you are sending, is the server handling the parameters correctly? STK 2 and .NET ignore parameters that have xsi:type attributes when literal encoding is expected. If you need to send literal encoding (well, if you want to suppress the xsi:type attributes), you can do so with a nightly build of Apache SOAP. The doclit sample shows how to specify "doc/lit" serialization by using the new call.setDocLitSerialization(true) method. Caveat: don't be fooled by the method name. This is a hack for improving interop that is not perfect; it merely suppresses xsi:type and encodingStyle attributes. Scott Nichol ----- Original Message ----- From: "Ian Minshall" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 15, 2002 11:09 AM Subject: RE: Complex types within complex types serialization/deserialization[Scanned] I agree axis would work in this instance as i started with this solution but the use of AXIS breaks applet security policy, which is what we are designing. So i need another solution. The untyped nature of MS SDK means that it does not qualify each element with its type so you would see entries like <id>123</id> and not typed to an integer (or whatever) mapTypes calls mapTypes called in the B8DISPLAYCONTEXT structure which consists of 6 doubles only. smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "blX"), null, null, new org.apache.soap.encoding.soapenc.DoubleDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "blY"), null, null, new org.apache.soap.encoding.soapenc.DoubleDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "trX"), null, null, new org.apache.soap.encoding.soapenc.DoubleDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "trY"), null, null, new org.apache.soap.encoding.soapenc.DoubleDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "width"), null, null, new org.apache.soap.encoding.soapenc.DoubleDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "height"), null, null, new org.apache.soap.encoding.soapenc.DoubleDeserializer()); mapTypes called in the B8ELEMENTTILE structure which contains a string, a struct (B8DISPLAYCONTEXT), and 2 ints smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "url"), null, null, new org.apache.soap.encoding.soapenc.StringDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "imageInfo"), B8DisplayContext.class, null, new org.apache.soap.encoding.soapenc.BeanSerializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "repositoryID"), null, null, new org.apache.soap.encoding.soapenc.IntDeserializer()); smr.mapTypes(org.apache.soap.Constants.NS_URI_SOAP_ENC, new org.apache.soap.util.xml.QName("", "mapLevelID"), null, null, new org.apache.soap.encoding.soapenc.IntDeserializer()); Input wire dump (ignore the '-'s they are put in by IE5) <?xml version="1.0" encoding="UTF-8" ?> - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> - <SOAP-ENV:Body> - <ns1:GetImageIDs xmlns:ns1="http://blue8.uk.com/message/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <user xsi:type="xsd:string">mike.curtis</user> <password xsi:type="xsd:string">mike.curtis</password> <mapLevelID xsi:type="xsd:int">17</mapLevelID> - <viewContext xmlns:ns2="http://blue8.uk.com/type/" xsi:type="ns2:imageInfo"> <blX xsi:type="xsd:double">10000.0</blX> <blY xsi:type="xsd:double">10000.0</blY> <height xsi:type="xsd:double">1000.0</height> <trX xsi:type="xsd:double">20000.0</trX> <trY xsi:type="xsd:double">20000.0</trY> <width xsi:type="xsd:double">1000.0</width> </viewContext> <imageID xmlns:ns3="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:Array" ns3:arrayType="xsd:string[]" xsi:nil="true" /> </ns1:GetImageIDs> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Output wire dump (ignore the '-'s they are put in by IE5) <?xml version="1.0" encoding="UTF-8" standalone="no" ?> - <SOAP-ENV:Envelope xmlns:SOAPSDK1="http://www.w3.org/2001/XMLSchema" xmlns:SOAPSDK2="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAPSDK3="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> - <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> - <SOAPSDK4:GetImageIDsResponse xmlns:SOAPSDK4="http://blue8.uk.com/message/"> - <Result xmlns:SOAPSDK5="http://blue8.uk.com/type/" SOAPSDK3:arrayType="SOAPSDK5:B8ELEMENTTILE[1]" SOAPSDK3:offset="[0]" SOAPSDK2:type="SOAPSDK3:Array"> <SOAPSDK5:B8ELEMENTTILE href="#id1" /> </Result> </SOAPSDK4:GetImageIDsResponse> - <SOAPSDK6:B8ELEMENTTILE xmlns:SOAPSDK6="http://blue8.uk.com/type/" id="id1" SOAPSDK3:root="0"> <id>36438017</id> <url>\\B8_ops\Development\data\maps\wh100\key/000001.GIF</url> <imageInfo href="#id2" /> <repositoryID>139</repositoryID> <mapLevelID>17</mapLevelID> </SOAPSDK6:B8ELEMENTTILE> - <SOAPSDK7:B8DISPLAYCONTEXT xmlns:SOAPSDK7="http://blue8.uk.com/type/" id="id2" SOAPSDK3:root="0"> <blX>0</blX> <blY>0</blY> <trX>100000</trX> <trY>100000</trY> <width>1000</width> <height>1000</height> </SOAPSDK7:B8DISPLAYCONTEXT> </SOAP-ENV:Body> </SOAP-ENV:Envelope> rgds Ian Minshall -----Original Message----- From: Scott Nichol [mailto:[EMAIL PROTECTED]] Sent: 15 October 2002 15:17 To: [EMAIL PROTECTED] Subject: Re: Complex types within complex types serialization/deserialization[Scanned] I am not certain what "Server is MS SDK v3 (untyped)" means, or more specifically, what "(untyped)" means. Does that mean the server uses literal encoding of messages? If so, you should understand that Apache SOAP has a couple of hacks to help it work in literal environments, but does not have a full implementation. If you need to work with literal encoding, you would do well to switch from Apache SOAP to Axis (http://xml.apache.org/axis), which has much more complete support for this. If you want to resolve the issue you are having with Apache SOAP, could you please post the mapTypes calls you are making? Also, wire dumps of the SOAP messages would be of great help. Scott Nichol ----- Original Message ----- From: "Ian Minshall" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, October 15, 2002 8:38 AM Subject: Complex types within complex types serialization/deserialization I have a problem with a complex type going into and out of a SOAP routine in that it will not deserialize the resulting structure. The setup is .. I have a structure - DISPLAYCONTEXT that is send to a rpc service. This service returns another structure, ELEMENT, that contains a DISPLAYCONTEXT structure. So in effect I have DISPLAYCONTEXT { int x; int y; } (as the input parameter) ELEMENT { int z; String s; DISPLAYCONTEXT dc; } (as the output parameter) They are both configured as JavaBeans. The problem is in mapping the types in the call. If i map the DISPLAYCONTEXT and the returned 'dc' using SMR.mapTypes(), both as beans, then the SOAP client complains that it there is no deserializer for 'dc'. If i try any other way of mapping them i get the same message. Note it doesnt work if i only map it once as a bean. It seems that you can only map ONE class per call. i.e. i require to map the same class twice (one for the output and one for the input), but the mapping registry will only look for one and ignore the other causing an error on deserialization. Is there a correct way of mapping this ... or is it a bug in SOAP 2.3.1 ?? MS SDK v3 returns a correct XML response. Client is Apache SOAP 3.2.1, Server is MS SDK v3 (untyped). rgds Ian Minshall I -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>