We have developed Webservices using Apache CXF , and they are working fine .
This is some part of our generated wsdl file (http://localhost:8080/MyWeb/tata/soap?wsdl).
<xs:sequence>
<xs:element minOccurs="0" name="strikePrice" type="xs:double"/>
<xs:element minOccurs="0" name="symbol" type="xs:string"/>
</xs:sequence>
<soap:body use="literal"/>
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
We have developed Webservices using Apache CXF , and they are working fine .
While reading webservice performance tuning tutorials , i read always use document literal for interoperabilty .
My question is , is my WSDL is document /literal ??
Because most of the tutorials in internet , represent xsd:String in place of (xs:String) for representing document/literal approach ??
Are xs:String and xsd:String are same ??
xs:string and xsd:string are the same, provided that the "xs" and "xsd" prefixes are both bound to the namespace URI "http://www.w3.org/2001/XMLSchema".
Related
There is a lot of information about Apache Camel + CXF-Endpoint and RPC/encoded legacy webservices.
But until now I did not find a solution for the problem.
I want to call an RPC/encoded webservice from Apache Camel over the CXF endpoint.
CXF does not support RPC/encoded Webservices.
So I tried two approaches to solve the problem.
Convert wsdl from RPC/encoded to RPC/literal and generate source files.
Call the webservice in RPC/literal style which is supported by CXF.
The following article suggests that this approach could be a solution for my problem: Best way to consume RPC/encoded webservice?
Send the complete SOAP-Message without mapping to objects (no JAXB).
Neither approach 1 nor approach 2 works.
In the following sections I will explain my approaches and the problems in more detail.
Prerequisites
Apache Tomcat 7
Apache Camel 2.14.1
Apache CXF 2.7.10
Webservice Endpoint is mocked with SOAP-UI 5.0.0 on http://localhost:9000/myfunctionalmock
First approach: Convert wsdl RPC/encoded to RPC/literal and generate sources
In the RCP/encoded wsdl I have changed following:
WSDL Bindings:
<wsdl:binding name="exampleSoapBinding" type="impl:MyFunctionalWebservices">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="isAlive">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="isAliveRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://my.example.com/myFunction" use="encoded"/>
</wsdl:input>
...
to
<wsdl:binding name="exampleSoapBinding" type="impl:MyFunctionalWebservices">
<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="isAlive">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="isAliveRequest">
<wsdlsoap:body namespace="http://my.example.com/myFunction" use="literal"/>
</wsdl:input>
…
Arrays of Objects:
<complexType name="ArrayOfMyElement">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="impl:MyElement[]"/>
</restriction>
</complexContent>
</complexType>
to
<complexType name="ArrayOfMyElement">
<xsd:sequence>
<xsd:element name="MyElement"
type="impl:MyElement"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</complexType>
Arrays of simple types:
<complexType name="ArrayOf_xsd_string">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:string[]"/>
</restriction>
</complexContent>
</complexType>
to
<complexType name="ArrayOf_xsd_string">
<xsd:sequence>
<xsd:element name="item"
type="xsd:string"
minOccurs="0"
maxOccurs="unbounded"/>
</xsd:sequence>
</complexType>
Arrays of undefined Type (anyType):
<complexType name="ArrayOf_xsd_anyType">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:anyType[]"/>
</restriction>
</complexContent>
</complexType>
to
<complexType name="ArrayOf_xsd_anyType">
<xsd:sequence>
<xsd:element name="item"
type="xsd:anyType" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</complexType>
After that I have generated source files with IntelliJ Webservice plugin (over CXF wsdl2java)
In Camel I have configured following Endpoint:
CxfEndpoint endpoint = new CxfEndpoint();
endpoint.setAddress("http://127.0.0.1:9000/myfunctionalmock");
endpoint.setWsdlURL("wsdl/myservice_literal.wsdl");
endpoint.setServiceClass("com.my.example.MyFunctionalWebservices");
endpoint.setEndpointNameString("{http://my.example.com/myFunction}rpcrouter");
endpoint.setServiceNameString("{http://my.example.com/myFunction}MyFunctionalWebservicesService");
endpoint.setDataFormat(DataFormat.POJO);
endpoint.setSynchronous(true);
endpoint.setCamelContext(camelContext);
endpoint.setEndpointUriIfNotSpecified(MY_ENDPOINT_URL);
camelContext.addEndpoint(MY_ENDPOINT_URL, endpoint);
Usage of CXF-Endpoint in Camel route:
I want to call following function of webservice:
public Result isAlive(java.lang.String identifier);
The timer in the camel route is only for triggering the webservice.
from("timer://myTimer?period=10000")
.log(LoggingLevel.INFO, "START Timer Webservice.")
.setBody().constant("1620000018")
.setHeader("operationName", constant("isAlive"))
.setHeader("operationNamespace", constant("http://my.example.com/myFunction"))
.to(MyCamelConfiguration.MY_ENDPOINT_URL);
Problems with this approach:
At runtime following message appears at deployment time:
2015-03-05 09:57:46,659; 2010; [localhost-startStop-1]; DEBUG; wsdl11.WSDLServiceBuilder; Operation {http://my.example.com/myFunction}isAlive cannot be unwrapped, input message must reference global element declaration with same localname as operation
Following exception occurs at runtime:
org.apache.cxf.binding.soap.SoapFault: No namespace on "HTML" element. You must send a SOAP request.
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.readVersion(ReadHeadersInterceptor.java:111)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:155)
at org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:835)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponseInternal(HTTPConduit.java:1614)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:1504)
at org.apache.cxf.transport.http.HTTPConduit$WrappedOutputStream.close(HTTPConduit.java:1310)
at org.apache.cxf.transport.AbstractConduit.close(AbstractConduit.java:56)
at org.apache.cxf.transport.http.HTTPConduit.close(HTTPConduit.java:628)
at org.apache.cxf.interceptor.MessageSenderInterceptor$MessageSenderEndingInterceptor.handleMessage(MessageSenderInterceptor.java:62)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:272)
at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:565)
at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:474)
at org.apache.camel.component.cxf.CxfProducer.process(CxfProducer.java:149)
at org.apache.camel.impl.SynchronousDelegateProducer.process(SynchronousDelegateProducer.java:62)
at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:120)
at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:72)
at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:416)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:118)
at org.apache.camel.processor.Pipeline.process(Pipeline.java:80)
at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:191)
at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:166)
at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:74)
at java.util.TimerThread.mainLoop(Timer.java:512)
at java.util.TimerThread.run(Timer.java:462)
Second approach: Send the SOAP-Message without mapping to Objects.
Endpoint definition in Camel:
CxfEndpoint endpoint = new CxfEndpoint();
endpoint.setAddress("http://127.0.0.1:9000/myfunctionalmock");
endpoint.setEndpointNameString("{http://my.example.com/myFunction}rpcrouter");
endpoint.setServiceNameString("{http://my.example.com/myFunction}MyFunctionalWebservicesService");
endpoint.setDataFormat(DataFormat.RAW);
endpoint.setWrappedStyle(false);
endpoint.setSynchronous(true);
endpoint.setCamelContext(camelContext);
endpoint.setEndpointUriIfNotSpecified(MY_TEMPLATE_ENDPOINT_URL);
camelContext.addEndpoint(MY_TEMPLATE_ENDPOINT_URL, endpoint);
Usage in route:
from("timer://myTimer?period=10000")
.log(LoggingLevel.INFO, "START Timer Webservice.")
.setBody().constant(
"<soapenv:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:myns=\"http://my.example.com/myFunction\">\n" +
" <soapenv:Header/>\n" +
" <soapenv:Body>\n" +
" <myns:isAlive soapenv:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n" +
" <identifier xsi:type=\"xsd:string\">1620000018</identifier>\n" +
" </myns:isAlive>\n" +
" </soapenv:Body>\n" +
"</soapenv:Envelope>"
)
.to(MyCamelConfiguration.MY_TEMPLATE_ENDPOINT_URL)
.log(LoggingLevel.INFO, "END Timer Webservice.")
.log(LoggingLevel.INFO, "Body after ws call = ${body}");
But the webservice on http://localhost:9000/myfunctionalmock is never called.
I found following log messages in logfile:
2015-03-05 10:56:35,522; 12843; [Camel (camel-1) thread #0 - timer://myTimer]; DEBUG; phase.PhaseInterceptorChain; Invoking handleMessage on interceptor org.apache.cxf.jaxb.attachment.JAXBAttachmentSchemaValidationHack#1d3694a
2015-03-05 10:56:35,523; 12844; [Camel (camel-1) thread #0 - timer://myTimer]; DEBUG; phase.PhaseInterceptorChain; Invoking handleMessage on interceptor org.apache.cxf.ws.policy.PolicyVerificationInInterceptor#1a0ff10
2015-03-05 10:56:35,523; 12844; [Camel (camel-1) thread #0 - timer://myTimer]; DEBUG; policy.PolicyVerificationInInterceptor; Verified policies for inbound message.
2015-03-05 10:56:35,523; 12844; [Camel (camel-1) thread #0 - timer://myTimer]; INFO ; helpers.MarkerIgnoringBase; END Timer Webservice.
2015-03-05 10:56:35,523; 12844; [Camel (camel-1) thread #0 - timer://myTimer]; INFO ; helpers.MarkerIgnoringBase; Body after ws call = <HTML>
<HEAD><TITLE>Redirection</TITLE></HEAD>
<BODY><H1>Redirect</H1></BODY>
Both approaches do not work.Is there a possibility to call RPC/encoded webservice over CXF in Camel?
Thanks in advance.
Regards,
Max
As you say Apache CXF does not support the old RPC style. You would need to use an older WS library such as Apache Axis 1.x. There is no Camel component for that, but as its all just java code, you can write some java code that uses Axis 1.x, and then let Camel call the java code, using its bean component / processor.
http://camel.apache.org/bean
Another alternative is that as SOAP is over HTTP you can just use Camel's HTTP components also. But you would need to build the message body and headers according to the RPC style, but that should not be so hard either to do.
On trying to modify an existing wsdl and changing the Request Type and Response Type of an operation I am getting the below.
The process I followed is :
1. Modify the xsd
2. Generate Java Bean Skeleton (Can not change it as it is referred in multiple places)
Fixes tried :
1. Referred to multiple articles and have changed the WSDL to be elementFormDefault="unqualified" and to regenerate the supporting files.
2. I have tried to set xmlns="" to disable namespace for the field.
WSDL (Pasting just the modified operation, the original wswdl has around 52 operations)
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="ABCDEF" targetNamespace="http://managemyxyz.services.abc.def/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://managemyabc.services.abc.def/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsd1="http://cat.abc.def/ABC/schema/">
<wsdl:types>
<xsd:schema targetNamespace="http://manageabc.services.abc.def/">
<xsd:complexType name="NewType"/>
</xsd:schema>
<xsd:schema>
<xsd:import namespace="http://cat.abc.def/ABC/schema/" schemaLocation="xsd/ABC.xsd">
</xsd:import>
</xsd:schema>
<wsdl:message name="insertABCRequest">
<wsdl:part name="insertABCRequest" type="xsd1:InsertABCItemRequestType"/>
</wsdl:message>
<wsdl:message name="insertABCItemResponse">
<wsdl:part name="insertABCItemResponse" type="xsd1:InsertABCItemResponseType"/>
</wsdl:message>
<wsdl:portType name="ABCDEF">
<wsdl:operation name="insertABC">
<wsdl:input message="tns:insertABCItemRequest1"/>
<wsdl:output message="tns:insertABCItemResponse1"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="ABCSOAP" type="tns:ABC">
<wsdl:operation name="insertABC">
<soap:operation soapAction="http://manageabc.services.abc.def/insertABC"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="ABC">
<wsdl:port binding="tns:ABCSOAP" name="ABCSOAP">
<soap:address location="http://localhost:10039/.modulename.war/services/ABCSOAP"/>
</wsdl:port>
ABC.xsd
<element name="InsertABCRequest" type="Q1:InsertABCItemRequestType">
</element>
<complexType name="InsertABCItemRequestType">
<sequence>
<element name="abcdId" type="int"/>
<element name="abcdCode" type="string"/>
<element name="abcNumber" type="string"/>
</sequence>
</complexType>
<element name="InsertABCItemResponse" type="Q1:InsertABCItemResponseType">
</element>
<complexType name="insertABCItemResponse">
<sequence>
<element name="responseHeader" type="Q1:ResponseCodeType"/>
</sequence>
</complexType>
Exception :
[11/28/14 13:21:20:240 IST] 000000af WebServicesSe E com.ibm.ws.webservices.engine.transport.http.WebServicesServlet doPost WSWS3227E: Error: Exception:
WebServicesFault
faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.generalException
faultString: org.xml.sax.SAXException: WSWS3047E: Error: Cannot deserialize element fieldName of bean com.abc.xyz.abc.InsertABCRequestType.
Child element fieldName does not belong in namespace .
Most likely, a third party web services platform has sent an incorrect SOAP message. Message being parsed:
faultActor: null
faultDetail:
org.xml.sax.SAXException: WSWS3047E: Error: Cannot deserialize element fieldName of bean com.abc.xyz.abc.InsertABCRequestType.
Child element InsertABCRequestType does not belong in namespace .
Most likely, a third party web services platform has sent an incorrect SOAP message. Message being parsed:
at com.ibm.ws.webservices.engine.WebServicesFault.makeFault(WebServicesFault.java:300)
at com.ibm.ws.webservices.engine.SOAPPart._getSOAPEnvelope(SOAPPart.java:1090)
at com.ibm.ws.webservices.engine.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:628)
at com.ibm.ws.webservices.engine.SOAPPart.getEnvelope(SOAPPart.java:656)
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandlerChain.handleRequest(JAXRPCHandlerChain.java:301)
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler.invokeServerRequestHandler(JAXRPCHandler.java:516)
at com.ibm.ws.webservices.engine.handlers.jaxrpc.JAXRPCHandler$1.invoke(JAXRPCHandler.java:381)
at com.ibm.ws.webservices.engine.PivotHandlerWrapper.invoke(PivotHandlerWrapper.java:225)
at com.ibm.ws.webservices.engine.WebServicesEngine.invoke(WebServicesEngine.java:336)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServlet.doPost(WebServicesServlet.java:1246)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:738)
at com.ibm.ws.webservices.engine.transport.http.WebServicesServletBase.service(WebServicesServletBase.java:344)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:831)
Environment Details :
Server : IBM WAS 7.0.0.31
IDE : IBM RAD 8.5
Please let me know if any other information is required.
#BK Elizabeth - thank you for your response. As per the current implementation it is the wsdl that is used to generate the java beans using top down approach instead of bottom up approach you referred to in your comment (no doubt that is a better approach).
The real problem was that the generated beans are added at the container level as a shared lib since objects of the beans are passed between multiple modules. So even though I was updating the beans at module level but actually a previous version of the service beans were loaded. On updating the shared lib my changes started reflecting and the error "WSWS3047E: Error: Cannot deserialize element" got resolved".
For "WSWS3047E: Error: Cannot deserialize element" error below mentioned link can be referred, though my problem was bit different problem.
http://www-01.ibm.com/support/docview.wss?uid=swg21220377
I've generated an XSD from a set of example request files for an XML web service (using Xmplify - but I doubt that's important).
When I run this through gsoap, I get no errors or warnings, but even with -i or -j option on soapcpp2, I get no C++ proxy files generated (eg soapProxy.h).
Only the following files are generated:
ns1.nsmap
request.h
soapC.cpp
soapH.h
soapStub.h
Commands used:
wsdl2h request.xsd
soapcpp2 -i -C -I/usr/local/share/gsoap/import request.h
I figure there is something specific about the XSD required in order to generate these?
How do I get the proxy files generated? I know I can use without proxy objects, but it looks a lot more messy!
Schema doc is included below.
Thanks for any advice!
Phil.
<xs:schema xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='unqualified'>
<xs:element name='REQUEST'>
<xs:complexType>
<xs:sequence>
<xs:element ref='USERTOKEN'/>
<xs:element ref='ACTION'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='USERTOKEN'>
<xs:complexType>
<xs:sequence>
<xs:element ref='USERKEY'/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name='USERKEY' type='xs:NCName'/>
<xs:element name='ACTION'>
<xs:complexType>
<xs:sequence>
<xs:element minOccurs='0' ref='PARAMETER'/>
</xs:sequence>
<xs:attribute name='NAME' use='required' type='xs:NCName'/>
</xs:complexType>
</xs:element>
<xs:element name='PARAMETER'>
<xs:complexType mixed='true'>
<xs:attribute name='NAME' use='required' type='xs:NCName'/>
</xs:complexType>
</xs:element>
</xs:schema>
The wsdl2h tool does not generate proxy and service code for XSD files, since there are no operations defined in these (only in WSDL). You can use the gSOAP-generated (de)serializers for the XSD root elements to send/recv XML data that is (de)serialized from the C++ data types. For example
#include "ns1.nsmap" // ns1 namespaces etc
struct soap *ctx = soap_new();
ns1__REQUEST r;
r.soap_default(ctx); // reset content
r.USERTOKEN = … // set r's content as needed
ctx.os = … // set the output stream
soap_write_ns1__REQUEST(ctx, &r); // serialize REQUEST
You can send/recv data over streams, sockets, etc.
I have problem in copying the output of a service response to the response message in BPEL .
The amount element has an attribute currency, How do I acheiev this ? All other copying seems to work fine, except copying an element to an attribute of another element.
The copy expression is below.
<copy>
<from variable="InvokePersistence_insert_OutputVariable"
part="ProBookingInitiationCollection" query="/ns3:ProBookingInitiationCollection/ns3:ProBookingInitiation/ns3:bookingDetail/ns3:isoCurrencyCd"/>
<to variable="outputVariable" part="payload"
query="/ns4:BookingConfirmation/ns4:amount/#ns4:currency"/>
</copy>
The excerpts from xsd is below
<xs:element name="amount">
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:decimal">
<xs:attribute name="currency" type="xs:string"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>
Make sure that "outputVariable" output variable is properly initialised according to the schema and contains an attribute called "currency"
We have JAX-RPC style web service, with a complex type defined as follows:
<xs:complexType name = "SomeFault">
<xs:sequence>
<xs:element name = "errorMessages" type="some:ErrorMessageWSType" minOccurs="0" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
<xs:simpleType name = "ErrorMessageWSType">
<xs:restriction base = "xs:NMTOKEN">
<xs:enumeration value = "INVALID_1"/>
<xs:enumeration value = "INVALID_2"/>
<xs:enumeration value = "INVALID_3"/>
</xs:restriction>
</xs:simpleType>
We are running into Marshaling exception on the server side when the response/fault complex type has a single array type field.
weblogic.wsee.codec.CodecException: Failed to encode
com.bea.xml.XmlException: failed to find a suitable binding type for
use in marshalling object
"[Lnamespace.type.ErrorMessageWSType;#693767e9". using schema type:
t=SomeFault#http://namespace/SOME/v1 java
type:namespace.type.ErrorMessageWSType[]
If we change SomeFault, by adding another element to the complex type the error goes away.
<xs:complexType name = "SomeFault">
<xs:sequence>
<xs:element name = "errorMessages" type="some:ErrorMessageWSType" maxOccurs="unbounded" />
<xs:element name = "dummyString" type="xsd:string" minOccurs="0" />
</xs:sequence>
</xs:complexType>
Are we doing something wrong during the wsdlc code generation or is this a known issue?
A similar question is already posted at https://forums.oracle.com/forums/thread.jspa?messageID=4462906, but without any response, any pointers would be great.
Thanks.
Don't know if this solves the "why" part of the question, but you could try rewriting the sequence part like:
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:element name="errorMessages" type="some:ErrorMessageWSType"/>
</xs:sequence>
OTOH, what might be the mechanism that lets the second case work, but not the first?
Might it be that the marshaller then has to figure out what xsd:string means before checking what some:ErrorMessageWSType means, and then has to wake up a resolver or something?
This line of thought leads to the second approach I would try, which would be to declare ErrorMessageWSType before SomeFault (and perhaps in another namespace, just to see if that fixes anything).
Just my (tired) two cents, and I guess that both of these approaches presume a bug of some sort in the marshaller, because I can't really see that anything in your example code isn't according to the XML schema definition.