You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-dev@xml.apache.org by Naggi Rao <na...@softhome.net> on 2001/06/18 23:00:49 UTC
Re: User defined object as a request, literal XML as aresponse. Poss ible?!
hi,
Let me know if you need help..
I have a method which accepts a Element(Object) and returns a Literal XML
Naggi
----- Original Message -----
From: "Hecking, Dirck J" <Di...@rsco.com>
To: <so...@xml.apache.org>; <so...@xml.apache.org>
Sent: Monday, June 18, 2001 1:33 PM
Subject: FW: User defined object as a request, literal XML as aresponse.
Poss ible?!
> Guys,
>
> Can someone please take a shot at my problem?
>
> -Dirck
>
> -----Original Message-----
> From: Hecking, Dirck J [mailto:Dirck_Hecking@rsco.com]
> Sent: Friday, June 15, 2001 11:13 AM
> To: 'soap-dev@xml.apache.org'
> 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:faultListene
> 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.
>
>
> --------------------------------------------------------------------------
--
> --
>
>