Look at comments below .....

Thanks,
Kuntal Das
Charles Schwab & Co., Inc.
Wireless Technology
45 Fremont, SF
Email : [EMAIL PROTECTED]
Phone : (415)667-4322
Live life to the brim.................



-----Original Message-----
From: [EMAIL PROTECTED]
[ mailto:[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]> ]
Sent: Tuesday, June 05, 2001 5:53 AM
To: [EMAIL PROTECTED]
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 <http://localhost>  ......");
     SOAPMappingRegistry smr = new SOAPMappingRegistry();
     BeanSerializer beanSer = new BeanSerializer();

>>>>>> I don't know whether u need BeanSerializer here. Well, if u r
returning a Bean Object from ur remote Soap-server method, then it's ok.
Otherwise don't, since Soap itself takes care of that when u do the
"call.setEncodingStyleURI(encodingStyleURI);", if the return types r the
ones supported by the "NS_URI_SOAP_ENC"encoding style(see
http://xml.apache.org/soap/docs/guide/serializer.html
<http://xml.apache.org/soap/docs/guide/serializer.html> ).
       
      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));

>>>>>>>>> use params.addElement(new Parameter("addedfile",
org.w3c.dom.Document.class, docXML, NS_URI_LITERAL_XML));

          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/'.;
<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/'
<http://schemas.xmlsoap.org/soap/encoding/'> .]
                    at
org.apache.soap.transport.http.SOAPHTTPConnection.send(SOAPHTTPConnection.ja
va: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: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to