Hi Dirck,
You were right. It turns out there was a bug in the BeanSerializer that
prevented the client from using a BeanSerializer to serialize SOAP-encoded
parameters within a Call labeled with the literalXML encoding style. Since
the bug was in the BeanSerializer, it only came up when the user explicitly
used the BeanSerializer for serializing their JavaBean-compliant types. The
previous tests we've done with this scenario all used simple types and/or
user-defined serializers, not the BeanSerializer; that's why we had never
seen this before. In any case, the fix amounted to changing one argument to
one method call within the BeanSerializer.marshall(...) method. I have
committed the change to the CVS repository. Workarounds include: making the
change yourself and rebuilding, updating to the latest version of the code
in the CVS tree and rebuilding, or not using the BeanSerializer to marshall
your parameters.
Thanks for being persistent on this.
Also, I've added to the web-site a FAQ containing some information about RPC
response encoding styles. It can be reached by first clicking on the FAQs
button from the Apache SOAP page (http://xml.apache.org/soap). Then, click
on the "RPC Response Encoding Styles" link from the "See Also" list of
documents at the top of the page.
Thanks,
-Matt
> -----Original Message-----
> From: Hecking, Dirck J [mailto:[EMAIL PROTECTED]]
> Sent: Monday, June 18, 2001 4:33 PM
> To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
> Subject: FW: User defined object as a request, literal XML as a
> response. Poss ible?!
>
>
> Guys,
>
> Can someone please take a shot at my problem?
>
> -Dirck
>
> -----Original Message-----
> From: Hecking, Dirck J [mailto:[EMAIL PROTECTED]]
> Sent: Friday, June 15, 2001 11:13 AM
> To: '[EMAIL PROTECTED]'
> Subject: User defined object as a request, literal XML as a response.
> Poss ible?!
>
>
> Guys,
>
> Dirck here again. I have read several mails regarding this issue.
> I have not
> seen one that illustrates my exact problem. The key here is that I want to
> recieve literal xml in my response but want to supply a user
> defined object
> as the requesting parameter. This code actually executes the service fine
> and reads the arguements out of my object. The
> response gets lost though, even though I specified literal xml encoding as
> the default encoding for my document. My Apache Soap Service running on
> Weblogic 5.1 has the following characteristics:
>
> Note: The following code is a snippet.
>
> Server:
> public Element getResearch(ResearchArguments args)
> {
> DocumentBuilderFactory dbf =
> DocumentBuilderFactory.newInstance();
> DocumentBuilder xdb = dbf.newDocumentBuilder ();
> Document doc = xdb.newDocument ();
>
> Element researchElement = doc.createElement("Whatever");
>
> // Extracts fields from the ResearchArguments class and creates a
> dynamic
> // research elements based on the information.
>
> return researchElement;
> }
>
> Client:
> public Element sendRequest()
> {
> url = new URL(routerUrl);
>
> ResearchArguments args = new
> ResearchArguments("data1","data2","data3");
>
> SOAPMappingRegistry smr = new SOAPMappingRegistry();
> BeanSerializer beanSer = new BeanSerializer();
>
> smr.mapTypes(Constants.NS_URI_SOAP_ENC, new
> QName("urn:xml-soap-args-demo", "args") , ResearchArguments.class,
> beanSer,
> beanSer);
>
> call.setTargetObjectURI("urn:" + service);
> call.setMethodName(method);
> call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
>
> call.setSOAPMappingRegistry(smr);
>
> params.addElement(new Parameter("args",
> ResearchArguments.class,
> args,
> Constants.NS_URI_SOAP_ENC));
>
> call.setParams(params);
>
> resp = call.invoke(url, "");
> // A fault gets generated from the server after this line
> }
>
> Exception:
> Generated fault:
> Fault Code = SOAP-ENV:Server
> Fault String = java.lang.IllegalArgumentException: No Serializer found
> to
> serialize a 'org.w3c.dom.Element' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'.
>
> Deployment Descriptor:
> <isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment"
> id="urn:HQService">
> <isd:provider type="java"
> scope="Application"
> methods="getResearch">
> <isd:java class="rs.ecommerce.service.providers.HQService"
> static="false"/>
> </isd:provider>
>
>
> <isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:fa
ultListene
> r>
>
> <isd:mappings>
> <isd:map
> encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> xmlns:x="urn:xml-soap-args-demo" qname="x:args"
>
> javaType="rs.ecommerce.service.xmlobjects.ResearchArguments"
>
> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
>
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"/>
> </isd:mappings>
> </isd:service>
>
>
>
> ------------------------------------------------------------------
> ----------
> --
> DISCLAIMER
>
> Notice Regarding Entry of Orders and Instructions:
>
> Please do not transmit orders and/or instructions regarding your Robertson
> Stephens account(s) by e-mail. Orders and/or instructions transmitted by
> e-mail will not be accepted by Robertson Stephens, and Robertson Stephens
> will not be responsible for carrying out such orders and/or instructions.
>
> Notice Regarding Privacy and Confidentiality:
>
> Robertson Stephens reserves the right to monitor and review the content of
> all e-mail communications sent and/or received by its employees.
>
>
> ------------------------------------------------------------------
> ----------
> --
>
> ------------------------------------------------------------------
> ----------
> --
> DISCLAIMER
>
> Notice Regarding Entry of Orders and Instructions:
>
> Please do not transmit orders and/or instructions regarding your Robertson
> Stephens account(s) by e-mail. Orders and/or instructions transmitted by
> e-mail will not be accepted by Robertson Stephens, and Robertson Stephens
> will not be responsible for carrying out such orders and/or instructions.
>
> Notice Regarding Privacy and Confidentiality:
>
> Robertson Stephens reserves the right to monitor and review the content of
> all e-mail communications sent and/or received by its employees.
>
>
> ------------------------------------------------------------------
> ----------
> --
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>