ws-soap-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Saint-Martin Cecile" <csaintmar...@symetrx.com>
Subject Re: Question about Parameters
Date Tue, 05 Jun 2001 14:22:15 GMT
Try
        params.addElement (new Parameter("addedfile", Element.class, docXML.getDocumentElement(),
org.apache.soap.Constants.NS_URI_LITERAL_XML));

Cecile Saint-Martin
csaintmartin@symetrx.com
----- Original Message -----
From: <manuel.paitreault@cnedi69.cnafmail.fr>
To: <soap-user@xml.apache.org>
Sent: Tuesday, June 05, 2001 2:53 PM
Subject: Question about Parameters


> Hi,
>
> I'd like to send a service invocation to a server with any types parameter
> .... for example, I have a "XML" file, I want to parse it and constructs a
> DOM tree representation ... and I'd like to send it to a SOAP server in
> order to get the content of an element ... so I tried to send a "call" with
> one "dom.Document" parameter .... here is the client program (without catch
> etc ....):
> ----------------------------------------------------------------------------------------------------------------------------------
--------------
>      String encodingStyleURI = Constants.NS_URI_SOAP_ENC;
>      URL url = new URL("http://localhost ......");
>      SOAPMappingRegistry smr = new SOAPMappingRegistry();
>      BeanSerializer beanSer = new BeanSerializer();
>       try
>      {
>                     Call call = new Call();
>                      call.setSOAPMappingRegistry(smr);
>           call.setTargetObjectURI("urn:SOAP");
>                      call.setMethodName("Getting");
>                     call.setEncodingStyleURI(encodingStyleURI);
>
>           DOMParser parser = new DOMParser();
>           try
>           {
>                parser.parse("XMLFile.xml");
>           }
>           Document docXML = parser.getDocument();
>
>            Vector params = new Vector();
> ------------------>      params.addElement(new Parameter("addedfile",
> org.w3c.dom.Document.class, docXML, null));
>
>           call.setParams(params);
>
>           Response resp;
>
>           resp = call.invoke(url, "");
>
>
>           if (!resp.generatedFault ())
>           {
>                 Parameter result = resp.getReturnValue ();
>                 System.out.println((String)result.getValue ());
>           }
> }
> ----------------------------------------------------------------------------------------------------------------------------------
-----
>
> but it doesn't work because of :
>      [SOAPException: faultCode=SOAP-ENV:Client; msg=No Serializer found to
> serialize a 'org.w3c.dom.Document' using encoding style "
> http://schemas.xmlsoap.org/soap/encoding/'.;
> targetException=java.lang.IllegalArgumentException: No Serializer found to
> serialize a              'org.w3c.dom.Document' using encoding style
> 'http://schemas.xmlsoap.org/soap/encoding/'.]
>                     at
> org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.java:224)
>                 at org.apache.soap.rpc.Call.invoke(Call.java:203)
>                    at ClientSOAP.main(ClientSOAP.java:65)
>
>
> What is the solution ?? what do I forget to do  ???
>
> thank you !!
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
> For additional commands, email: soap-user-help@xml.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: soap-user-unsubscribe@xml.apache.org
For additional commands, email: soap-user-help@xml.apache.org


Mime
View raw message