You are viewing a plain text version of this content. The canonical link for it is here.
Posted to soap-user@ws.apache.org by Jonathan Roberts <j_...@yahoo.co.uk> on 2003/06/02 11:54:29 UTC

de-serialisation problem

Hi.
 
I'm getting the following errors on the response from the soap server :
 
on the 
r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
call
where Response r;
and Call c;
---------------------------------------------------------------------------
 
Error report : 
1. If information exists and is returned :

Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp

You chose fetchAccountUsingAccountNo 10015301

Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr

gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].

----------------------------------------------------------------------------------------------------
2.  If no information:

Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=

Can't yet deserialize non-null Objects; 

targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]

------------------------------------------

Isssues : 

1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :

  QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
  //map the type
  smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
  //telling the call object to use this mapping
  c.setSOAPMappingRegistry(smr);

2. and the xml

<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"

xmlns:x="urn:xml-IVR-App" 

qname="x:java.sql.Timestamp"

javaType="java.sql.Timestamp"

java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"

/>

3.  Wierder  - this works on the development machine but not on the stand-alone Test Server.

Any help would be appreciated.

Jonathan






---------------------------------
Yahoo! Plus - For a better Internet experience

Re: de-serialisation problem

Posted by Scott Nichol <sn...@scottnichol.com>.
It looks like SOAP 2.2 versus SOAP 2.3.1.  The exact file sizes are

File		2.2			2.3.1
--------	-------		-------
soap.war	359,462		375,487
soap.jar	220,703		232,498

The 2.3.1 code (correctly) refuses to recognize xsi:null attributes 
for the 2001 schema.  In that spec, the correct attribute is xsi:nil. 
This caused a fair amount of grief with implementations that used 
xsi:null even for the 2001 schema, so the current code base allows 
the (incorrect) mixing of xsi:null and the 2001 schema.

On 4 Jun 2003 at 7:40, Jonathan Roberts wrote:

> Scott,
>  
> Details are
>  
> non-working soap.war File : 367 KB,  (31/05/2002)
> working soap file : 352 KB, (29/05/2002)
> 
>  
> Failing XML :
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 
> 
> Working XML:
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
> xmlns:xsd="http://www.w3.org/1999/XMLSchema"> 
> 
>  
> Obviously one is 2001, compared to 1999.
>  
> Hope this helps.
>  
> Thanks again.
>  
> Regards
>  
> Jonathan
>  
>  
> 
> Scott Nichol <sn...@scottnichol.com> wrote:
> Can you tell me the sizes of the 2 war files?
> 
> Also, with the xml sniffer, do you see the same version of the XML 
> schema namespace for xmlns:xsd="..."?
> 
> On 3 Jun 2003 at 11:59, Jonathan Roberts wrote:
> 
> > Scott,
> > Excellent news - this was defiantely a version issue. I've just made doubly sure and the version of the soap war files "are different". 
> > 
> > Interestly the latest version causes this error whereas the older version does not.
> > 
> > Scott again thanks for all your help and your continual support of this newsgroup.
> > 
> > Kind Regard
> > 
> > Jonathan
> > 
> > 
> > 
> > Scott Nichol wrote:
> > If the value being serialized is really null and you have the same 
> > version of Apache SOAP on the deployment server as the development, I 
> > would expect things to work.
> > 
> > It is true that null values can be deserialized. This should be true 
> > for beans you've mapped and ones you have not (ur-type). Given the 
> > errors you have, though, it does not seem that a null is really being 
> > serialized. For example
> > 
> > Can't yet deserialize non-null Objects; 
> > 
> > is an error that comes up only when you have xsi:type="xsd:ur-type" 
> > without xsi:null="true" or xsi:nil="true".
> > 
> > This makes me wonder whether you really have a null value you are 
> > returning, and whether you are using the same version of Apache SOAP 
> > in deployment (because handling of xsi:null and xsi:nil has been 
> > improved along the way).
> > 
> > On 2 Jun 2003 at 16:03, Jonathan Roberts wrote:
> > 
> > > Hi Scott,
> > > 
> > > I have 2 applications using a number of Value Objects. One of these is a Web Service. In the Web Service implementation the Timestamp is in one of the Value Objects however its value is nver set, and always null. On my development server this seems to work fine and seems to deal with it 
> > (maybe false comfort). 
> > > 
> > > This is the same scenario on the deployment Server, however here it seems to fail. It's as if its denomination xsi:null="true", is sufficent to allow it through the soap system, i.e. since it is always null, soap has never attempted to try and deserialize it.
> > > 
> > > Hope this makes sense.
> > > 
> > > Jonathan
> > > 
> > > Scott Nichol wrote:
> > > I don't see how it could ever work, unless some version of 
> > > java.sql.Timestamp has a default ctor. The following code in 
> > > BeanSerializer creates the bean:
> > > 
> > > private Object instantiateBean(Class javaType)
> > > throws IllegalArgumentException
> > > {
> > > try
> > > {
> > > return javaType.newInstance();
> > > }
> > > catch (Throwable t)
> > > {
> > > throw new IllegalArgumentException("Unable to instantiate '" +
> > > 
> > > StringUtils.getClassName(javaType) +
> > > "': " + t.getMessage());
> > > }
> > > }
> > > 
> > > The newInstance is only going to work if the class has a default ctor 
> > > (or in Sun's terminology, a "nullary constructor").
> > > 
> > > On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> > > 
> > > > HI Scott,
> > > > 
> > > > I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes. This seems to be fine on my machine but not on a deployment server. Could it be a class problem?
> > > > 
> > > > Cheers
> > > > 
> > > > Jonathan
> > > > 
> > > > Scott Nichol wrote:
> > > > java.sql.Timestamp does not have a default constructor, which Apache 
> > > > SOAP requires for instantiation. An alternative for you would be to 
> > > > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > > > de-serialize.
> > > > 
> > > > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > > > 
> > > > > Hi.
> > > > > 
> > > > > I'm getting the following errors on the response from the soap server :
> > > > > 
> > > > > on the 
> > > > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > > > call
> > > > > where Response r;
> > > > > and Call c;
> > > > > ---------------------------------------------------------------------------
> > > > > 
> > > > > Error report : 
> > > > > 1. If information exists and is returned :
> > > > > 
> > > > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > > > 
> > > > > You chose fetchAccountUsingAccountNo 10015301
> > > > > 
> > > > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > > > 
> > > > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > > > 
> > > > > ----------------------------------------------------------------------------------------------------
> > > > > 2. If no information:
> > > > > 
> > > > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > > > 
> > > > > Can't yet deserialize non-null Objects; 
> > > > > 
> > > > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > > > > 
> > > > > ------------------------------------------
> > > > > 
> > > > > Isssues : 
> > > > > 
> > > > > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > > > > 
> > > > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > > > //map the type
> > > > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > > > //telling the call object to use this mapping
> > > > > c.setSOAPMappingRegistry(smr);
> > > > > 
> > > > > 2. and the xml
> > > > > 
> > > > > > 
> > > > > xmlns:x="urn:xml-IVR-App" 
> > > > > 
> > > > > qname="x:java.sql.Timestamp"
> > > > > 
> > > > > javaType="java.sql.Timestamp"
> > > > > 
> > > > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > > > 
> > > > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > > > 
> > > > > />
> > > > > 
> > > > > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > > > > 
> > > > > Any help would be appreciated.
> > > > > 
> > > > > Jonathan
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > ---------------------------------
> > > > > Yahoo! Plus - For a better Internet experience
> > > > > 
> > > > 
> > > > 
> > > > Scott Nichol
> > > > 
> > > > Do not reply directly to this e-mail address,
> > > > as it is filtered to only receive e-mail from
> > > > specific mailing lists.
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > ---------------------------------
> > > > Yahoo! Plus - For a better Internet experience
> > > > 
> > > 
> > > 
> > > Scott Nichol
> > > 
> > > Do not reply directly to this e-mail address,
> > > as it is filtered to only receive e-mail from
> > > specific mailing lists.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: AW: Problem with Host-connection in combination with some Proxies

Posted by Scott Nichol <sn...@scottnichol.com>.
Glad to hear you found the problem.  I do not know of a standard way 
to determine whether there is a proxy, but I am certainly not an 
expert on the subject.

On 5 Jun 2003 at 9:58, Malte Kempff wrote:

> Hi Scott,
> 
> I saw now cause of the problem. Thanks for your hint it helped me. The
> property in the file was set manually
> and its name was written in the wrong way.
> I have now one check more to recognice a missing proxy looking for the other
> String "java.net.NoRouteToHostException".
> By the way, is there a better technique to determine a proxy than to look
> over the exception Message?
> 
> -----Ursprungliche Nachricht-----
> Von: Malte Kempff [mailto:kempffm@medicalcolumbus.de]
> Gesendet: Donnerstag, 5. Juni 2003 09:26
> An: soap-user@ws.apache.org
> Betreff: AW: Problem with Host-connection in combination with some
> Proxies
> 
> 
> Hi Scott,
> 
> The proxy's Address is asked to the user via a dialog and the Information
> are then stored as properties in a file.
> the proxy-information is set to soap  with something like this
> 
> 
> st.setProxyHost(proxyHost);
> st.setProxyPort(Integer.parseInt(proxyPort));
> 
> SOAPContext ctx = new SOAPContext();
> 			ctx.setGzip(true);
> 			Call call = new Call("urn:Bestterm",
> 						   callName,
> 		                           params,
> 						   null,
> 		                           Constants.NS_URI_SOAP_ENC,
> 						   ctx
> 						        );
> call.setSOAPTransport(st);
> ...
> 
> 
> 
> The Dialog pops up when there is a Soap-Exception with the Message
> something like this
> 
> 			catch (SOAPException sEx)
> 			{
> 				if (  sEx.getMessage().indexOf("Error opening socket:")>-1
> 					||sEx.getMessage().indexOf("Connection refused:")>-1)
> 
> 				.... popup Dialog an get proxy infos
> 
> 			}//end of catch (SOAPException sEx)
> 
> 
> In the traces I see that the Proxy-properties are set, so I suppose that
> they are set.
> 
> for detail I send the class, which manages all the soap calls, as
> attachment.
> 
> thanks in advance
> 
> Malte
> 
> 
> -----Ursprungliche Nachricht-----
> Von: Scott Nichol [mailto:snicholnews@scottnichol.com]
> Gesendet: Mittwoch, 4. Juni 2003 21:23
> An: soap-user@ws.apache.org
> Betreff: Re: Problem with Host-connection in combination with some
> Proxies
> 
> 
> "No route to host" typically means that the host is being connected
> to without using a proxy, and the firewall is blocking the connection
> attempt.  How does your app determine their is a proxy?
> 
> On 4 Jun 2003 at 12:18, Malte Kempff wrote:
> 
> > Hello
> >
> > there are some for me not understandeble Problems with Connections to the
> > Host via Apache Soap while using Proxies.
> > The application is a Java-Web-Start-Application. Everything is working
> with
> > the given Proxy, the bowser, the receiving of
> > the application via Java-Web-Start. But trying to make a soap-call ends in
> a
> > exceptions like this, allthough the proxy-address was given.
> >
> > [SOAPException: faultCode=SOAP-ENV:Client; msg=Error connecting to
> > 62.159.233.111:80: java.net.NoRouteToHostException: No route to host:
> > connect; targetException=java.net.NoRouteToHostException: No route to
> host:
> > connect]
> > 	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
> > 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> > 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> > 	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
> > 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> > 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> > 	at
> >
> de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
> > r.java:75)
> > 	at
> >
> de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
> > 457)
> > 	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
> > 	at
> >
> de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
> > ava:46)
> > 	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
> > 	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
> > 	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
> > 	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
> > 	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
> > 	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
> > 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > 	at java.lang.reflect.Method.invoke(Unknown Source)
> > 	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> > 	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> > 	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
> > 	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
> > 	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
> > 	at com.sun.javaws.Launcher.run(Unknown Source)
> > 	at java.lang.Thread.run(Unknown Source)
> > Caused by: java.net.NoRouteToHostException: No route to host: connect
> > 	at java.net.PlainSocketImpl.socketConnect(Native Method)
> > 	at java.net.PlainSocketImpl.doConnect(Unknown Source)
> > 	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
> > 	at java.net.PlainSocketImpl.connect(Unknown Source)
> > 	at java.net.Socket.connect(Unknown Source)
> > 	at java.net.Socket.connect(Unknown Source)
> > 	at java.net.Socket.<init>(Unknown Source)
> > 	at java.net.Socket.<init>(Unknown Source)
> > 	at org.apache.soap.util.net.SocketUtils.createSocket(Unknown Source)
> > 	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
> > 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> > 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> > 	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
> > 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> > 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> > 	at
> >
> de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
> > r.java:75)
> > 	at
> >
> de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
> > 457)
> > 	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
> > 	at
> >
> de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
> > ava:46)
> > 	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
> > 	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
> > 	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
> > 	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
> > 	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
> > 	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
> > 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> > 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> > 	at java.lang.reflect.Method.invoke(Unknown Source)
> > 	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> > 	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> > 	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
> > 	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
> > 	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
> > 	at com.sun.javaws.Launcher.run(Unknown Source)
> > 	at java.lang.Thread.run(Unknown Source)
> >
> > Otherwise the same application works by different customers which also use
> a
> > proxy.
> > Once when a customer changed the proxy-software the application got
> timeouts
> > for every soap-call
> > Can it be, that some proxies have problems with apache-soap in general?
> > Does it makes a difference for soap using a certian proxy-software in the
> > network?
> > what can be wrong?
> >
> > thanks for any hints in advance
> >
> > Malte
> >
> > PS: One of the customers having trouble is unsing AVM Ken as proxy-server
> >
> >
> >
> >
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



AW: Problem with Host-connection in combination with some Proxies

Posted by Malte Kempff <ke...@medicalcolumbus.de>.
Hi Scott,

I saw now cause of the problem. Thanks for your hint it helped me. The
property in the file was set manually
and its name was written in the wrong way.
I have now one check more to recognice a missing proxy looking for the other
String "java.net.NoRouteToHostException".
By the way, is there a better technique to determine a proxy than to look
over the exception Message?

-----Ursprungliche Nachricht-----
Von: Malte Kempff [mailto:kempffm@medicalcolumbus.de]
Gesendet: Donnerstag, 5. Juni 2003 09:26
An: soap-user@ws.apache.org
Betreff: AW: Problem with Host-connection in combination with some
Proxies


Hi Scott,

The proxy's Address is asked to the user via a dialog and the Information
are then stored as properties in a file.
the proxy-information is set to soap  with something like this


st.setProxyHost(proxyHost);
st.setProxyPort(Integer.parseInt(proxyPort));

SOAPContext ctx = new SOAPContext();
			ctx.setGzip(true);
			Call call = new Call("urn:Bestterm",
						   callName,
		                           params,
						   null,
		                           Constants.NS_URI_SOAP_ENC,
						   ctx
						        );
call.setSOAPTransport(st);
...



The Dialog pops up when there is a Soap-Exception with the Message
something like this

			catch (SOAPException sEx)
			{
				if (  sEx.getMessage().indexOf("Error opening socket:")>-1
					||sEx.getMessage().indexOf("Connection refused:")>-1)

				.... popup Dialog an get proxy infos

			}//end of catch (SOAPException sEx)


In the traces I see that the Proxy-properties are set, so I suppose that
they are set.

for detail I send the class, which manages all the soap calls, as
attachment.

thanks in advance

Malte


-----Ursprungliche Nachricht-----
Von: Scott Nichol [mailto:snicholnews@scottnichol.com]
Gesendet: Mittwoch, 4. Juni 2003 21:23
An: soap-user@ws.apache.org
Betreff: Re: Problem with Host-connection in combination with some
Proxies


"No route to host" typically means that the host is being connected
to without using a proxy, and the firewall is blocking the connection
attempt.  How does your app determine their is a proxy?

On 4 Jun 2003 at 12:18, Malte Kempff wrote:

> Hello
>
> there are some for me not understandeble Problems with Connections to the
> Host via Apache Soap while using Proxies.
> The application is a Java-Web-Start-Application. Everything is working
with
> the given Proxy, the bowser, the receiving of
> the application via Java-Web-Start. But trying to make a soap-call ends in
a
> exceptions like this, allthough the proxy-address was given.
>
> [SOAPException: faultCode=SOAP-ENV:Client; msg=Error connecting to
> 62.159.233.111:80: java.net.NoRouteToHostException: No route to host:
> connect; targetException=java.net.NoRouteToHostException: No route to
host:
> connect]
> 	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at
>
de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
> r.java:75)
> 	at
>
de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
> 457)
> 	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
> 	at
>
de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
> ava:46)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
> 	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
> 	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
> 	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
> 	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> 	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> 	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
> 	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
> 	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
> 	at com.sun.javaws.Launcher.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.net.NoRouteToHostException: No route to host: connect
> 	at java.net.PlainSocketImpl.socketConnect(Native Method)
> 	at java.net.PlainSocketImpl.doConnect(Unknown Source)
> 	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
> 	at java.net.PlainSocketImpl.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at org.apache.soap.util.net.SocketUtils.createSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at
>
de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
> r.java:75)
> 	at
>
de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
> 457)
> 	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
> 	at
>
de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
> ava:46)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
> 	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
> 	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
> 	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
> 	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> 	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> 	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
> 	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
> 	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
> 	at com.sun.javaws.Launcher.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
>
> Otherwise the same application works by different customers which also use
a
> proxy.
> Once when a customer changed the proxy-software the application got
timeouts
> for every soap-call
> Can it be, that some proxies have problems with apache-soap in general?
> Does it makes a difference for soap using a certian proxy-software in the
> network?
> what can be wrong?
>
> thanks for any hints in advance
>
> Malte
>
> PS: One of the customers having trouble is unsing AVM Ken as proxy-server
>
>
>
>


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.





AW: Problem with Host-connection in combination with some Proxies

Posted by Malte Kempff <ke...@medicalcolumbus.de>.
Hi Scott,

The proxy's Address is asked to the user via a dialog and the Information
are then stored as properties in a file.
the proxy-information is set to soap  with something like this


st.setProxyHost(proxyHost);
st.setProxyPort(Integer.parseInt(proxyPort));

SOAPContext ctx = new SOAPContext();
			ctx.setGzip(true);
			Call call = new Call("urn:Bestterm",
						   callName,
		                           params,
						   null,
		                           Constants.NS_URI_SOAP_ENC,
						   ctx
						        );
call.setSOAPTransport(st);
...



The Dialog pops up when there is a Soap-Exception with the Message
something like this

			catch (SOAPException sEx)
			{
				if (  sEx.getMessage().indexOf("Error opening socket:")>-1
					||sEx.getMessage().indexOf("Connection refused:")>-1)

				.... popup Dialog an get proxy infos

			}//end of catch (SOAPException sEx)


In the traces I see that the Proxy-properties are set, so I suppose that
they are set.

for detail I send the class, which manages all the soap calls, as
attachment.

thanks in advance

Malte


-----Ursprungliche Nachricht-----
Von: Scott Nichol [mailto:snicholnews@scottnichol.com]
Gesendet: Mittwoch, 4. Juni 2003 21:23
An: soap-user@ws.apache.org
Betreff: Re: Problem with Host-connection in combination with some
Proxies


"No route to host" typically means that the host is being connected
to without using a proxy, and the firewall is blocking the connection
attempt.  How does your app determine their is a proxy?

On 4 Jun 2003 at 12:18, Malte Kempff wrote:

> Hello
>
> there are some for me not understandeble Problems with Connections to the
> Host via Apache Soap while using Proxies.
> The application is a Java-Web-Start-Application. Everything is working
with
> the given Proxy, the bowser, the receiving of
> the application via Java-Web-Start. But trying to make a soap-call ends in
a
> exceptions like this, allthough the proxy-address was given.
>
> [SOAPException: faultCode=SOAP-ENV:Client; msg=Error connecting to
> 62.159.233.111:80: java.net.NoRouteToHostException: No route to host:
> connect; targetException=java.net.NoRouteToHostException: No route to
host:
> connect]
> 	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at
>
de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
> r.java:75)
> 	at
>
de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
> 457)
> 	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
> 	at
>
de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
> ava:46)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
> 	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
> 	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
> 	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
> 	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> 	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> 	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
> 	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
> 	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
> 	at com.sun.javaws.Launcher.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.net.NoRouteToHostException: No route to host: connect
> 	at java.net.PlainSocketImpl.socketConnect(Native Method)
> 	at java.net.PlainSocketImpl.doConnect(Unknown Source)
> 	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
> 	at java.net.PlainSocketImpl.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at org.apache.soap.util.net.SocketUtils.createSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at
>
de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
> r.java:75)
> 	at
>
de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
> 457)
> 	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
> 	at
>
de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
> ava:46)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
> 	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
> 	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
> 	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
> 	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> 	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> 	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
> 	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
> 	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
> 	at com.sun.javaws.Launcher.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
>
> Otherwise the same application works by different customers which also use
a
> proxy.
> Once when a customer changed the proxy-software the application got
timeouts
> for every soap-call
> Can it be, that some proxies have problems with apache-soap in general?
> Does it makes a difference for soap using a certian proxy-software in the
> network?
> what can be wrong?
>
> thanks for any hints in advance
>
> Malte
>
> PS: One of the customers having trouble is unsing AVM Ken as proxy-server
>
>
>
>


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Problem with Host-connection in combination with some Proxies

Posted by Scott Nichol <sn...@scottnichol.com>.
"No route to host" typically means that the host is being connected 
to without using a proxy, and the firewall is blocking the connection 
attempt.  How does your app determine their is a proxy?

On 4 Jun 2003 at 12:18, Malte Kempff wrote:

> Hello
> 
> there are some for me not understandeble Problems with Connections to the
> Host via Apache Soap while using Proxies.
> The application is a Java-Web-Start-Application. Everything is working with
> the given Proxy, the bowser, the receiving of
> the application via Java-Web-Start. But trying to make a soap-call ends in a
> exceptions like this, allthough the proxy-address was given.
> 
> [SOAPException: faultCode=SOAP-ENV:Client; msg=Error connecting to
> 62.159.233.111:80: java.net.NoRouteToHostException: No route to host:
> connect; targetException=java.net.NoRouteToHostException: No route to host:
> connect]
> 	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at
> de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
> r.java:75)
> 	at
> de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
> 457)
> 	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
> 	at
> de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
> ava:46)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
> 	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
> 	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
> 	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
> 	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> 	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> 	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
> 	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
> 	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
> 	at com.sun.javaws.Launcher.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> Caused by: java.net.NoRouteToHostException: No route to host: connect
> 	at java.net.PlainSocketImpl.socketConnect(Native Method)
> 	at java.net.PlainSocketImpl.doConnect(Unknown Source)
> 	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
> 	at java.net.PlainSocketImpl.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.connect(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at java.net.Socket.<init>(Unknown Source)
> 	at org.apache.soap.util.net.SocketUtils.createSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
> 	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at org.apache.soap.rpc.Call.invoke(Unknown Source)
> 	at
> de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
> r.java:75)
> 	at
> de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
> 457)
> 	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
> 	at
> de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
> ava:46)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
> 	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
> 	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
> 	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
> 	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
> 	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
> 	at java.lang.reflect.Method.invoke(Unknown Source)
> 	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
> 	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
> 	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
> 	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
> 	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
> 	at com.sun.javaws.Launcher.run(Unknown Source)
> 	at java.lang.Thread.run(Unknown Source)
> 
> Otherwise the same application works by different customers which also use a
> proxy.
> Once when a customer changed the proxy-software the application got timeouts
> for every soap-call
> Can it be, that some proxies have problems with apache-soap in general?
> Does it makes a difference for soap using a certian proxy-software in the
> network?
> what can be wrong?
> 
> thanks for any hints in advance
> 
> Malte
> 
> PS: One of the customers having trouble is unsing AVM Ken as proxy-server
> 
> 
> 
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Passing string SERVICE

Posted by Scott Nichol <sn...@scottnichol.com>.
I am not sure .NET will correctly interact with your service, since 
your service uses literal XML encoding.

On 5 Jun 2003 at 1:15, Parames wrote:

> Sorry Scott ,
> i left one point ..the main purpose for me to gofor
> DOM is i want my java webservices to talk to Dot net
> client.
> 
> Thank you,
> 
> --- Scott Nichol <sn...@scottnichol.com> wrote:
> > Since no one else has, I will ask, why do you want
> > to pass this as an 
> > element?  You are working so hard to take a string,
> > which is the data 
> > you really care about, wrap it up in an Element,
> > then pass the 
> > Element as a parameter.  Wrapping it in an Element
> > does not add any 
> > information, so why no just pass the string?
> > 
> > On 4 Jun 2003 at 18:45, Parames wrote:
> > 
> > > Hi 
> > > Yes ,im passing element.Im stuck in getting String
> > > value and passing to element.....
> > > Im getting Null...
> > > here IdToLookUp  is the string im getting from GUI
> > > Where im suppose to pass element to my SERVICE..
> > > 
> > > 
> > >   IdToLookUp =jTextField1.getText();
> > > 
> > > > > // HERE the STRING TO PASS AS ELEMENT
> > > 
> > > DocumentBuilder xdb =
> > > XMLParserUtils.getXMLDocBuilder();
> > > Document doc = xdb.newDocument();
> > > Element custID =doc.createElement("CustomerID");
> > >
> > custID.appendChild(doc.createTextNode(IdToLookUp));
> > > 
> > > While printing custID ,im getting null..
> > > 
> > > Hope this time i make you clear about my doubt..
> > > Sorry for the inconvience
> > > Thanks 
> > > parames...
> > > 
> > > 
> > > 
> > > 
> > > --- Scott Nichol <sn...@scottnichol.com>
> > wrote:
> > > > I've read your post multiple times, but I still
> > do
> > > > not understand 
> > > > what you are trying to do.  Your sample code
> > looks
> > > > like you are 
> > > > passing the Element as a parameter.  What is it
> > that
> > > > you do not know 
> > > > how to do?
> > > > 
> > > > On 4 Jun 2003 at 0:53, Parames wrote:
> > > > 
> > > > > Thanks for your response ,
> > > > > Any i have query ,Im trying to send string as
> > > > > XML(Element) to the service where service
> > needs to
> > > > > fetch string matching datas from database.
> > > > > XML like Addressbook example..
> > > > > 
> > > > > Can anyone send me some code for 
> > > > > sending stringas element,Bcoz in service im
> > > > passing
> > > > > resultset to element.
> > > > > Can anyone help me??
> > > > > 
> > > > > My GUI code 
> > > > > 
> > > > > public void actionPerformed(ActionEvent event)
> > > > >     {
> > > > >  String but = event.getActionCommand();
> > > > >  if (but == "OK" )
> > > > >  {
> > > > >  //  IdToLookUp  is the value i want to take 	
> > > > >   IdToLookUp =jTextField1.getText();
> > > > > 
> > > > >   
> > > > > // HERE the STRING TO PASS AS ELEMENT
> > > > > 
> > > > > DocumentBuilder xdb =
> > > > > XMLParserUtils.getXMLDocBuilder();
> > > > >   Document doc = xdb.newDocument();
> > > > >   Element custID =
> > > > doc.createElement("CustomerID");
> > > > >  
> > > >
> > custID.appendChild(doc.createTextNode(IdToLookUp));
> > > > >           
> > > > >     	
> > > > >   //make a call to soap server with customer
> > ID
> > > > >   	       
> > > > >  try{
> > > > > 
> > > > > // GetCustInfo() is the SOAP CLIENT where i
> > need
> > > > to
> > > > > pass this element...
> > > > > 
> > > > > gci = new GetCustInfo();
> > > > >                           
> > > > > Element element =gci.callCustSVC(customerId);}
> > > > >  catch (Exception e) {
> > > > >    	e.printStackTrace();
> > > > >          System.out.println("ERROR "+e);
> > > > > }
> > > > >   }
> > > > > 
> > > > >
> > > >
> > >
> >
> -------------------------------------------------------
> > > > > Thanks in advance
> > > > > Expecting to hear from you
> > > > > regards
> > > > > parames
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > __________________________________
> > > > > Do you Yahoo!?
> > > > > Yahoo! Calendar - Free online calendar with
> > sync
> > > > to Outlook(TM).
> > > > > http://calendar.yahoo.com
> > > > > 
> > > > 
> > > > 
> > > > Scott Nichol
> > > > 
> > > > Do not reply directly to this e-mail address,
> > > > as it is filtered to only receive e-mail from
> > > > specific mailing lists.
> > > > 
> > > > 
> > > 
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Calendar - Free online calendar with sync
> > to Outlook(TM).
> > > http://calendar.yahoo.com
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Passing string SERVICE

Posted by Parames <kp...@yahoo.com>.
hey
im gettting null pointer exception also....
Whats wrong???

> On 4 Jun 2003 at 18:45, Parames wrote:
> 
> > Hi 
> > Yes ,im passing element.Im stuck in getting String
> > value and passing to element.....
> > Im getting Null...
> > here IdToLookUp  is the string im getting from GUI
> > Where im suppose to pass element to my SERVICE..
> > 
> > 
> >   IdToLookUp =jTextField1.getText();
> > 
> > > > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element custID =doc.createElement("CustomerID");
> >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > 
> > While printing custID ,im getting null..
> > 
> > Hope this time i make you clear about my doubt..
> > Sorry for the inconvience
> > Thanks 
> > parames...
> > 
> > 
> > 
> > 
> > --- Scott Nichol <sn...@scottnichol.com>
> wrote:
> > > I've read your post multiple times, but I still
> do
> > > not understand 
> > > what you are trying to do.  Your sample code
> looks
> > > like you are 
> > > passing the Element as a parameter.  What is it
> that
> > > you do not know 
> > > how to do?
> > > 
> > > On 4 Jun 2003 at 0:53, Parames wrote:
> > > 
> > > > Thanks for your response ,
> > > > Any i have query ,Im trying to send string as
> > > > XML(Element) to the service where service
> needs to
> > > > fetch string matching datas from database.
> > > > XML like Addressbook example..
> > > > 
> > > > Can anyone send me some code for 
> > > > sending stringas element,Bcoz in service im
> > > passing
> > > > resultset to element.
> > > > Can anyone help me??
> > > > 
> > > > My GUI code 
> > > > 
> > > > public void actionPerformed(ActionEvent event)
> > > >     {
> > > >  String but = event.getActionCommand();
> > > >  if (but == "OK" )
> > > >  {
> > > >  //  IdToLookUp  is the value i want to take 	
> > > >   IdToLookUp =jTextField1.getText();
> > > > 
> > > >   
> > > > // HERE the STRING TO PASS AS ELEMENT
> > > > 
> > > > DocumentBuilder xdb =
> > > > XMLParserUtils.getXMLDocBuilder();
> > > >   Document doc = xdb.newDocument();
> > > >   Element custID =
> > > doc.createElement("CustomerID");
> > > >  
> > >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > > >           
> > > >     	
> > > >   //make a call to soap server with customer
> ID
> > > >   	       
> > > >  try{
> > > > 
> > > > // GetCustInfo() is the SOAP CLIENT where i
> need
> > > to
> > > > pass this element...
> > > > 
> > > > gci = new GetCustInfo();
> > > >                           
> > > > Element element =gci.callCustSVC(customerId);}
> > > >  catch (Exception e) {
> > > >    	e.printStackTrace();
> > > >          System.out.println("ERROR "+e);
> > > > }
> > > >   }
> > > > 
> > > >
> > >
> >
>
-------------------------------------------------------
> > > > Thanks in advance
> > > > Expecting to hear from you
> > > > regards
> > > > parames
> > > > 
> > > > 
> > > > 
> > > > 
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Calendar - Free online calendar with
> sync
> > > to Outlook(TM).
> > > > http://calendar.yahoo.com
> > > > 
> > > 
> > > 
> > > Scott Nichol
> > > 
> > > Do not reply directly to this e-mail address,
> > > as it is filtered to only receive e-mail from
> > > specific mailing lists.
> > > 
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to Outlook(TM).
> > http://calendar.yahoo.com
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string SERVICE

Posted by Parames <kp...@yahoo.com>.
You are right..I tried that also.......
couldn't wrap my value to element
the way i did is ..

DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance(); 
DocumentBuilder tempBuilder =
factory.newDocumentBuilder(); 

Document docXML = null;
docXML = tempBuilder.newDocument(); 
Element custID = docXML.getDocumentElement();
//Element root = docXML.createElement("CustomerInfo");
custID.appendChild(docXML.createTextNode(IdToLookup));

Or how to do that???The commeted line bring INVALID
COLUMN NAME in my Service where im getting datas from
resultset ie from db...


--- Scott Nichol <sn...@scottnichol.com> wrote:
> Since no one else has, I will ask, why do you want
> to pass this as an 
> element?  You are working so hard to take a string,
> which is the data 
> you really care about, wrap it up in an Element,
> then pass the 
> Element as a parameter.  Wrapping it in an Element
> does not add any 
> information, so why no just pass the string?
> 
> On 4 Jun 2003 at 18:45, Parames wrote:
> 
> > Hi 
> > Yes ,im passing element.Im stuck in getting String
> > value and passing to element.....
> > Im getting Null...
> > here IdToLookUp  is the string im getting from GUI
> > Where im suppose to pass element to my SERVICE..
> > 
> > 
> >   IdToLookUp =jTextField1.getText();
> > 
> > > > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element custID =doc.createElement("CustomerID");
> >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > 
> > While printing custID ,im getting null..
> > 
> > Hope this time i make you clear about my doubt..
> > Sorry for the inconvience
> > Thanks 
> > parames...
> > 
> > 
> > 
> > 
> > --- Scott Nichol <sn...@scottnichol.com>
> wrote:
> > > I've read your post multiple times, but I still
> do
> > > not understand 
> > > what you are trying to do.  Your sample code
> looks
> > > like you are 
> > > passing the Element as a parameter.  What is it
> that
> > > you do not know 
> > > how to do?
> > > 
> > > On 4 Jun 2003 at 0:53, Parames wrote:
> > > 
> > > > Thanks for your response ,
> > > > Any i have query ,Im trying to send string as
> > > > XML(Element) to the service where service
> needs to
> > > > fetch string matching datas from database.
> > > > XML like Addressbook example..
> > > > 
> > > > Can anyone send me some code for 
> > > > sending stringas element,Bcoz in service im
> > > passing
> > > > resultset to element.
> > > > Can anyone help me??
> > > > 
> > > > My GUI code 
> > > > 
> > > > public void actionPerformed(ActionEvent event)
> > > >     {
> > > >  String but = event.getActionCommand();
> > > >  if (but == "OK" )
> > > >  {
> > > >  //  IdToLookUp  is the value i want to take 	
> > > >   IdToLookUp =jTextField1.getText();
> > > > 
> > > >   
> > > > // HERE the STRING TO PASS AS ELEMENT
> > > > 
> > > > DocumentBuilder xdb =
> > > > XMLParserUtils.getXMLDocBuilder();
> > > >   Document doc = xdb.newDocument();
> > > >   Element custID =
> > > doc.createElement("CustomerID");
> > > >  
> > >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > > >           
> > > >     	
> > > >   //make a call to soap server with customer
> ID
> > > >   	       
> > > >  try{
> > > > 
> > > > // GetCustInfo() is the SOAP CLIENT where i
> need
> > > to
> > > > pass this element...
> > > > 
> > > > gci = new GetCustInfo();
> > > >                           
> > > > Element element =gci.callCustSVC(customerId);}
> > > >  catch (Exception e) {
> > > >    	e.printStackTrace();
> > > >          System.out.println("ERROR "+e);
> > > > }
> > > >   }
> > > > 
> > > >
> > >
> >
>
-------------------------------------------------------
> > > > Thanks in advance
> > > > Expecting to hear from you
> > > > regards
> > > > parames
> > > > 
> > > > 
> > > > 
> > > > 
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Calendar - Free online calendar with
> sync
> > > to Outlook(TM).
> > > > http://calendar.yahoo.com
> > > > 
> > > 
> > > 
> > > Scott Nichol
> > > 
> > > Do not reply directly to this e-mail address,
> > > as it is filtered to only receive e-mail from
> > > specific mailing lists.
> > > 
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to Outlook(TM).
> > http://calendar.yahoo.com
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string SERVICE

Posted by Parames <kp...@yahoo.com>.
Sorry Scott ,
i left one point ..the main purpose for me to gofor
DOM is i want my java webservices to talk to Dot net
client.

Thank you,

--- Scott Nichol <sn...@scottnichol.com> wrote:
> Since no one else has, I will ask, why do you want
> to pass this as an 
> element?  You are working so hard to take a string,
> which is the data 
> you really care about, wrap it up in an Element,
> then pass the 
> Element as a parameter.  Wrapping it in an Element
> does not add any 
> information, so why no just pass the string?
> 
> On 4 Jun 2003 at 18:45, Parames wrote:
> 
> > Hi 
> > Yes ,im passing element.Im stuck in getting String
> > value and passing to element.....
> > Im getting Null...
> > here IdToLookUp  is the string im getting from GUI
> > Where im suppose to pass element to my SERVICE..
> > 
> > 
> >   IdToLookUp =jTextField1.getText();
> > 
> > > > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element custID =doc.createElement("CustomerID");
> >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > 
> > While printing custID ,im getting null..
> > 
> > Hope this time i make you clear about my doubt..
> > Sorry for the inconvience
> > Thanks 
> > parames...
> > 
> > 
> > 
> > 
> > --- Scott Nichol <sn...@scottnichol.com>
> wrote:
> > > I've read your post multiple times, but I still
> do
> > > not understand 
> > > what you are trying to do.  Your sample code
> looks
> > > like you are 
> > > passing the Element as a parameter.  What is it
> that
> > > you do not know 
> > > how to do?
> > > 
> > > On 4 Jun 2003 at 0:53, Parames wrote:
> > > 
> > > > Thanks for your response ,
> > > > Any i have query ,Im trying to send string as
> > > > XML(Element) to the service where service
> needs to
> > > > fetch string matching datas from database.
> > > > XML like Addressbook example..
> > > > 
> > > > Can anyone send me some code for 
> > > > sending stringas element,Bcoz in service im
> > > passing
> > > > resultset to element.
> > > > Can anyone help me??
> > > > 
> > > > My GUI code 
> > > > 
> > > > public void actionPerformed(ActionEvent event)
> > > >     {
> > > >  String but = event.getActionCommand();
> > > >  if (but == "OK" )
> > > >  {
> > > >  //  IdToLookUp  is the value i want to take 	
> > > >   IdToLookUp =jTextField1.getText();
> > > > 
> > > >   
> > > > // HERE the STRING TO PASS AS ELEMENT
> > > > 
> > > > DocumentBuilder xdb =
> > > > XMLParserUtils.getXMLDocBuilder();
> > > >   Document doc = xdb.newDocument();
> > > >   Element custID =
> > > doc.createElement("CustomerID");
> > > >  
> > >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > > >           
> > > >     	
> > > >   //make a call to soap server with customer
> ID
> > > >   	       
> > > >  try{
> > > > 
> > > > // GetCustInfo() is the SOAP CLIENT where i
> need
> > > to
> > > > pass this element...
> > > > 
> > > > gci = new GetCustInfo();
> > > >                           
> > > > Element element =gci.callCustSVC(customerId);}
> > > >  catch (Exception e) {
> > > >    	e.printStackTrace();
> > > >          System.out.println("ERROR "+e);
> > > > }
> > > >   }
> > > > 
> > > >
> > >
> >
>
-------------------------------------------------------
> > > > Thanks in advance
> > > > Expecting to hear from you
> > > > regards
> > > > parames
> > > > 
> > > > 
> > > > 
> > > > 
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Calendar - Free online calendar with
> sync
> > > to Outlook(TM).
> > > > http://calendar.yahoo.com
> > > > 
> > > 
> > > 
> > > Scott Nichol
> > > 
> > > Do not reply directly to this e-mail address,
> > > as it is filtered to only receive e-mail from
> > > specific mailing lists.
> > > 
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to Outlook(TM).
> > http://calendar.yahoo.com
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string SERVICE

Posted by Scott Nichol <sn...@scottnichol.com>.
Since no one else has, I will ask, why do you want to pass this as an 
element?  You are working so hard to take a string, which is the data 
you really care about, wrap it up in an Element, then pass the 
Element as a parameter.  Wrapping it in an Element does not add any 
information, so why no just pass the string?

On 4 Jun 2003 at 18:45, Parames wrote:

> Hi 
> Yes ,im passing element.Im stuck in getting String
> value and passing to element.....
> Im getting Null...
> here IdToLookUp  is the string im getting from GUI
> Where im suppose to pass element to my SERVICE..
> 
> 
>   IdToLookUp =jTextField1.getText();
> 
> > > // HERE the STRING TO PASS AS ELEMENT
> 
> DocumentBuilder xdb =
> XMLParserUtils.getXMLDocBuilder();
> Document doc = xdb.newDocument();
> Element custID =doc.createElement("CustomerID");
> custID.appendChild(doc.createTextNode(IdToLookUp));
> 
> While printing custID ,im getting null..
> 
> Hope this time i make you clear about my doubt..
> Sorry for the inconvience
> Thanks 
> parames...
> 
> 
> 
> 
> --- Scott Nichol <sn...@scottnichol.com> wrote:
> > I've read your post multiple times, but I still do
> > not understand 
> > what you are trying to do.  Your sample code looks
> > like you are 
> > passing the Element as a parameter.  What is it that
> > you do not know 
> > how to do?
> > 
> > On 4 Jun 2003 at 0:53, Parames wrote:
> > 
> > > Thanks for your response ,
> > > Any i have query ,Im trying to send string as
> > > XML(Element) to the service where service needs to
> > > fetch string matching datas from database.
> > > XML like Addressbook example..
> > > 
> > > Can anyone send me some code for 
> > > sending stringas element,Bcoz in service im
> > passing
> > > resultset to element.
> > > Can anyone help me??
> > > 
> > > My GUI code 
> > > 
> > > public void actionPerformed(ActionEvent event)
> > >     {
> > >  String but = event.getActionCommand();
> > >  if (but == "OK" )
> > >  {
> > >  //  IdToLookUp  is the value i want to take 	
> > >   IdToLookUp =jTextField1.getText();
> > > 
> > >   
> > > // HERE the STRING TO PASS AS ELEMENT
> > > 
> > > DocumentBuilder xdb =
> > > XMLParserUtils.getXMLDocBuilder();
> > >   Document doc = xdb.newDocument();
> > >   Element custID =
> > doc.createElement("CustomerID");
> > >  
> > custID.appendChild(doc.createTextNode(IdToLookUp));
> > >           
> > >     	
> > >   //make a call to soap server with customer ID
> > >   	       
> > >  try{
> > > 
> > > // GetCustInfo() is the SOAP CLIENT where i need
> > to
> > > pass this element...
> > > 
> > > gci = new GetCustInfo();
> > >                           
> > > Element element =gci.callCustSVC(customerId);}
> > >  catch (Exception e) {
> > >    	e.printStackTrace();
> > >          System.out.println("ERROR "+e);
> > > }
> > >   }
> > > 
> > >
> >
> -------------------------------------------------------
> > > Thanks in advance
> > > Expecting to hear from you
> > > regards
> > > parames
> > > 
> > > 
> > > 
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Calendar - Free online calendar with sync
> > to Outlook(TM).
> > > http://calendar.yahoo.com
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Passing element to SERVICE(Output and SQL exception)

Posted by Parames <kp...@yahoo.com>.
Hi Scott ,
Sorry and  im printing
DOM2Writer.nodeToString(custID); also  getting the
value as excepted  and passing to my Service..

Now im not getting values from database  
Error like this ,


In Service .....DB connection......
sun.jdbc.odbc.JdbcOdbcConnection@94cb8b
java.sql.SQLException: [Microsoft][ODBC SQL Server
Driver][SQL Server]Invalid column name 'id: null'.
        at
sun.jdbc.odbc.JdbcOdbc.createSQLException(JdbcOdbc.java:6879)


id  is the root element i have given and getting from
client....
***************************************************
Here my Service code

public Element getCustomerInfo(Element  customerId)
throws IllegalArgumentException
  {
  customerId = customerId; 	
 	  	  
System.out.println( "STRXML = " +
DOM2Writer.nodeToString(customerId));
     	  
  // getting Connection		  
    
    try
        {
        		 
        dba = new DBAdapter();
        conn = dba.getConnection();
       
        stmt = conn.createStatement();
        String SQLStatement = ("Select * from 
CustomerProfile where id="+customerId); 
                                      
        rs = stmt.executeQuery(SQLStatement);
        
            if (rs != null)
             {
             	
               while(rs.next())
                 {
                 
                   custId = rs.getString("id");	
                  
        	  name = rs.getString("name");
        		   
                   phone =rs.getString("phone");
                 
                 }
             }
             
         
        stmt.close();
        conn.close();
    }
       
       catch(Exception e){
       
       	    e.printStackTrace();
            System.out.println("SQL.Exception Inside
CATCH SVC.."+e);
           }
        
    try {
     
nameE.appendChild( doc.createTextNode(name));      
root.appendChild(nameE); 
            
phoneE.appendChild( doc.createTextNode(phone));       
root.appendChild(phoneE);  
            
custidE.appendChild( doc.createTextNode(custId) );
root.appendChild(custidE);                       
doc.appendChild( root );                        


OutputFormat    format  = new OutputFormat( doc );   
                 
XMLSerializer    serial = new XMLSerializer(
stringOut, format );
serial.asDOMSerializer();                            
 serial.serialize( doc.getDocumentElement() );
System.out.println( "STR XML = " +
DOM2Writer.nodeToString(root) ); 
         } 
           catch ( Exception ex ) {
            ex.printStackTrace();
           }
         return root;
      
   }  
*****************************************************
Client code:
public Element callCustSVC(String IdToLookup) throws
Exception 
  
  {
  	  	
    
  	IdToLookup = IdToLookup;
   	System.out.println("IdToLookup in
GetCustInfo..callCustSVC ----"+IdToLookup + "\n");
    call = new Call();
    String soapActionURI ="";
    
     smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();
   
    smr = call.getSOAPMappingRegistry();
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI("urn:CustInfoFetcher");
    call.setMethodName("getCustomerInfo");
   
call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
    
    
smr.mapTypes(Constants.NS_URI_LITERAL_XML,
                 new
QName("urn:xml-soap-customer-demo","Customer"),
                 Element.class, null, null);
                 
 
   try {
 custID.appendChild( doc.createTextNode(IdToLookup) );
 root.appendChild(custID);                       
 doc.appendChild( root ); 
    

OutputFormat    format  = new OutputFormat( doc );   
XMLSerializer    serial = new XMLSerializer(
stringOut, format );
serial.asDOMSerializer();                            
serial.serialize( doc.getDocumentElement() );

System.out.println( "STRXML = " + stringOut.toString()
);
stem.out.println(DOM2Writer.nodeToString(custID));
             //Spit out DOM as a String
         } 
           catch ( Exception ex ) {
            ex.printStackTrace();
           }
 
  
    this.url = new
URL("http://10.1.1.237:8080/soap/servlet/rpcrouter"); 
  
    
    Vector params = new Vector();
 

    params.addElement(new Parameter("IdToLookup",
Element.class,
                                  custID,
Constants.NS_URI_LITERAL_XML));//
    call.setParams(params);
   //  
    try
    {
       
      resp = call.invoke(url, soapActionURI);
      System.out.println("RESPONSE__________________
INN "+resp);
           
    }
    catch (SOAPException e)
    {
    	e.printStackTrace();
       }

    //Test Response fault..
    
    if (!resp.generatedFault())
    {
      Parameter ret = resp.getReturnValue();
           custID = (Element)ret.getValue();
         
System.out.println(DOM2Writer.nodeToString(custID));
        
      
    }
    else
    {
      Fault fault = resp.getFault();
      System.err.println("Generated fault: " + fault);
      
    }
    //Returning Element
    return custID;
  }
*******************************************************
i couldn't find out whether problem in client or
service...

Expectinmg to hear from you 
Thanks and regards



__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string SERVICE

Posted by Scott Nichol <sn...@scottnichol.com>.
I am still confused.  Your code shows only printing of 
DOM2Writer.nodeToString(custInfo).  Do you also do this with custID?  
Exactly what is the output when you do?

On 4 Jun 2003 at 22:33, Parames wrote:

> 
> Yes im printing in the client
> No null pointerecxeption ,elementvalue is null...ie
> custID =null;
> goes like this 
> 
>  public Element callCustSVC(String IdToLookup) throws
> Exception 
>   
>   {
> 	IdToLookup = IdToLookup;
>    	call = new Call();
>         String soapActionURI ="";
>     
>      smr = new SOAPMappingRegistry();
>     BeanSerializer beanSer = new BeanSerializer();
>    
>     smr = call.getSOAPMappingRegistry();
>     call.setSOAPMappingRegistry(smr);
>     call.setTargetObjectURI("urn:CustInfoFetcher");
>     call.setMethodName("getCustomerInfo");
>    
> call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
>     
>        
>   DocumentBuilderFactory factory =
> DocumentBuilderFactory.newInstance(); 
> DocumentBuilder tempBuilder =
> factory.newDocumentBuilder(); 
> Document docXML = null;
> docXML = tempBuilder.newDocument(); 
> Element custID = docXML.getDocumentElement();
> //Element root = docXML.createElement("CustomerInfo");
> custID.appendChild(docXML.createTextNode(IdToLookup));
> this.url = new
> URL("http://10.1.1.237:8080/soap/servlet/rpcrouter"); 
>    
>     Vector params = new Vector();
> 
>  params.addElement(new
> Parameter("IdToLookup",Element.class,custID,
> Constants.NS_URI_LITERAL_XML));                       
>  call.setParams(params);
>    
>     try
>     {
>        
>       resp = call.invoke(url, soapActionURI);
>      }
>     catch (SOAPException e)
>     {
>     	e.printStackTrace();
>       System.err.println("Caught SOAPException (" +
>                          e.getFaultCode() + "): " +
>                          e.getMessage());
>       
>     }
> 
>     //Test Response fault..
>     
>     if (!resp.generatedFault())
>     {
>       Parameter ret = resp.getReturnValue();
>        custInfo = (Element)ret.getValue();
>       
> System.out.println(DOM2Writer.nodeToString(custInfo));
>         
>       
>     }
>     else
>     {
>       Fault fault = resp.getFault();
>       
> 
>       System.err.println("Generated fault: " + fault);
>       
>     }
>     //Returning Customer Bean
>     return custInfo;
>   }
>   
> }
> 
> Thanks a lot 
> Parames
> --- Scott Nichol <sn...@scottnichol.com> wrote:
> > From where are you printing custID?  The client? 
> > How are you 
> > printing it?  If custID were really null, you would
> > get a 
> > NullPointerException in the line
> > 
> > custID.appendChild(doc.createTextNode(IdToLookUp))
> > 
> > On 4 Jun 2003 at 18:45, Parames wrote:
> > 
> > > Hi 
> > > Yes ,im passing element.Im stuck in getting String
> > > value and passing to element.....
> > > Im getting Null...
> > > here IdToLookUp  is the string im getting from GUI
> > > Where im suppose to pass element to my SERVICE..
> > > 
> > > 
> > >   IdToLookUp =jTextField1.getText();
> > > 
> > > > > // HERE the STRING TO PASS AS ELEMENT
> > > 
> > > DocumentBuilder xdb =
> > > XMLParserUtils.getXMLDocBuilder();
> > > Document doc = xdb.newDocument();
> > > Element custID =doc.createElement("CustomerID");
> > >
> > custID.appendChild(doc.createTextNode(IdToLookUp));
> > > 
> > > While printing custID ,im getting null..
> > > 
> > > Hope this time i make you clear about my doubt..
> > > Sorry for the inconvience
> > > Thanks 
> > > parames...
> > > 
> > > 
> > > 
> > > 
> > > --- Scott Nichol <sn...@scottnichol.com>
> > wrote:
> > > > I've read your post multiple times, but I still
> > do
> > > > not understand 
> > > > what you are trying to do.  Your sample code
> > looks
> > > > like you are 
> > > > passing the Element as a parameter.  What is it
> > that
> > > > you do not know 
> > > > how to do?
> > > > 
> > > > On 4 Jun 2003 at 0:53, Parames wrote:
> > > > 
> > > > > Thanks for your response ,
> > > > > Any i have query ,Im trying to send string as
> > > > > XML(Element) to the service where service
> > needs to
> > > > > fetch string matching datas from database.
> > > > > XML like Addressbook example..
> > > > > 
> > > > > Can anyone send me some code for 
> > > > > sending stringas element,Bcoz in service im
> > > > passing
> > > > > resultset to element.
> > > > > Can anyone help me??
> > > > > 
> > > > > My GUI code 
> > > > > 
> > > > > public void actionPerformed(ActionEvent event)
> > > > >     {
> > > > >  String but = event.getActionCommand();
> > > > >  if (but == "OK" )
> > > > >  {
> > > > >  //  IdToLookUp  is the value i want to take 	
> > > > >   IdToLookUp =jTextField1.getText();
> > > > > 
> > > > >   
> > > > > // HERE the STRING TO PASS AS ELEMENT
> > > > > 
> > > > > DocumentBuilder xdb =
> > > > > XMLParserUtils.getXMLDocBuilder();
> > > > >   Document doc = xdb.newDocument();
> > > > >   Element custID =
> > > > doc.createElement("CustomerID");
> > > > >  
> > > >
> > custID.appendChild(doc.createTextNode(IdToLookUp));
> > > > >           
> > > > >     	
> > > > >   //make a call to soap server with customer
> > ID
> > > > >   	       
> > > > >  try{
> > > > > 
> > > > > // GetCustInfo() is the SOAP CLIENT where i
> > need
> > > > to
> > > > > pass this element...
> > > > > 
> > > > > gci = new GetCustInfo();
> > > > >                           
> > > > > Element element =gci.callCustSVC(customerId);}
> > > > >  catch (Exception e) {
> > > > >    	e.printStackTrace();
> > > > >          System.out.println("ERROR "+e);
> > > > > }
> > > > >   }
> > > > > 
> > > > >
> > > >
> > >
> >
> -------------------------------------------------------
> > > > > Thanks in advance
> > > > > Expecting to hear from you
> > > > > regards
> > > > > parames
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > __________________________________
> > > > > Do you Yahoo!?
> > > > > Yahoo! Calendar - Free online calendar with
> > sync
> > > > to Outlook(TM).
> > > > > http://calendar.yahoo.com
> > > > > 
> > > > 
> > > > 
> > > > Scott Nichol
> > > > 
> > > > Do not reply directly to this e-mail address,
> > > > as it is filtered to only receive e-mail from
> > > > specific mailing lists.
> > > > 
> > > > 
> > > 
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Calendar - Free online calendar with sync
> > to Outlook(TM).
> > > http://calendar.yahoo.com
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Passing string SERVICE

Posted by Parames <kp...@yahoo.com>.
Yes im printing in the client
No null pointerecxeption ,elementvalue is null...ie
custID =null;
goes like this 

 public Element callCustSVC(String IdToLookup) throws
Exception 
  
  {
	IdToLookup = IdToLookup;
   	call = new Call();
        String soapActionURI ="";
    
     smr = new SOAPMappingRegistry();
    BeanSerializer beanSer = new BeanSerializer();
   
    smr = call.getSOAPMappingRegistry();
    call.setSOAPMappingRegistry(smr);
    call.setTargetObjectURI("urn:CustInfoFetcher");
    call.setMethodName("getCustomerInfo");
   
call.setEncodingStyleURI(Constants.NS_URI_LITERAL_XML);
    
       
  DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance(); 
DocumentBuilder tempBuilder =
factory.newDocumentBuilder(); 
Document docXML = null;
docXML = tempBuilder.newDocument(); 
Element custID = docXML.getDocumentElement();
//Element root = docXML.createElement("CustomerInfo");
custID.appendChild(docXML.createTextNode(IdToLookup));
this.url = new
URL("http://10.1.1.237:8080/soap/servlet/rpcrouter"); 
   
    Vector params = new Vector();

 params.addElement(new
Parameter("IdToLookup",Element.class,custID,
Constants.NS_URI_LITERAL_XML));                       
 call.setParams(params);
   
    try
    {
       
      resp = call.invoke(url, soapActionURI);
     }
    catch (SOAPException e)
    {
    	e.printStackTrace();
      System.err.println("Caught SOAPException (" +
                         e.getFaultCode() + "): " +
                         e.getMessage());
      
    }

    //Test Response fault..
    
    if (!resp.generatedFault())
    {
      Parameter ret = resp.getReturnValue();
       custInfo = (Element)ret.getValue();
      
System.out.println(DOM2Writer.nodeToString(custInfo));
        
      
    }
    else
    {
      Fault fault = resp.getFault();
      

      System.err.println("Generated fault: " + fault);
      
    }
    //Returning Customer Bean
    return custInfo;
  }
  
}

Thanks a lot 
Parames
--- Scott Nichol <sn...@scottnichol.com> wrote:
> From where are you printing custID?  The client? 
> How are you 
> printing it?  If custID were really null, you would
> get a 
> NullPointerException in the line
> 
> custID.appendChild(doc.createTextNode(IdToLookUp))
> 
> On 4 Jun 2003 at 18:45, Parames wrote:
> 
> > Hi 
> > Yes ,im passing element.Im stuck in getting String
> > value and passing to element.....
> > Im getting Null...
> > here IdToLookUp  is the string im getting from GUI
> > Where im suppose to pass element to my SERVICE..
> > 
> > 
> >   IdToLookUp =jTextField1.getText();
> > 
> > > > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element custID =doc.createElement("CustomerID");
> >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > 
> > While printing custID ,im getting null..
> > 
> > Hope this time i make you clear about my doubt..
> > Sorry for the inconvience
> > Thanks 
> > parames...
> > 
> > 
> > 
> > 
> > --- Scott Nichol <sn...@scottnichol.com>
> wrote:
> > > I've read your post multiple times, but I still
> do
> > > not understand 
> > > what you are trying to do.  Your sample code
> looks
> > > like you are 
> > > passing the Element as a parameter.  What is it
> that
> > > you do not know 
> > > how to do?
> > > 
> > > On 4 Jun 2003 at 0:53, Parames wrote:
> > > 
> > > > Thanks for your response ,
> > > > Any i have query ,Im trying to send string as
> > > > XML(Element) to the service where service
> needs to
> > > > fetch string matching datas from database.
> > > > XML like Addressbook example..
> > > > 
> > > > Can anyone send me some code for 
> > > > sending stringas element,Bcoz in service im
> > > passing
> > > > resultset to element.
> > > > Can anyone help me??
> > > > 
> > > > My GUI code 
> > > > 
> > > > public void actionPerformed(ActionEvent event)
> > > >     {
> > > >  String but = event.getActionCommand();
> > > >  if (but == "OK" )
> > > >  {
> > > >  //  IdToLookUp  is the value i want to take 	
> > > >   IdToLookUp =jTextField1.getText();
> > > > 
> > > >   
> > > > // HERE the STRING TO PASS AS ELEMENT
> > > > 
> > > > DocumentBuilder xdb =
> > > > XMLParserUtils.getXMLDocBuilder();
> > > >   Document doc = xdb.newDocument();
> > > >   Element custID =
> > > doc.createElement("CustomerID");
> > > >  
> > >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > > >           
> > > >     	
> > > >   //make a call to soap server with customer
> ID
> > > >   	       
> > > >  try{
> > > > 
> > > > // GetCustInfo() is the SOAP CLIENT where i
> need
> > > to
> > > > pass this element...
> > > > 
> > > > gci = new GetCustInfo();
> > > >                           
> > > > Element element =gci.callCustSVC(customerId);}
> > > >  catch (Exception e) {
> > > >    	e.printStackTrace();
> > > >          System.out.println("ERROR "+e);
> > > > }
> > > >   }
> > > > 
> > > >
> > >
> >
>
-------------------------------------------------------
> > > > Thanks in advance
> > > > Expecting to hear from you
> > > > regards
> > > > parames
> > > > 
> > > > 
> > > > 
> > > > 
> > > > __________________________________
> > > > Do you Yahoo!?
> > > > Yahoo! Calendar - Free online calendar with
> sync
> > > to Outlook(TM).
> > > > http://calendar.yahoo.com
> > > > 
> > > 
> > > 
> > > Scott Nichol
> > > 
> > > Do not reply directly to this e-mail address,
> > > as it is filtered to only receive e-mail from
> > > specific mailing lists.
> > > 
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to Outlook(TM).
> > http://calendar.yahoo.com
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string SERVICE

Posted by Scott Nichol <sn...@scottnichol.com>.
>From where are you printing custID?  The client?  How are you 
printing it?  If custID were really null, you would get a 
NullPointerException in the line

custID.appendChild(doc.createTextNode(IdToLookUp))

On 4 Jun 2003 at 18:45, Parames wrote:

> Hi 
> Yes ,im passing element.Im stuck in getting String
> value and passing to element.....
> Im getting Null...
> here IdToLookUp  is the string im getting from GUI
> Where im suppose to pass element to my SERVICE..
> 
> 
>   IdToLookUp =jTextField1.getText();
> 
> > > // HERE the STRING TO PASS AS ELEMENT
> 
> DocumentBuilder xdb =
> XMLParserUtils.getXMLDocBuilder();
> Document doc = xdb.newDocument();
> Element custID =doc.createElement("CustomerID");
> custID.appendChild(doc.createTextNode(IdToLookUp));
> 
> While printing custID ,im getting null..
> 
> Hope this time i make you clear about my doubt..
> Sorry for the inconvience
> Thanks 
> parames...
> 
> 
> 
> 
> --- Scott Nichol <sn...@scottnichol.com> wrote:
> > I've read your post multiple times, but I still do
> > not understand 
> > what you are trying to do.  Your sample code looks
> > like you are 
> > passing the Element as a parameter.  What is it that
> > you do not know 
> > how to do?
> > 
> > On 4 Jun 2003 at 0:53, Parames wrote:
> > 
> > > Thanks for your response ,
> > > Any i have query ,Im trying to send string as
> > > XML(Element) to the service where service needs to
> > > fetch string matching datas from database.
> > > XML like Addressbook example..
> > > 
> > > Can anyone send me some code for 
> > > sending stringas element,Bcoz in service im
> > passing
> > > resultset to element.
> > > Can anyone help me??
> > > 
> > > My GUI code 
> > > 
> > > public void actionPerformed(ActionEvent event)
> > >     {
> > >  String but = event.getActionCommand();
> > >  if (but == "OK" )
> > >  {
> > >  //  IdToLookUp  is the value i want to take 	
> > >   IdToLookUp =jTextField1.getText();
> > > 
> > >   
> > > // HERE the STRING TO PASS AS ELEMENT
> > > 
> > > DocumentBuilder xdb =
> > > XMLParserUtils.getXMLDocBuilder();
> > >   Document doc = xdb.newDocument();
> > >   Element custID =
> > doc.createElement("CustomerID");
> > >  
> > custID.appendChild(doc.createTextNode(IdToLookUp));
> > >           
> > >     	
> > >   //make a call to soap server with customer ID
> > >   	       
> > >  try{
> > > 
> > > // GetCustInfo() is the SOAP CLIENT where i need
> > to
> > > pass this element...
> > > 
> > > gci = new GetCustInfo();
> > >                           
> > > Element element =gci.callCustSVC(customerId);}
> > >  catch (Exception e) {
> > >    	e.printStackTrace();
> > >          System.out.println("ERROR "+e);
> > > }
> > >   }
> > > 
> > >
> >
> -------------------------------------------------------
> > > Thanks in advance
> > > Expecting to hear from you
> > > regards
> > > parames
> > > 
> > > 
> > > 
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Calendar - Free online calendar with sync
> > to Outlook(TM).
> > > http://calendar.yahoo.com
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Passing string SERVICE

Posted by Parames <kp...@yahoo.com>.
Hi 
Yes ,im passing element.Im stuck in getting String
value and passing to element.....
Im getting Null...
here IdToLookUp  is the string im getting from GUI
Where im suppose to pass element to my SERVICE..


  IdToLookUp =jTextField1.getText();

> > // HERE the STRING TO PASS AS ELEMENT

DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
Document doc = xdb.newDocument();
Element custID =doc.createElement("CustomerID");
custID.appendChild(doc.createTextNode(IdToLookUp));

While printing custID ,im getting null..

Hope this time i make you clear about my doubt..
Sorry for the inconvience
Thanks 
parames...




--- Scott Nichol <sn...@scottnichol.com> wrote:
> I've read your post multiple times, but I still do
> not understand 
> what you are trying to do.  Your sample code looks
> like you are 
> passing the Element as a parameter.  What is it that
> you do not know 
> how to do?
> 
> On 4 Jun 2003 at 0:53, Parames wrote:
> 
> > Thanks for your response ,
> > Any i have query ,Im trying to send string as
> > XML(Element) to the service where service needs to
> > fetch string matching datas from database.
> > XML like Addressbook example..
> > 
> > Can anyone send me some code for 
> > sending stringas element,Bcoz in service im
> passing
> > resultset to element.
> > Can anyone help me??
> > 
> > My GUI code 
> > 
> > public void actionPerformed(ActionEvent event)
> >     {
> >  String but = event.getActionCommand();
> >  if (but == "OK" )
> >  {
> >  //  IdToLookUp  is the value i want to take 	
> >   IdToLookUp =jTextField1.getText();
> > 
> >   
> > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> >   Document doc = xdb.newDocument();
> >   Element custID =
> doc.createElement("CustomerID");
> >  
> custID.appendChild(doc.createTextNode(IdToLookUp));
> >           
> >     	
> >   //make a call to soap server with customer ID
> >   	       
> >  try{
> > 
> > // GetCustInfo() is the SOAP CLIENT where i need
> to
> > pass this element...
> > 
> > gci = new GetCustInfo();
> >                           
> > Element element =gci.callCustSVC(customerId);}
> >  catch (Exception e) {
> >    	e.printStackTrace();
> >          System.out.println("ERROR "+e);
> > }
> >   }
> > 
> >
>
-------------------------------------------------------
> > Thanks in advance
> > Expecting to hear from you
> > regards
> > parames
> > 
> > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to Outlook(TM).
> > http://calendar.yahoo.com
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string SERVICE

Posted by Scott Nichol <sn...@scottnichol.com>.
I've read your post multiple times, but I still do not understand 
what you are trying to do.  Your sample code looks like you are 
passing the Element as a parameter.  What is it that you do not know 
how to do?

On 4 Jun 2003 at 0:53, Parames wrote:

> Thanks for your response ,
> Any i have query ,Im trying to send string as
> XML(Element) to the service where service needs to
> fetch string matching datas from database.
> XML like Addressbook example..
> 
> Can anyone send me some code for 
> sending stringas element,Bcoz in service im passing
> resultset to element.
> Can anyone help me??
> 
> My GUI code 
> 
> public void actionPerformed(ActionEvent event)
>     {
>  String but = event.getActionCommand();
>  if (but == "OK" )
>  {
>  //  IdToLookUp  is the value i want to take 	
>   IdToLookUp =jTextField1.getText();
> 
>   
> // HERE the STRING TO PASS AS ELEMENT
> 
> DocumentBuilder xdb =
> XMLParserUtils.getXMLDocBuilder();
>   Document doc = xdb.newDocument();
>   Element custID = doc.createElement("CustomerID");
>   custID.appendChild(doc.createTextNode(IdToLookUp));
>           
>     	
>   //make a call to soap server with customer ID
>   	       
>  try{
> 
> // GetCustInfo() is the SOAP CLIENT where i need to
> pass this element...
> 
> gci = new GetCustInfo();
>                           
> Element element =gci.callCustSVC(customerId);}
>  catch (Exception e) {
>    	e.printStackTrace();
>          System.out.println("ERROR "+e);
> }
>   }
> 
> -------------------------------------------------------
> Thanks in advance
> Expecting to hear from you
> regards
> parames
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Passing string as ELEMENT

Posted by Scott Nichol <sn...@scottnichol.com>.
What about sending an Element is causing you a problem?  You pass it 
like any other parameter, although you must use literal XML encoding 
for the service rather than SOAP encoding.

On 4 Jun 2003 at 3:08, Parames wrote:

> HI ,
> Thanks a lot ..
> The same logic is working for me with java bean....
> im trying to pass XML element to service instead of
> string...ie.XML file.
> Im getting string from client side but need to send as
> Element ...
> im dont want to use java bean..
> any idea??
> And what is call.registerSettings() method  do??
> 
> REgards
> parames
> 
> --- Jonathan Roberts <j_...@yahoo.co.uk> wrote:
> > Something like this (code not tested)
> >
> --------------------------------------------------------------------------------------
> > Client side
> > ----------------
> >   String returnString = "";
> >   Call c=new Call();
> >   c = registerSettings( c );
> >   c.setMethodName ("fetchData");   
> > //fetchData is name of server side method
> >   // Set up parameters to pass
> >   Vector parameters = new Vector();
> >   String customerID = "2100"; // or get cusotmerID
> > from elsewhere!
> >   parameters.addElement (new Parameter("customerID",
> > String.class, customerID, null));
> >   c.setParams (parameters);
> >   Response r=null; 
> >   try
> >   {
> >    // where mstrHostString = http://soapServer:8080
> >   //  in other words ip & port you have soap on
> >    r = c.invoke ( new URL( mstrHostString +
> > "/soap/servlet/rpcrouter"), "" );
> >   }
> >   catch ( Exception e )
> >   {
> >    System.out.println ("exception service not
> > available on " + mstrHostString);
> >    return;
> >   }
> >   // Check the response.
> >   if (r.generatedFault ()) 
> >   {
> >    Fault f = r.getFault();
> >    System.out.println ("  Fault Code   = " +
> > f.getFaultCode());
> >    System.out.println ("  Fault String = " +
> > f.getFaultString());
> >   } 
> >   else 
> >   {
> >    Parameter returnObject = r.getReturnValue();   
> >    // return vector of objects - e.g. strings
> >    //Vector returnVector =
> > (Vector)returnObject.getValue();  
> >    //returnString = (String) returnVector.get( 0 );
> >    or
> >    // return just one string
> >    returnString = (String)returnObject.getValue();  
> >   }
> > 
> >  public Call registerSettings( Call c )
> >  {  
> >   // SET TARGET URI
> >   c.setSOAPTransport(httpConn);     
> >   c.setTargetObjectURI ("urn:xml-APP");  // name of
> > app in soap admin
> >   // SET METHOD BEING CALLED ON SERVER
> >   c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); 
> >        
> >   return c;
> > }
> >  
> >
> ---------------------------------------------------------------------
> >  
> >  
> > server side
> > --------------
> > You need to specify the method names you are calling
> > in soap in soap admin for xml-APP.  
> >  
> > XML  code :
> >  
> > call:
> > java org.apache.soap.server.ServiceManagerClient :
> >
> /soap/servlet/rpcrouter">http://<ipaddress>:<port>/soap/servlet/rpcrouter
> > deploy C:\soapcode\Deploy.xml
> > 
> > code:
> >  
> >  
> >
> -------------------------------------------------------------------
> > 
> > <isd:service xmlns:isd=
> > "http://xml.apache.org/xml-soap/deployment"
> > 
> > id="urn:xml-App">
> > 
> > <isd:provider type="java" scope="Application"
> > 
> > methods="fetchData">
> > 
> > <isd:java
> >
> class="com.yourcompany.yourpackage.serversideclass"/>
> > 
> > </isd:provider>
> > 
> > 
> > <isd:faultListener>
> > 
> > org.apache.soap.server.DOMFaultListener
> > 
> > </isd:faultListener>
> > 
> > </isd:service>
> > 
> >
> --------------------------------------------------------------------------------------
> >  
> > code in serversideclass
> >  
> >  public Vector fetchData( String customerID)        
> > 
> >  { 
> >    // access your dastabase bean with customerID
> > 
> >   return returnVector;
> >  }
> >  
> > or
> > 
> > 
> > 
> >  public String  fetchData( String customerID)       
> >  
> >  { 
> >    // access your dastabase bean with customerID
> > 
> >   return returnString;
> >  }
> >  
> >  
> >  
> > Hope this helps.  Dont know if this is perfect, but
> > this is the way I do it.
> >  
> > Regards
> >  
> > Jonathan
> > 
> > 
> > 
> > Parames <kp...@yahoo.com> wrote:
> > Thanks for your response ,
> > Any i have query ,Im trying to send string as
> > XML(Element) to the service where service needs to
> > fetch string matching datas from database.
> > XML like Addressbook example..
> > 
> > Can anyone send me some code for 
> > sending stringas element,Bcoz in service im passing
> > resultset to element.
> > Can anyone help me??
> > 
> > My GUI code 
> > 
> > public void actionPerformed(ActionEvent event)
> > {
> > String but = event.getActionCommand();
> > if (but == "OK" )
> > {
> > // IdToLookUp is the value i want to take 
> > IdToLookUp =jTextField1.getText();
> > 
> > 
> > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element custID = doc.createElement("CustomerID");
> > custID.appendChild(doc.createTextNode(IdToLookUp));
> > 
> > 
> > //make a call to soap server with customer ID
> > 
> > try{
> > 
> > // GetCustInfo() is the SOAP CLIENT where i need to
> > pass this element...
> > 
> > gci = new GetCustInfo();
> > 
> > Element element =gci.callCustSVC(customerId);}
> > catch (Exception e) {
> > e.printStackTrace();
> > System.out.println("ERROR "+e);
> > }
> > }
> > 
> >
> -------------------------------------------------------
> > Thanks in advance
> > Expecting to hear from you
> > regards
> > parames
> > 
> > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync to
> > Outlook(TM).
> > http://calendar.yahoo.com
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Passing string as ELEMENT

Posted by Parames <kp...@yahoo.com>.
Thanks Jonathan

--- Jonathan Roberts <j_...@yahoo.co.uk> wrote:
> Hi.
>  
> You can presumably only send an XML element if you
> define it as an object, and pass this over.
>  
> RegisterSettings just sets up which xml-app to use.
>  
> Jonathan
> 
> Parames <kp...@yahoo.com> wrote:
> HI ,
> Thanks a lot ..
> The same logic is working for me with java bean....
> im trying to pass XML element to service instead of
> string...ie.XML file.
> Im getting string from client side but need to send
> as
> Element ...
> im dont want to use java bean..
> any idea??
> And what is call.registerSettings() method do??
> 
> REgards
> parames
> 
> --- Jonathan Roberts wrote:
> > Something like this (code not tested)
> >
>
--------------------------------------------------------------------------------------
> > Client side
> > ----------------
> > String returnString = "";
> > Call c=new Call();
> > c = registerSettings( c );
> > c.setMethodName ("fetchData"); 
> > //fetchData is name of server side method
> > // Set up parameters to pass
> > Vector parameters = new Vector();
> > String customerID = "2100"; // or get cusotmerID
> > from elsewhere!
> > parameters.addElement (new Parameter("customerID",
> > String.class, customerID, null));
> > c.setParams (parameters);
> > Response r=null; 
> > try
> > {
> > // where mstrHostString = http://soapServer:8080
> > // in other words ip & port you have soap on
> > r = c.invoke ( new URL( mstrHostString +
> > "/soap/servlet/rpcrouter"), "" );
> > }
> > catch ( Exception e )
> > {
> > System.out.println ("exception service not
> > available on " + mstrHostString);
> > return;
> > }
> > // Check the response.
> > if (r.generatedFault ()) 
> > {
> > Fault f = r.getFault();
> > System.out.println (" Fault Code = " +
> > f.getFaultCode());
> > System.out.println (" Fault String = " +
> > f.getFaultString());
> > } 
> > else 
> > {
> > Parameter returnObject = r.getReturnValue(); 
> > // return vector of objects - e.g. strings
> > //Vector returnVector =
> > (Vector)returnObject.getValue(); 
> > //returnString = (String) returnVector.get( 0 );
> > or
> > // return just one string
> > returnString = (String)returnObject.getValue(); 
> > }
> > 
> > public Call registerSettings( Call c )
> > { 
> > // SET TARGET URI
> > c.setSOAPTransport(httpConn); 
> > c.setTargetObjectURI ("urn:xml-APP"); // name of
> > app in soap admin
> > // SET METHOD BEING CALLED ON SERVER
> > c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); 
> > 
> > return c;
> > }
> > 
> >
>
---------------------------------------------------------------------
> > 
> > 
> > server side
> > --------------
> > You need to specify the method names you are
> calling
> > in soap in soap admin for xml-APP. 
> > 
> > XML code :
> > 
> > call:
> > java org.apache.soap.server.ServiceManagerClient :
> >
> /soap/servlet/rpcrouter">http://:
> /soap/servlet/rpcrouter
> > deploy C:\soapcode\Deploy.xml
> > 
> > code:
> > 
> > 
> >
>
-------------------------------------------------------------------
> > 
> > > "http://xml.apache.org/xml-soap/deployment"
> > 
> > id="urn:xml-App">
> > 
> > > 
> > methods="fetchData">
> > 
> > >
>
class="com.yourcompany.yourpackage.serversideclass"/>
> > 
> > 
> > 
> > 
> > 
> > 
> > org.apache.soap.server.DOMFaultListener
> > 
> > 
> > 
> > 
> > 
> >
>
--------------------------------------------------------------------------------------
> > 
> > code in serversideclass
> > 
> > public Vector fetchData( String customerID) 
> > 
> > { 
> > // access your dastabase bean with customerID
> > 
> > return returnVector;
> > }
> > 
> > or
> > 
> > 
> > 
> > public String fetchData( String customerID) 
> > 
> > { 
> > // access your dastabase bean with customerID
> > 
> > return returnString;
> > }
> > 
> > 
> > 
> > Hope this helps. Dont know if this is perfect, but
> > this is the way I do it.
> > 
> > Regards
> > 
> > Jonathan
> > 
> > 
> > 
> > Parames wrote:
> > Thanks for your response ,
> > Any i have query ,Im trying to send string as
> > XML(Element) to the service where service needs to
> > fetch string matching datas from database.
> > XML like Addressbook example..
> > 
> > Can anyone send me some code for 
> > sending stringas element,Bcoz in service im
> passing
> > resultset to element.
> > Can anyone help me??
> > 
> > My GUI code 
> > 
> > public void actionPerformed(ActionEvent event)
> > {
> > String but = event.getActionCommand();
> > if (but == "OK" )
> > {
> > // IdToLookUp is the value i want to take 
> > IdToLookUp =jTextField1.getText();
> > 
> > 
> > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element custID = doc.createElement("CustomerID");
> >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > 
> > 
> > //make a call to soap server with customer ID
> > 
> > try{
> > 
> > // GetCustInfo() is the SOAP CLIENT where i need
> to
> > pass this element...
> > 
> > gci = new GetCustInfo();
> > 
> > Element element =gci.callCustSVC(customerId);}
> > catch (Exception e) {
> > e.printStackTrace();
> > System.out.println("ERROR "+e);
> > }
> > }
> > 
> >
>
-------------------------------------------------------
> > Thanks in advance
> > Expecting to hear from you
> > regards
> > parames
> > 
> > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to
> > Outlook(TM).
> > http://calendar.yahoo.com
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to
> Outlook(TM).
> http://calendar.yahoo.com
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string as ELEMENT

Posted by Scott Nichol <sn...@scottnichol.com>.
If you want to send an Element using SOAP encoding, you would need to 
create a serializer and deserializer.  The "standard" way to send an 
element using Apache SOAP is to use literal XML encoding, which the 
getAllAddresses sample does.  This will not interoperate with many 
(any?) other SOAP implementations.

On 4 Jun 2003 at 20:54, Vishal Shah wrote:

> Correct me if I'm wrong, but this requires defining de/serializer for this object type. 
>  
> There is a difference between an XML file (Document) and Element (DOM element).
>  
> VS
> 
> Parames <kp...@yahoo.com> wrote:
> Thanks Jonathan
> 
> --- Jonathan Roberts wrote:
> > Hi.
> > 
> > You can presumably only send an XML element if you
> > define it as an object, and pass this over.
> > 
> > RegisterSettings just sets up which xml-app to use.
> > 
> > Jonathan
> > 
> > Parames wrote:
> > HI ,
> > Thanks a lot ..
> > The same logic is working for me with java bean....
> > im trying to pass XML element to service instead of
> > string...ie.XML file.
> > Im getting string from client side but need to send
> > as
> > Element ...
> > im dont want to use java bean..
> > any idea??
> > And what is call.registerSettings() method do??
> > 
> > REgards
> > parames
> > 
> > --- Jonathan Roberts wrote:
> > > Something like this (code not tested)
> > >
> >
> --------------------------------------------------------------------------------------
> > > Client side
> > > ----------------
> > > String returnString = "";
> > > Call c=new Call();
> > > c = registerSettings( c );
> > > c.setMethodName ("fetchData"); 
> > > //fetchData is name of server side method
> > > // Set up parameters to pass
> > > Vector parameters = new Vector();
> > > String customerID = "2100"; // or get cusotmerID
> > > from elsewhere!
> > > parameters.addElement (new Parameter("customerID",
> > > String.class, customerID, null));
> > > c.setParams (parameters);
> > > Response r=null; 
> > > try
> > > {
> > > // where mstrHostString = http://soapServer:8080
> > > // in other words ip & port you have soap on
> > > r = c.invoke ( new URL( mstrHostString +
> > > "/soap/servlet/rpcrouter"), "" );
> > > }
> > > catch ( Exception e )
> > > {
> > > System.out.println ("exception service not
> > > available on " + mstrHostString);
> > > return;
> > > }
> > > // Check the response.
> > > if (r.generatedFault ()) 
> > > {
> > > Fault f = r.getFault();
> > > System.out.println (" Fault Code = " +
> > > f.getFaultCode());
> > > System.out.println (" Fault String = " +
> > > f.getFaultString());
> > > } 
> > > else 
> > > {
> > > Parameter returnObject = r.getReturnValue(); 
> > > // return vector of objects - e.g. strings
> > > //Vector returnVector =
> > > (Vector)returnObject.getValue(); 
> > > //returnString = (String) returnVector.get( 0 );
> > > or
> > > // return just one string
> > > returnString = (String)returnObject.getValue(); 
> > > }
> > > 
> > > public Call registerSettings( Call c )
> > > { 
> > > // SET TARGET URI
> > > c.setSOAPTransport(httpConn); 
> > > c.setTargetObjectURI ("urn:xml-APP"); // name of
> > > app in soap admin
> > > // SET METHOD BEING CALLED ON SERVER
> > > c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); 
> > > 
> > > return c;
> > > }
> > > 
> > >
> >
> ---------------------------------------------------------------------
> > > 
> > > 
> > > server side
> > > --------------
> > > You need to specify the method names you are
> > calling
> > > in soap in soap admin for xml-APP. 
> > > 
> > > XML code :
> > > 
> > > call:
> > > java org.apache.soap.server.ServiceManagerClient :
> > >
> > /soap/servlet/rpcrouter">http://:
> > /soap/servlet/rpcrouter
> > > deploy C:\soapcode\Deploy.xml
> > > 
> > > code:
> > > 
> > > 
> > >
> >
> -------------------------------------------------------------------
> > > 
> > > > "http://xml.apache.org/xml-soap/deployment"
> > > 
> > > id="urn:xml-App">
> > > 
> > > > 
> > > methods="fetchData">
> > > 
> > > >
> >
> class="com.yourcompany.yourpackage.serversideclass"/>
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > org.apache.soap.server.DOMFaultListener
> > > 
> > > 
> > > 
> > > 
> > > 
> > >
> >
> --------------------------------------------------------------------------------------
> > > 
> > > code in serversideclass
> > > 
> > > public Vector fetchData( String customerID) 
> > > 
> > > { 
> > > // access your dastabase bean with customerID
> > > 
> > > return returnVector;
> > > }
> > > 
> > > or
> > > 
> > > 
> > > 
> > > public String fetchData( String customerID) 
> > > 
> > > { 
> > > // access your dastabase bean with customerID
> > > 
> > > return returnString;
> > > }
> > > 
> > > 
> > > 
> > > Hope this helps. Dont know if this is perfect, but
> > > this is the way I do it.
> > > 
> > > Regards
> > > 
> > > Jonathan
> > > 
> > > 
> > > 
> > > Parames wrote:
> > > Thanks for your response ,
> > > Any i have query ,Im trying to send string as
> > > XML(Element) to the service where service needs to
> > > fetch string matching datas from database.
> > > XML like Addressbook example..
> > > 
> > > Can anyone send me some code for 
> > > sending stringas element,Bcoz in service im
> > passing
> > > resultset to element.
> > > Can anyone help me??
> > > 
> > > My GUI code 
> > > 
> > > public void actionPerformed(ActionEvent event)
> > > {
> > > String but = event.getActionCommand();
> > > if (but == "OK" )
> > > {
> > > // IdToLookUp is the value i want to take 
> > > IdToLookUp =jTextField1.getText();
> > > 
> > > 
> > > // HERE the STRING TO PASS AS ELEMENT
> > > 
> > > DocumentBuilder xdb =
> > > XMLParserUtils.getXMLDocBuilder();
> > > Document doc = xdb.newDocument();
> > > Element custID = doc.createElement("CustomerID");
> > >
> > custID.appendChild(doc.createTextNode(IdToLookUp));
> > > 
> > > 
> > > //make a call to soap server with customer ID
> > > 
> > > try{
> > > 
> > > // GetCustInfo() is the SOAP CLIENT where i need
> > to
> > > pass this element...
> > > 
> > > gci = new GetCustInfo();
> > > 
> > > Element element =gci.callCustSVC(customerId);}
> > > catch (Exception e) {
> > > e.printStackTrace();
> > > System.out.println("ERROR "+e);
> > > }
> > > }
> > > 
> > >
> >
> -------------------------------------------------------
> > > Thanks in advance
> > > Expecting to hear from you
> > > regards
> > > parames
> > > 
> > > 
> > > 
> > > 
> > > __________________________________
> > > Do you Yahoo!?
> > > Yahoo! Calendar - Free online calendar with sync
> > to
> > > Outlook(TM).
> > > http://calendar.yahoo.com
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync to
> > Outlook(TM).
> > http://calendar.yahoo.com
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
> http://calendar.yahoo.com
> 
> ---------------------------------
> Do you Yahoo!?
> Free online calendar with sync to Outlook(TM).


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: Passing string as ELEMENT

Posted by Vishal Shah <sh...@yahoo.com>.
Correct me if I'm wrong, but this requires defining de/serializer for this object type. 
 
There is a difference between an XML file (Document) and Element (DOM element).
 
VS

Parames <kp...@yahoo.com> wrote:
Thanks Jonathan

--- Jonathan Roberts wrote:
> Hi.
> 
> You can presumably only send an XML element if you
> define it as an object, and pass this over.
> 
> RegisterSettings just sets up which xml-app to use.
> 
> Jonathan
> 
> Parames wrote:
> HI ,
> Thanks a lot ..
> The same logic is working for me with java bean....
> im trying to pass XML element to service instead of
> string...ie.XML file.
> Im getting string from client side but need to send
> as
> Element ...
> im dont want to use java bean..
> any idea??
> And what is call.registerSettings() method do??
> 
> REgards
> parames
> 
> --- Jonathan Roberts wrote:
> > Something like this (code not tested)
> >
>
--------------------------------------------------------------------------------------
> > Client side
> > ----------------
> > String returnString = "";
> > Call c=new Call();
> > c = registerSettings( c );
> > c.setMethodName ("fetchData"); 
> > //fetchData is name of server side method
> > // Set up parameters to pass
> > Vector parameters = new Vector();
> > String customerID = "2100"; // or get cusotmerID
> > from elsewhere!
> > parameters.addElement (new Parameter("customerID",
> > String.class, customerID, null));
> > c.setParams (parameters);
> > Response r=null; 
> > try
> > {
> > // where mstrHostString = http://soapServer:8080
> > // in other words ip & port you have soap on
> > r = c.invoke ( new URL( mstrHostString +
> > "/soap/servlet/rpcrouter"), "" );
> > }
> > catch ( Exception e )
> > {
> > System.out.println ("exception service not
> > available on " + mstrHostString);
> > return;
> > }
> > // Check the response.
> > if (r.generatedFault ()) 
> > {
> > Fault f = r.getFault();
> > System.out.println (" Fault Code = " +
> > f.getFaultCode());
> > System.out.println (" Fault String = " +
> > f.getFaultString());
> > } 
> > else 
> > {
> > Parameter returnObject = r.getReturnValue(); 
> > // return vector of objects - e.g. strings
> > //Vector returnVector =
> > (Vector)returnObject.getValue(); 
> > //returnString = (String) returnVector.get( 0 );
> > or
> > // return just one string
> > returnString = (String)returnObject.getValue(); 
> > }
> > 
> > public Call registerSettings( Call c )
> > { 
> > // SET TARGET URI
> > c.setSOAPTransport(httpConn); 
> > c.setTargetObjectURI ("urn:xml-APP"); // name of
> > app in soap admin
> > // SET METHOD BEING CALLED ON SERVER
> > c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); 
> > 
> > return c;
> > }
> > 
> >
>
---------------------------------------------------------------------
> > 
> > 
> > server side
> > --------------
> > You need to specify the method names you are
> calling
> > in soap in soap admin for xml-APP. 
> > 
> > XML code :
> > 
> > call:
> > java org.apache.soap.server.ServiceManagerClient :
> >
> /soap/servlet/rpcrouter">http://:
> /soap/servlet/rpcrouter
> > deploy C:\soapcode\Deploy.xml
> > 
> > code:
> > 
> > 
> >
>
-------------------------------------------------------------------
> > 
> > > "http://xml.apache.org/xml-soap/deployment"
> > 
> > id="urn:xml-App">
> > 
> > > 
> > methods="fetchData">
> > 
> > >
>
class="com.yourcompany.yourpackage.serversideclass"/>
> > 
> > 
> > 
> > 
> > 
> > 
> > org.apache.soap.server.DOMFaultListener
> > 
> > 
> > 
> > 
> > 
> >
>
--------------------------------------------------------------------------------------
> > 
> > code in serversideclass
> > 
> > public Vector fetchData( String customerID) 
> > 
> > { 
> > // access your dastabase bean with customerID
> > 
> > return returnVector;
> > }
> > 
> > or
> > 
> > 
> > 
> > public String fetchData( String customerID) 
> > 
> > { 
> > // access your dastabase bean with customerID
> > 
> > return returnString;
> > }
> > 
> > 
> > 
> > Hope this helps. Dont know if this is perfect, but
> > this is the way I do it.
> > 
> > Regards
> > 
> > Jonathan
> > 
> > 
> > 
> > Parames wrote:
> > Thanks for your response ,
> > Any i have query ,Im trying to send string as
> > XML(Element) to the service where service needs to
> > fetch string matching datas from database.
> > XML like Addressbook example..
> > 
> > Can anyone send me some code for 
> > sending stringas element,Bcoz in service im
> passing
> > resultset to element.
> > Can anyone help me??
> > 
> > My GUI code 
> > 
> > public void actionPerformed(ActionEvent event)
> > {
> > String but = event.getActionCommand();
> > if (but == "OK" )
> > {
> > // IdToLookUp is the value i want to take 
> > IdToLookUp =jTextField1.getText();
> > 
> > 
> > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element custID = doc.createElement("CustomerID");
> >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > 
> > 
> > //make a call to soap server with customer ID
> > 
> > try{
> > 
> > // GetCustInfo() is the SOAP CLIENT where i need
> to
> > pass this element...
> > 
> > gci = new GetCustInfo();
> > 
> > Element element =gci.callCustSVC(customerId);}
> > catch (Exception e) {
> > e.printStackTrace();
> > System.out.println("ERROR "+e);
> > }
> > }
> > 
> >
>
-------------------------------------------------------
> > Thanks in advance
> > Expecting to hear from you
> > regards
> > parames
> > 
> > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to
> > Outlook(TM).
> > http://calendar.yahoo.com
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to
> Outlook(TM).
> http://calendar.yahoo.com
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

---------------------------------
Do you Yahoo!?
Free online calendar with sync to Outlook(TM).

Re: Passing string as ELEMENT

Posted by Parames <kp...@yahoo.com>.
Thanks Jonathan

--- Jonathan Roberts <j_...@yahoo.co.uk> wrote:
> Hi.
>  
> You can presumably only send an XML element if you
> define it as an object, and pass this over.
>  
> RegisterSettings just sets up which xml-app to use.
>  
> Jonathan
> 
> Parames <kp...@yahoo.com> wrote:
> HI ,
> Thanks a lot ..
> The same logic is working for me with java bean....
> im trying to pass XML element to service instead of
> string...ie.XML file.
> Im getting string from client side but need to send
> as
> Element ...
> im dont want to use java bean..
> any idea??
> And what is call.registerSettings() method do??
> 
> REgards
> parames
> 
> --- Jonathan Roberts wrote:
> > Something like this (code not tested)
> >
>
--------------------------------------------------------------------------------------
> > Client side
> > ----------------
> > String returnString = "";
> > Call c=new Call();
> > c = registerSettings( c );
> > c.setMethodName ("fetchData"); 
> > //fetchData is name of server side method
> > // Set up parameters to pass
> > Vector parameters = new Vector();
> > String customerID = "2100"; // or get cusotmerID
> > from elsewhere!
> > parameters.addElement (new Parameter("customerID",
> > String.class, customerID, null));
> > c.setParams (parameters);
> > Response r=null; 
> > try
> > {
> > // where mstrHostString = http://soapServer:8080
> > // in other words ip & port you have soap on
> > r = c.invoke ( new URL( mstrHostString +
> > "/soap/servlet/rpcrouter"), "" );
> > }
> > catch ( Exception e )
> > {
> > System.out.println ("exception service not
> > available on " + mstrHostString);
> > return;
> > }
> > // Check the response.
> > if (r.generatedFault ()) 
> > {
> > Fault f = r.getFault();
> > System.out.println (" Fault Code = " +
> > f.getFaultCode());
> > System.out.println (" Fault String = " +
> > f.getFaultString());
> > } 
> > else 
> > {
> > Parameter returnObject = r.getReturnValue(); 
> > // return vector of objects - e.g. strings
> > //Vector returnVector =
> > (Vector)returnObject.getValue(); 
> > //returnString = (String) returnVector.get( 0 );
> > or
> > // return just one string
> > returnString = (String)returnObject.getValue(); 
> > }
> > 
> > public Call registerSettings( Call c )
> > { 
> > // SET TARGET URI
> > c.setSOAPTransport(httpConn); 
> > c.setTargetObjectURI ("urn:xml-APP"); // name of
> > app in soap admin
> > // SET METHOD BEING CALLED ON SERVER
> > c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); 
> > 
> > return c;
> > }
> > 
> >
>
---------------------------------------------------------------------
> > 
> > 
> > server side
> > --------------
> > You need to specify the method names you are
> calling
> > in soap in soap admin for xml-APP. 
> > 
> > XML code :
> > 
> > call:
> > java org.apache.soap.server.ServiceManagerClient :
> >
> /soap/servlet/rpcrouter">http://:
> /soap/servlet/rpcrouter
> > deploy C:\soapcode\Deploy.xml
> > 
> > code:
> > 
> > 
> >
>
-------------------------------------------------------------------
> > 
> > > "http://xml.apache.org/xml-soap/deployment"
> > 
> > id="urn:xml-App">
> > 
> > > 
> > methods="fetchData">
> > 
> > >
>
class="com.yourcompany.yourpackage.serversideclass"/>
> > 
> > 
> > 
> > 
> > 
> > 
> > org.apache.soap.server.DOMFaultListener
> > 
> > 
> > 
> > 
> > 
> >
>
--------------------------------------------------------------------------------------
> > 
> > code in serversideclass
> > 
> > public Vector fetchData( String customerID) 
> > 
> > { 
> > // access your dastabase bean with customerID
> > 
> > return returnVector;
> > }
> > 
> > or
> > 
> > 
> > 
> > public String fetchData( String customerID) 
> > 
> > { 
> > // access your dastabase bean with customerID
> > 
> > return returnString;
> > }
> > 
> > 
> > 
> > Hope this helps. Dont know if this is perfect, but
> > this is the way I do it.
> > 
> > Regards
> > 
> > Jonathan
> > 
> > 
> > 
> > Parames wrote:
> > Thanks for your response ,
> > Any i have query ,Im trying to send string as
> > XML(Element) to the service where service needs to
> > fetch string matching datas from database.
> > XML like Addressbook example..
> > 
> > Can anyone send me some code for 
> > sending stringas element,Bcoz in service im
> passing
> > resultset to element.
> > Can anyone help me??
> > 
> > My GUI code 
> > 
> > public void actionPerformed(ActionEvent event)
> > {
> > String but = event.getActionCommand();
> > if (but == "OK" )
> > {
> > // IdToLookUp is the value i want to take 
> > IdToLookUp =jTextField1.getText();
> > 
> > 
> > // HERE the STRING TO PASS AS ELEMENT
> > 
> > DocumentBuilder xdb =
> > XMLParserUtils.getXMLDocBuilder();
> > Document doc = xdb.newDocument();
> > Element custID = doc.createElement("CustomerID");
> >
> custID.appendChild(doc.createTextNode(IdToLookUp));
> > 
> > 
> > //make a call to soap server with customer ID
> > 
> > try{
> > 
> > // GetCustInfo() is the SOAP CLIENT where i need
> to
> > pass this element...
> > 
> > gci = new GetCustInfo();
> > 
> > Element element =gci.callCustSVC(customerId);}
> > catch (Exception e) {
> > e.printStackTrace();
> > System.out.println("ERROR "+e);
> > }
> > }
> > 
> >
>
-------------------------------------------------------
> > Thanks in advance
> > Expecting to hear from you
> > regards
> > parames
> > 
> > 
> > 
> > 
> > __________________________________
> > Do you Yahoo!?
> > Yahoo! Calendar - Free online calendar with sync
> to
> > Outlook(TM).
> > http://calendar.yahoo.com
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to
> Outlook(TM).
> http://calendar.yahoo.com
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string as ELEMENT

Posted by Jonathan Roberts <j_...@yahoo.co.uk>.
Hi.
 
You can presumably only send an XML element if you define it as an object, and pass this over.
 
RegisterSettings just sets up which xml-app to use.
 
Jonathan

Parames <kp...@yahoo.com> wrote:
HI ,
Thanks a lot ..
The same logic is working for me with java bean....
im trying to pass XML element to service instead of
string...ie.XML file.
Im getting string from client side but need to send as
Element ...
im dont want to use java bean..
any idea??
And what is call.registerSettings() method do??

REgards
parames

--- Jonathan Roberts wrote:
> Something like this (code not tested)
>
--------------------------------------------------------------------------------------
> Client side
> ----------------
> String returnString = "";
> Call c=new Call();
> c = registerSettings( c );
> c.setMethodName ("fetchData"); 
> //fetchData is name of server side method
> // Set up parameters to pass
> Vector parameters = new Vector();
> String customerID = "2100"; // or get cusotmerID
> from elsewhere!
> parameters.addElement (new Parameter("customerID",
> String.class, customerID, null));
> c.setParams (parameters);
> Response r=null; 
> try
> {
> // where mstrHostString = http://soapServer:8080
> // in other words ip & port you have soap on
> r = c.invoke ( new URL( mstrHostString +
> "/soap/servlet/rpcrouter"), "" );
> }
> catch ( Exception e )
> {
> System.out.println ("exception service not
> available on " + mstrHostString);
> return;
> }
> // Check the response.
> if (r.generatedFault ()) 
> {
> Fault f = r.getFault();
> System.out.println (" Fault Code = " +
> f.getFaultCode());
> System.out.println (" Fault String = " +
> f.getFaultString());
> } 
> else 
> {
> Parameter returnObject = r.getReturnValue(); 
> // return vector of objects - e.g. strings
> //Vector returnVector =
> (Vector)returnObject.getValue(); 
> //returnString = (String) returnVector.get( 0 );
> or
> // return just one string
> returnString = (String)returnObject.getValue(); 
> }
> 
> public Call registerSettings( Call c )
> { 
> // SET TARGET URI
> c.setSOAPTransport(httpConn); 
> c.setTargetObjectURI ("urn:xml-APP"); // name of
> app in soap admin
> // SET METHOD BEING CALLED ON SERVER
> c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); 
> 
> return c;
> }
> 
>
---------------------------------------------------------------------
> 
> 
> server side
> --------------
> You need to specify the method names you are calling
> in soap in soap admin for xml-APP. 
> 
> XML code :
> 
> call:
> java org.apache.soap.server.ServiceManagerClient :
>
/soap/servlet/rpcrouter">http://:
/soap/servlet/rpcrouter
> deploy C:\soapcode\Deploy.xml
> 
> code:
> 
> 
>
-------------------------------------------------------------------
> 
> > "http://xml.apache.org/xml-soap/deployment"
> 
> id="urn:xml-App">
> 
> > 
> methods="fetchData">
> 
> >
class="com.yourcompany.yourpackage.serversideclass"/>
> 
> 
> 
> 
> 
> 
> org.apache.soap.server.DOMFaultListener
> 
> 
> 
> 
> 
>
--------------------------------------------------------------------------------------
> 
> code in serversideclass
> 
> public Vector fetchData( String customerID) 
> 
> { 
> // access your dastabase bean with customerID
> 
> return returnVector;
> }
> 
> or
> 
> 
> 
> public String fetchData( String customerID) 
> 
> { 
> // access your dastabase bean with customerID
> 
> return returnString;
> }
> 
> 
> 
> Hope this helps. Dont know if this is perfect, but
> this is the way I do it.
> 
> Regards
> 
> Jonathan
> 
> 
> 
> Parames wrote:
> Thanks for your response ,
> Any i have query ,Im trying to send string as
> XML(Element) to the service where service needs to
> fetch string matching datas from database.
> XML like Addressbook example..
> 
> Can anyone send me some code for 
> sending stringas element,Bcoz in service im passing
> resultset to element.
> Can anyone help me??
> 
> My GUI code 
> 
> public void actionPerformed(ActionEvent event)
> {
> String but = event.getActionCommand();
> if (but == "OK" )
> {
> // IdToLookUp is the value i want to take 
> IdToLookUp =jTextField1.getText();
> 
> 
> // HERE the STRING TO PASS AS ELEMENT
> 
> DocumentBuilder xdb =
> XMLParserUtils.getXMLDocBuilder();
> Document doc = xdb.newDocument();
> Element custID = doc.createElement("CustomerID");
> custID.appendChild(doc.createTextNode(IdToLookUp));
> 
> 
> //make a call to soap server with customer ID
> 
> try{
> 
> // GetCustInfo() is the SOAP CLIENT where i need to
> pass this element...
> 
> gci = new GetCustInfo();
> 
> Element element =gci.callCustSVC(customerId);}
> catch (Exception e) {
> e.printStackTrace();
> System.out.println("ERROR "+e);
> }
> }
> 
>
-------------------------------------------------------
> Thanks in advance
> Expecting to hear from you
> regards
> parames
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to
> Outlook(TM).
> http://calendar.yahoo.com
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com



---------------------------------
Yahoo! Plus - For a better Internet experience

Re: Passing string as ELEMENT

Posted by Parames <kp...@yahoo.com>.
HI ,
Thanks a lot ..
The same logic is working for me with java bean....
im trying to pass XML element to service instead of
string...ie.XML file.
Im getting string from client side but need to send as
Element ...
im dont want to use java bean..
any idea??
And what is call.registerSettings() method  do??

REgards
parames

--- Jonathan Roberts <j_...@yahoo.co.uk> wrote:
> Something like this (code not tested)
>
--------------------------------------------------------------------------------------
> Client side
> ----------------
>   String returnString = "";
>   Call c=new Call();
>   c = registerSettings( c );
>   c.setMethodName ("fetchData");   
> //fetchData is name of server side method
>   // Set up parameters to pass
>   Vector parameters = new Vector();
>   String customerID = "2100"; // or get cusotmerID
> from elsewhere!
>   parameters.addElement (new Parameter("customerID",
> String.class, customerID, null));
>   c.setParams (parameters);
>   Response r=null; 
>   try
>   {
>    // where mstrHostString = http://soapServer:8080
>   //  in other words ip & port you have soap on
>    r = c.invoke ( new URL( mstrHostString +
> "/soap/servlet/rpcrouter"), "" );
>   }
>   catch ( Exception e )
>   {
>    System.out.println ("exception service not
> available on " + mstrHostString);
>    return;
>   }
>   // Check the response.
>   if (r.generatedFault ()) 
>   {
>    Fault f = r.getFault();
>    System.out.println ("  Fault Code   = " +
> f.getFaultCode());
>    System.out.println ("  Fault String = " +
> f.getFaultString());
>   } 
>   else 
>   {
>    Parameter returnObject = r.getReturnValue();   
>    // return vector of objects - e.g. strings
>    //Vector returnVector =
> (Vector)returnObject.getValue();  
>    //returnString = (String) returnVector.get( 0 );
>    or
>    // return just one string
>    returnString = (String)returnObject.getValue();  
>   }
> 
>  public Call registerSettings( Call c )
>  {  
>   // SET TARGET URI
>   c.setSOAPTransport(httpConn);     
>   c.setTargetObjectURI ("urn:xml-APP");  // name of
> app in soap admin
>   // SET METHOD BEING CALLED ON SERVER
>   c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC); 
>        
>   return c;
> }
>  
>
---------------------------------------------------------------------
>  
>  
> server side
> --------------
> You need to specify the method names you are calling
> in soap in soap admin for xml-APP.  
>  
> XML  code :
>  
> call:
> java org.apache.soap.server.ServiceManagerClient :
>
/soap/servlet/rpcrouter">http://<ipaddress>:<port>/soap/servlet/rpcrouter
> deploy C:\soapcode\Deploy.xml
> 
> code:
>  
>  
>
-------------------------------------------------------------------
> 
> <isd:service xmlns:isd=
> "http://xml.apache.org/xml-soap/deployment"
> 
> id="urn:xml-App">
> 
> <isd:provider type="java" scope="Application"
> 
> methods="fetchData">
> 
> <isd:java
>
class="com.yourcompany.yourpackage.serversideclass"/>
> 
> </isd:provider>
> 
> 
> <isd:faultListener>
> 
> org.apache.soap.server.DOMFaultListener
> 
> </isd:faultListener>
> 
> </isd:service>
> 
>
--------------------------------------------------------------------------------------
>  
> code in serversideclass
>  
>  public Vector fetchData( String customerID)        
> 
>  { 
>    // access your dastabase bean with customerID
> 
>   return returnVector;
>  }
>  
> or
> 
> 
> 
>  public String  fetchData( String customerID)       
>  
>  { 
>    // access your dastabase bean with customerID
> 
>   return returnString;
>  }
>  
>  
>  
> Hope this helps.  Dont know if this is perfect, but
> this is the way I do it.
>  
> Regards
>  
> Jonathan
> 
> 
> 
> Parames <kp...@yahoo.com> wrote:
> Thanks for your response ,
> Any i have query ,Im trying to send string as
> XML(Element) to the service where service needs to
> fetch string matching datas from database.
> XML like Addressbook example..
> 
> Can anyone send me some code for 
> sending stringas element,Bcoz in service im passing
> resultset to element.
> Can anyone help me??
> 
> My GUI code 
> 
> public void actionPerformed(ActionEvent event)
> {
> String but = event.getActionCommand();
> if (but == "OK" )
> {
> // IdToLookUp is the value i want to take 
> IdToLookUp =jTextField1.getText();
> 
> 
> // HERE the STRING TO PASS AS ELEMENT
> 
> DocumentBuilder xdb =
> XMLParserUtils.getXMLDocBuilder();
> Document doc = xdb.newDocument();
> Element custID = doc.createElement("CustomerID");
> custID.appendChild(doc.createTextNode(IdToLookUp));
> 
> 
> //make a call to soap server with customer ID
> 
> try{
> 
> // GetCustInfo() is the SOAP CLIENT where i need to
> pass this element...
> 
> gci = new GetCustInfo();
> 
> Element element =gci.callCustSVC(customerId);}
> catch (Exception e) {
> e.printStackTrace();
> System.out.println("ERROR "+e);
> }
> }
> 
>
-------------------------------------------------------
> Thanks in advance
> Expecting to hear from you
> regards
> parames
> 
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> Yahoo! Calendar - Free online calendar with sync to
> Outlook(TM).
> http://calendar.yahoo.com
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: Passing string SERVICE

Posted by Jonathan Roberts <j_...@yahoo.co.uk>.
Something like this (code not tested)
--------------------------------------------------------------------------------------
Client side
----------------
  String returnString = "";
  Call c=new Call();
  c = registerSettings( c );
  c.setMethodName ("fetchData");   
//fetchData is name of server side method
  // Set up parameters to pass
  Vector parameters = new Vector();
  String customerID = "2100"; // or get cusotmerID from elsewhere!
  parameters.addElement (new Parameter("customerID", String.class, customerID, null));
  c.setParams (parameters);
  Response r=null; 
  try
  {
   // where mstrHostString = http://soapServer:8080
  //  in other words ip & port you have soap on
   r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
  }
  catch ( Exception e )
  {
   System.out.println ("exception service not available on " + mstrHostString);
   return;
  }
  // Check the response.
  if (r.generatedFault ()) 
  {
   Fault f = r.getFault();
   System.out.println ("  Fault Code   = " + f.getFaultCode());
   System.out.println ("  Fault String = " + f.getFaultString());
  } 
  else 
  {
   Parameter returnObject = r.getReturnValue();   
   // return vector of objects - e.g. strings
   //Vector returnVector = (Vector)returnObject.getValue();  
   //returnString = (String) returnVector.get( 0 );
   or
   // return just one string
   returnString = (String)returnObject.getValue();  
  }

 public Call registerSettings( Call c )
 {  
  // SET TARGET URI
  c.setSOAPTransport(httpConn);     
  c.setTargetObjectURI ("urn:xml-APP");  // name of app in soap admin
  // SET METHOD BEING CALLED ON SERVER
  c.setEncodingStyleURI(Constants.NS_URI_SOAP_ENC);         
  return c;
}
 
---------------------------------------------------------------------
 
 
server side
--------------
You need to specify the method names you are calling in soap in soap admin for xml-APP.  
 
XML  code :
 
call:
java org.apache.soap.server.ServiceManagerClient :
/soap/servlet/rpcrouter">http://<ipaddress>:<port>/soap/servlet/rpcrouter deploy C:\soapcode\Deploy.xml

code:
 
 
-------------------------------------------------------------------

<isd:service xmlns:isd= "http://xml.apache.org/xml-soap/deployment"

id="urn:xml-App">

<isd:provider type="java" scope="Application"

methods="fetchData">

<isd:java class="com.yourcompany.yourpackage.serversideclass"/>

</isd:provider>


<isd:faultListener>

org.apache.soap.server.DOMFaultListener

</isd:faultListener>

</isd:service>

--------------------------------------------------------------------------------------
 
code in serversideclass
 
 public Vector fetchData( String customerID)         
 { 
   // access your dastabase bean with customerID

  return returnVector;
 }
 
or



 public String  fetchData( String customerID)         
 { 
   // access your dastabase bean with customerID

  return returnString;
 }
 
 
 
Hope this helps.  Dont know if this is perfect, but this is the way I do it.
 
Regards
 
Jonathan



Parames <kp...@yahoo.com> wrote:
Thanks for your response ,
Any i have query ,Im trying to send string as
XML(Element) to the service where service needs to
fetch string matching datas from database.
XML like Addressbook example..

Can anyone send me some code for 
sending stringas element,Bcoz in service im passing
resultset to element.
Can anyone help me??

My GUI code 

public void actionPerformed(ActionEvent event)
{
String but = event.getActionCommand();
if (but == "OK" )
{
// IdToLookUp is the value i want to take 
IdToLookUp =jTextField1.getText();


// HERE the STRING TO PASS AS ELEMENT

DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
Document doc = xdb.newDocument();
Element custID = doc.createElement("CustomerID");
custID.appendChild(doc.createTextNode(IdToLookUp));


//make a call to soap server with customer ID

try{

// GetCustInfo() is the SOAP CLIENT where i need to
pass this element...

gci = new GetCustInfo();

Element element =gci.callCustSVC(customerId);}
catch (Exception e) {
e.printStackTrace();
System.out.println("ERROR "+e);
}
}

-------------------------------------------------------
Thanks in advance
Expecting to hear from you
regards
parames




__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com





---------------------------------
Yahoo! Plus - For a better Internet experience

Passing string SERVICE

Posted by Parames <kp...@yahoo.com>.
Thanks for your response ,
Any i have query ,Im trying to send string as
XML(Element) to the service where service needs to
fetch string matching datas from database.
XML like Addressbook example..

Can anyone send me some code for 
sending stringas element,Bcoz in service im passing
resultset to element.
Can anyone help me??

My GUI code 

public void actionPerformed(ActionEvent event)
    {
 String but = event.getActionCommand();
 if (but == "OK" )
 {
 //  IdToLookUp  is the value i want to take 	
  IdToLookUp =jTextField1.getText();

  
// HERE the STRING TO PASS AS ELEMENT

DocumentBuilder xdb =
XMLParserUtils.getXMLDocBuilder();
  Document doc = xdb.newDocument();
  Element custID = doc.createElement("CustomerID");
  custID.appendChild(doc.createTextNode(IdToLookUp));
          
    	
  //make a call to soap server with customer ID
  	       
 try{

// GetCustInfo() is the SOAP CLIENT where i need to
pass this element...

gci = new GetCustInfo();
                          
Element element =gci.callCustSVC(customerId);}
 catch (Exception e) {
   	e.printStackTrace();
         System.out.println("ERROR "+e);
}
  }

-------------------------------------------------------
Thanks in advance
Expecting to hear from you
regards
parames




__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com

Re: de-serialisation problem

Posted by Jonathan Roberts <j_...@yahoo.co.uk>.
Scott,
 
Details are
 
non-working soap.war File : 367 KB,  (31/05/2002)
working soap file : 352 KB, (29/05/2002)

 
Failing XML :
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 

Working XML:
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" 
xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" 
xmlns:xsd="http://www.w3.org/1999/XMLSchema"> 

 
Obviously one is 2001, compared to 1999.
 
Hope this helps.
 
Thanks again.
 
Regards
 
Jonathan
 
 

Scott Nichol <sn...@scottnichol.com> wrote:
Can you tell me the sizes of the 2 war files?

Also, with the xml sniffer, do you see the same version of the XML 
schema namespace for xmlns:xsd="..."?

On 3 Jun 2003 at 11:59, Jonathan Roberts wrote:

> Scott,
> Excellent news - this was defiantely a version issue. I've just made doubly sure and the version of the soap war files "are different". 
> 
> Interestly the latest version causes this error whereas the older version does not.
> 
> Scott again thanks for all your help and your continual support of this newsgroup.
> 
> Kind Regard
> 
> Jonathan
> 
> 
> 
> Scott Nichol wrote:
> If the value being serialized is really null and you have the same 
> version of Apache SOAP on the deployment server as the development, I 
> would expect things to work.
> 
> It is true that null values can be deserialized. This should be true 
> for beans you've mapped and ones you have not (ur-type). Given the 
> errors you have, though, it does not seem that a null is really being 
> serialized. For example
> 
> Can't yet deserialize non-null Objects; 
> 
> is an error that comes up only when you have xsi:type="xsd:ur-type" 
> without xsi:null="true" or xsi:nil="true".
> 
> This makes me wonder whether you really have a null value you are 
> returning, and whether you are using the same version of Apache SOAP 
> in deployment (because handling of xsi:null and xsi:nil has been 
> improved along the way).
> 
> On 2 Jun 2003 at 16:03, Jonathan Roberts wrote:
> 
> > Hi Scott,
> > 
> > I have 2 applications using a number of Value Objects. One of these is a Web Service. In the Web Service implementation the Timestamp is in one of the Value Objects however its value is nver set, and always null. On my development server this seems to work fine and seems to deal with it 
> (maybe false comfort). 
> > 
> > This is the same scenario on the deployment Server, however here it seems to fail. It's as if its denomination xsi:null="true", is sufficent to allow it through the soap system, i.e. since it is always null, soap has never attempted to try and deserialize it.
> > 
> > Hope this makes sense.
> > 
> > Jonathan
> > 
> > Scott Nichol wrote:
> > I don't see how it could ever work, unless some version of 
> > java.sql.Timestamp has a default ctor. The following code in 
> > BeanSerializer creates the bean:
> > 
> > private Object instantiateBean(Class javaType)
> > throws IllegalArgumentException
> > {
> > try
> > {
> > return javaType.newInstance();
> > }
> > catch (Throwable t)
> > {
> > throw new IllegalArgumentException("Unable to instantiate '" +
> > 
> > StringUtils.getClassName(javaType) +
> > "': " + t.getMessage());
> > }
> > }
> > 
> > The newInstance is only going to work if the class has a default ctor 
> > (or in Sun's terminology, a "nullary constructor").
> > 
> > On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> > 
> > > HI Scott,
> > > 
> > > I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes. This seems to be fine on my machine but not on a deployment server. Could it be a class problem?
> > > 
> > > Cheers
> > > 
> > > Jonathan
> > > 
> > > Scott Nichol wrote:
> > > java.sql.Timestamp does not have a default constructor, which Apache 
> > > SOAP requires for instantiation. An alternative for you would be to 
> > > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > > de-serialize.
> > > 
> > > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > > 
> > > > Hi.
> > > > 
> > > > I'm getting the following errors on the response from the soap server :
> > > > 
> > > > on the 
> > > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > > call
> > > > where Response r;
> > > > and Call c;
> > > > ---------------------------------------------------------------------------
> > > > 
> > > > Error report : 
> > > > 1. If information exists and is returned :
> > > > 
> > > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > > 
> > > > You chose fetchAccountUsingAccountNo 10015301
> > > > 
> > > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > > 
> > > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > > 
> > > > ----------------------------------------------------------------------------------------------------
> > > > 2. If no information:
> > > > 
> > > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > > 
> > > > Can't yet deserialize non-null Objects; 
> > > > 
> > > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > > > 
> > > > ------------------------------------------
> > > > 
> > > > Isssues : 
> > > > 
> > > > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > > > 
> > > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > > //map the type
> > > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > > //telling the call object to use this mapping
> > > > c.setSOAPMappingRegistry(smr);
> > > > 
> > > > 2. and the xml
> > > > 
> > > > > 
> > > > xmlns:x="urn:xml-IVR-App" 
> > > > 
> > > > qname="x:java.sql.Timestamp"
> > > > 
> > > > javaType="java.sql.Timestamp"
> > > > 
> > > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > > 
> > > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > > 
> > > > />
> > > > 
> > > > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > > > 
> > > > Any help would be appreciated.
> > > > 
> > > > Jonathan
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > ---------------------------------
> > > > Yahoo! Plus - For a better Internet experience
> > > > 
> > > 
> > > 
> > > Scott Nichol
> > > 
> > > Do not reply directly to this e-mail address,
> > > as it is filtered to only receive e-mail from
> > > specific mailing lists.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.





---------------------------------
Yahoo! Plus - For a better Internet experience

Problem with Host-connection in combination with some Proxies

Posted by Malte Kempff <ke...@medicalcolumbus.de>.
Hello

there are some for me not understandeble Problems with Connections to the
Host via Apache Soap while using Proxies.
The application is a Java-Web-Start-Application. Everything is working with
the given Proxy, the bowser, the receiving of
the application via Java-Web-Start. But trying to make a soap-call ends in a
exceptions like this, allthough the proxy-address was given.

[SOAPException: faultCode=SOAP-ENV:Client; msg=Error connecting to
62.159.233.111:80: java.net.NoRouteToHostException: No route to host:
connect; targetException=java.net.NoRouteToHostException: No route to host:
connect]
	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
	at org.apache.soap.rpc.Call.invoke(Unknown Source)
	at org.apache.soap.rpc.Call.invoke(Unknown Source)
	at
de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
r.java:75)
	at
de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
457)
	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
	at
de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
ava:46)
	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.net.NoRouteToHostException: No route to host: connect
	at java.net.PlainSocketImpl.socketConnect(Native Method)
	at java.net.PlainSocketImpl.doConnect(Unknown Source)
	at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at java.net.Socket.<init>(Unknown Source)
	at java.net.Socket.<init>(Unknown Source)
	at org.apache.soap.util.net.SocketUtils.createSocket(Unknown Source)
	at org.apache.soap.util.net.HTTPUtils.getSocket(Unknown Source)
	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
	at org.apache.soap.util.net.HTTPUtils.post(Unknown Source)
	at org.apache.soap.transport.http.SOAPHTTPConnection.send(Unknown Source)
	at org.apache.soap.rpc.Call.invoke(Unknown Source)
	at org.apache.soap.rpc.Call.invoke(Unknown Source)
	at
de.mc.etnbestterm.data.SoapCallingDataHolder.callSoaply(SoapCallingDataHolde
r.java:75)
	at
de.mc.etnbestterm.data.MainDataHolder.connectServerToDB(MainDataHolder.java:
457)
	at de.mc.etnbestterm.data.MainDataHolder.<init>(MainDataHolder.java:61)
	at
de.mc.etnbestterm.data.SingletonManager.getMainDataHolder(SingletonManager.j
ava:46)
	at de.mc.etnbestterm.gui.WillkommenPanel.jbInit(WillkommenPanel.java:62)
	at de.mc.etnbestterm.gui.WillkommenPanel.<init>(WillkommenPanel.java:52)
	at de.mc.etnbestterm.gui.MainFrame.<init>(MainFrame.java:40)
	at de.mc.etnbestterm.Bestellterminal.jbInit(Bestellterminal.java:64)
	at de.mc.etnbestterm.Bestellterminal.<init>(Bestellterminal.java:44)
	at de.mc.etnbestterm.Bestellterminal.main(Bestellterminal.java:117)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.sun.javaws.Launcher.executeApplication(Unknown Source)
	at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
	at com.sun.javaws.Launcher.continueLaunch(Unknown Source)
	at com.sun.javaws.Launcher.handleApplicationDesc(Unknown Source)
	at com.sun.javaws.Launcher.handleLaunchFile(Unknown Source)
	at com.sun.javaws.Launcher.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Otherwise the same application works by different customers which also use a
proxy.
Once when a customer changed the proxy-software the application got timeouts
for every soap-call
Can it be, that some proxies have problems with apache-soap in general?
Does it makes a difference for soap using a certian proxy-software in the
network?
what can be wrong?

thanks for any hints in advance

Malte

PS: One of the customers having trouble is unsing AVM Ken as proxy-server




Re: de-serialisation problem

Posted by Scott Nichol <sn...@scottnichol.com>.
Can you tell me the sizes of the 2 war files?

Also, with the xml sniffer, do you see the same version of the XML 
schema namespace for xmlns:xsd="..."?

On 3 Jun 2003 at 11:59, Jonathan Roberts wrote:

> Scott,
> Excellent news - this was defiantely a version issue.  I've just made doubly sure and the version of the soap war files "are different".  
>  
> Interestly the latest version causes this error whereas the older version does not.
>  
> Scott again thanks for all your help and your continual support of this newsgroup.
>  
> Kind Regard
>  
> Jonathan
>  
>  
> 
> Scott Nichol <sn...@scottnichol.com> wrote:
> If the value being serialized is really null and you have the same 
> version of Apache SOAP on the deployment server as the development, I 
> would expect things to work.
> 
> It is true that null values can be deserialized. This should be true 
> for beans you've mapped and ones you have not (ur-type). Given the 
> errors you have, though, it does not seem that a null is really being 
> serialized. For example
> 
> Can't yet deserialize non-null Objects; 
> 
> is an error that comes up only when you have xsi:type="xsd:ur-type" 
> without xsi:null="true" or xsi:nil="true".
> 
> This makes me wonder whether you really have a null value you are 
> returning, and whether you are using the same version of Apache SOAP 
> in deployment (because handling of xsi:null and xsi:nil has been 
> improved along the way).
> 
> On 2 Jun 2003 at 16:03, Jonathan Roberts wrote:
> 
> > Hi Scott,
> > 
> > I have 2 applications using a number of Value Objects. One of these is a Web Service. In the Web Service implementation the Timestamp is in one of the Value Objects however its value is nver set, and always null. On my development server this seems to work fine and seems to deal with it 
> (maybe false comfort). 
> > 
> > This is the same scenario on the deployment Server, however here it seems to fail. It's as if its denomination xsi:null="true", is sufficent to allow it through the soap system, i.e. since it is always null, soap has never attempted to try and deserialize it.
> > 
> > Hope this makes sense.
> > 
> > Jonathan
> > 
> > Scott Nichol wrote:
> > I don't see how it could ever work, unless some version of 
> > java.sql.Timestamp has a default ctor. The following code in 
> > BeanSerializer creates the bean:
> > 
> > private Object instantiateBean(Class javaType)
> > throws IllegalArgumentException
> > {
> > try
> > {
> > return javaType.newInstance();
> > }
> > catch (Throwable t)
> > {
> > throw new IllegalArgumentException("Unable to instantiate '" +
> > 
> > StringUtils.getClassName(javaType) +
> > "': " + t.getMessage());
> > }
> > }
> > 
> > The newInstance is only going to work if the class has a default ctor 
> > (or in Sun's terminology, a "nullary constructor").
> > 
> > On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> > 
> > > HI Scott,
> > > 
> > > I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes. This seems to be fine on my machine but not on a deployment server. Could it be a class problem?
> > > 
> > > Cheers
> > > 
> > > Jonathan
> > > 
> > > Scott Nichol wrote:
> > > java.sql.Timestamp does not have a default constructor, which Apache 
> > > SOAP requires for instantiation. An alternative for you would be to 
> > > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > > de-serialize.
> > > 
> > > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > > 
> > > > Hi.
> > > > 
> > > > I'm getting the following errors on the response from the soap server :
> > > > 
> > > > on the 
> > > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > > call
> > > > where Response r;
> > > > and Call c;
> > > > ---------------------------------------------------------------------------
> > > > 
> > > > Error report : 
> > > > 1. If information exists and is returned :
> > > > 
> > > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > > 
> > > > You chose fetchAccountUsingAccountNo 10015301
> > > > 
> > > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > > 
> > > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > > 
> > > > ----------------------------------------------------------------------------------------------------
> > > > 2. If no information:
> > > > 
> > > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > > 
> > > > Can't yet deserialize non-null Objects; 
> > > > 
> > > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > > > 
> > > > ------------------------------------------
> > > > 
> > > > Isssues : 
> > > > 
> > > > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > > > 
> > > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > > //map the type
> > > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > > //telling the call object to use this mapping
> > > > c.setSOAPMappingRegistry(smr);
> > > > 
> > > > 2. and the xml
> > > > 
> > > > > 
> > > > xmlns:x="urn:xml-IVR-App" 
> > > > 
> > > > qname="x:java.sql.Timestamp"
> > > > 
> > > > javaType="java.sql.Timestamp"
> > > > 
> > > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > > 
> > > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > > 
> > > > />
> > > > 
> > > > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > > > 
> > > > Any help would be appreciated.
> > > > 
> > > > Jonathan
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > 
> > > > ---------------------------------
> > > > Yahoo! Plus - For a better Internet experience
> > > > 
> > > 
> > > 
> > > Scott Nichol
> > > 
> > > Do not reply directly to this e-mail address,
> > > as it is filtered to only receive e-mail from
> > > specific mailing lists.
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: de-serialisation problem

Posted by Jonathan Roberts <j_...@yahoo.co.uk>.
Scott,
Excellent news - this was defiantely a version issue.  I've just made doubly sure and the version of the soap war files "are different".  
 
Interestly the latest version causes this error whereas the older version does not.
 
Scott again thanks for all your help and your continual support of this newsgroup.
 
Kind Regard
 
Jonathan
 
 

Scott Nichol <sn...@scottnichol.com> wrote:
If the value being serialized is really null and you have the same 
version of Apache SOAP on the deployment server as the development, I 
would expect things to work.

It is true that null values can be deserialized. This should be true 
for beans you've mapped and ones you have not (ur-type). Given the 
errors you have, though, it does not seem that a null is really being 
serialized. For example

Can't yet deserialize non-null Objects; 

is an error that comes up only when you have xsi:type="xsd:ur-type" 
without xsi:null="true" or xsi:nil="true".

This makes me wonder whether you really have a null value you are 
returning, and whether you are using the same version of Apache SOAP 
in deployment (because handling of xsi:null and xsi:nil has been 
improved along the way).

On 2 Jun 2003 at 16:03, Jonathan Roberts wrote:

> Hi Scott,
> 
> I have 2 applications using a number of Value Objects. One of these is a Web Service. In the Web Service implementation the Timestamp is in one of the Value Objects however its value is nver set, and always null. On my development server this seems to work fine and seems to deal with it 
(maybe false comfort). 
> 
> This is the same scenario on the deployment Server, however here it seems to fail. It's as if its denomination xsi:null="true", is sufficent to allow it through the soap system, i.e. since it is always null, soap has never attempted to try and deserialize it.
> 
> Hope this makes sense.
> 
> Jonathan
> 
> Scott Nichol wrote:
> I don't see how it could ever work, unless some version of 
> java.sql.Timestamp has a default ctor. The following code in 
> BeanSerializer creates the bean:
> 
> private Object instantiateBean(Class javaType)
> throws IllegalArgumentException
> {
> try
> {
> return javaType.newInstance();
> }
> catch (Throwable t)
> {
> throw new IllegalArgumentException("Unable to instantiate '" +
> 
> StringUtils.getClassName(javaType) +
> "': " + t.getMessage());
> }
> }
> 
> The newInstance is only going to work if the class has a default ctor 
> (or in Sun's terminology, a "nullary constructor").
> 
> On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> 
> > HI Scott,
> > 
> > I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes. This seems to be fine on my machine but not on a deployment server. Could it be a class problem?
> > 
> > Cheers
> > 
> > Jonathan
> > 
> > Scott Nichol wrote:
> > java.sql.Timestamp does not have a default constructor, which Apache 
> > SOAP requires for instantiation. An alternative for you would be to 
> > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > de-serialize.
> > 
> > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > 
> > > Hi.
> > > 
> > > I'm getting the following errors on the response from the soap server :
> > > 
> > > on the 
> > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > call
> > > where Response r;
> > > and Call c;
> > > ---------------------------------------------------------------------------
> > > 
> > > Error report : 
> > > 1. If information exists and is returned :
> > > 
> > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > 
> > > You chose fetchAccountUsingAccountNo 10015301
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > 
> > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > 
> > > ----------------------------------------------------------------------------------------------------
> > > 2. If no information:
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > 
> > > Can't yet deserialize non-null Objects; 
> > > 
> > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > > 
> > > ------------------------------------------
> > > 
> > > Isssues : 
> > > 
> > > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > > 
> > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > //map the type
> > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > //telling the call object to use this mapping
> > > c.setSOAPMappingRegistry(smr);
> > > 
> > > 2. and the xml
> > > 
> > > > 
> > > xmlns:x="urn:xml-IVR-App" 
> > > 
> > > qname="x:java.sql.Timestamp"
> > > 
> > > javaType="java.sql.Timestamp"
> > > 
> > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > />
> > > 
> > > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > > 
> > > Any help would be appreciated.
> > > 
> > > Jonathan
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.





---------------------------------
Yahoo! Plus - For a better Internet experience

Re: de-serialisation problem

Posted by Jonathan Roberts <j_...@yahoo.co.uk>.
Hi Scott,
Thanks for the reply.  This is all very wierd, its possible there is a different version of java running, but only the one version of soap - I will have to take another look at this.
 
I put the xml sniffer on the lines and got the following :
 
1. One thats works :
 <ExtractDate xsi:type="ns1:java.sql.Timestamp" xsi:null="true"/> 

2. One that fails
  <ExtractDate xsi:type="ns1:java.sql.Timestamp" xsi:null="true"/> 

So the same value seems to be returned with each in the XML file.
 
 
>is an error that comes up only when you have xsi:type="xsd:ur-type" 
>without xsi:null="true" or xsi:nil="true".
 
Is this entry in the XML message or the specification of that object in through the soap admin interface.

Thansk again
 
Jonathan


Scott Nichol <sn...@scottnichol.com> wrote:If the value being serialized is really null and you have the same 
version of Apache SOAP on the deployment server as the development, I 
would expect things to work.

It is true that null values can be deserialized. This should be true 
for beans you've mapped and ones you have not (ur-type). Given the 
errors you have, though, it does not seem that a null is really being 
serialized. For example

Can't yet deserialize non-null Objects; 

is an error that comes up only when you have xsi:type="xsd:ur-type" 
without xsi:null="true" or xsi:nil="true".

This makes me wonder whether you really have a null value you are 
returning, and whether you are using the same version of Apache SOAP 
in deployment (because handling of xsi:null and xsi:nil has been 
improved along the way).

On 2 Jun 2003 at 16:03, Jonathan Roberts wrote:

> Hi Scott,
> 
> I have 2 applications using a number of Value Objects. One of these is a Web Service. In the Web Service implementation the Timestamp is in one of the Value Objects however its value is nver set, and always null. On my development server this seems to work fine and seems to deal with it 
(maybe false comfort). 
> 
> This is the same scenario on the deployment Server, however here it seems to fail. It's as if its denomination xsi:null="true", is sufficent to allow it through the soap system, i.e. since it is always null, soap has never attempted to try and deserialize it.
> 
> Hope this makes sense.
> 
> Jonathan
> 
> Scott Nichol wrote:
> I don't see how it could ever work, unless some version of 
> java.sql.Timestamp has a default ctor. The following code in 
> BeanSerializer creates the bean:
> 
> private Object instantiateBean(Class javaType)
> throws IllegalArgumentException
> {
> try
> {
> return javaType.newInstance();
> }
> catch (Throwable t)
> {
> throw new IllegalArgumentException("Unable to instantiate '" +
> 
> StringUtils.getClassName(javaType) +
> "': " + t.getMessage());
> }
> }
> 
> The newInstance is only going to work if the class has a default ctor 
> (or in Sun's terminology, a "nullary constructor").
> 
> On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> 
> > HI Scott,
> > 
> > I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes. This seems to be fine on my machine but not on a deployment server. Could it be a class problem?
> > 
> > Cheers
> > 
> > Jonathan
> > 
> > Scott Nichol wrote:
> > java.sql.Timestamp does not have a default constructor, which Apache 
> > SOAP requires for instantiation. An alternative for you would be to 
> > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > de-serialize.
> > 
> > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > 
> > > Hi.
> > > 
> > > I'm getting the following errors on the response from the soap server :
> > > 
> > > on the 
> > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > call
> > > where Response r;
> > > and Call c;
> > > ---------------------------------------------------------------------------
> > > 
> > > Error report : 
> > > 1. If information exists and is returned :
> > > 
> > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > 
> > > You chose fetchAccountUsingAccountNo 10015301
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > 
> > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > 
> > > ----------------------------------------------------------------------------------------------------
> > > 2. If no information:
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > 
> > > Can't yet deserialize non-null Objects; 
> > > 
> > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > > 
> > > ------------------------------------------
> > > 
> > > Isssues : 
> > > 
> > > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > > 
> > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > //map the type
> > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > //telling the call object to use this mapping
> > > c.setSOAPMappingRegistry(smr);
> > > 
> > > 2. and the xml
> > > 
> > > > 
> > > xmlns:x="urn:xml-IVR-App" 
> > > 
> > > qname="x:java.sql.Timestamp"
> > > 
> > > javaType="java.sql.Timestamp"
> > > 
> > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > />
> > > 
> > > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > > 
> > > Any help would be appreciated.
> > > 
> > > Jonathan
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.






---------------------------------
Yahoo! Plus - For a better Internet experience

Re: de-serialisation problem

Posted by Scott Nichol <sn...@scottnichol.com>.
If the value being serialized is really null and you have the same 
version of Apache SOAP on the deployment server as the development, I 
would expect things to work.

It is true that null values can be deserialized.  This should be true 
for beans you've mapped and ones you have not (ur-type).  Given the 
errors you have, though, it does not seem that a null is really being 
serialized.  For example

	Can't yet deserialize non-null Objects; 

is an error that comes up only when you have xsi:type="xsd:ur-type" 
without xsi:null="true" or xsi:nil="true".

This makes me wonder whether you really have a null value you are 
returning, and whether you are using the same version of Apache SOAP 
in deployment (because handling of xsi:null and xsi:nil has been 
improved along the way).

On 2 Jun 2003 at 16:03, Jonathan Roberts wrote:

> Hi Scott,
>  
> I have 2 applications using a number of Value Objects.  One of these is a Web Service.  In the Web Service implementation the Timestamp is in one of the Value Objects however its value is nver set, and always null.  On my development server this seems to work fine and seems to deal with it 
(maybe false comfort).  
>  
> This is the same scenario on the deployment Server, however here it seems to fail.  It's as if its denomination xsi:null="true", is sufficent to allow it through the soap system, i.e. since it is always null, soap has never attempted to try and deserialize it.
>  
> Hope this makes sense.
>  
> Jonathan
> 
> Scott Nichol <sn...@scottnichol.com> wrote:
> I don't see how it could ever work, unless some version of 
> java.sql.Timestamp has a default ctor. The following code in 
> BeanSerializer creates the bean:
> 
> private Object instantiateBean(Class javaType)
> throws IllegalArgumentException
> {
> try
> {
> return javaType.newInstance();
> }
> catch (Throwable t)
> {
> throw new IllegalArgumentException("Unable to instantiate '" +
> 
> StringUtils.getClassName(javaType) +
> "': " + t.getMessage());
> }
> }
> 
> The newInstance is only going to work if the class has a default ctor 
> (or in Sun's terminology, a "nullary constructor").
> 
> On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> 
> > HI Scott,
> > 
> > I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes. This seems to be fine on my machine but not on a deployment server. Could it be a class problem?
> > 
> > Cheers
> > 
> > Jonathan
> > 
> > Scott Nichol wrote:
> > java.sql.Timestamp does not have a default constructor, which Apache 
> > SOAP requires for instantiation. An alternative for you would be to 
> > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > de-serialize.
> > 
> > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > 
> > > Hi.
> > > 
> > > I'm getting the following errors on the response from the soap server :
> > > 
> > > on the 
> > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > call
> > > where Response r;
> > > and Call c;
> > > ---------------------------------------------------------------------------
> > > 
> > > Error report : 
> > > 1. If information exists and is returned :
> > > 
> > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > 
> > > You chose fetchAccountUsingAccountNo 10015301
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > 
> > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > 
> > > ----------------------------------------------------------------------------------------------------
> > > 2. If no information:
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > 
> > > Can't yet deserialize non-null Objects; 
> > > 
> > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > > 
> > > ------------------------------------------
> > > 
> > > Isssues : 
> > > 
> > > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > > 
> > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > //map the type
> > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > //telling the call object to use this mapping
> > > c.setSOAPMappingRegistry(smr);
> > > 
> > > 2. and the xml
> > > 
> > > > 
> > > xmlns:x="urn:xml-IVR-App" 
> > > 
> > > qname="x:java.sql.Timestamp"
> > > 
> > > javaType="java.sql.Timestamp"
> > > 
> > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > />
> > > 
> > > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > > 
> > > Any help would be appreciated.
> > > 
> > > Jonathan
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: de-serialisation problem

Posted by Jonathan Roberts <j_...@yahoo.co.uk>.
Hi Scott,
 
No.  Bizarrely, only get the standard ones:
    public java.sql.Timestamp(int,int,int,int,int,int,int);
    public java.sql.Timestamp(long);
 
Hmmm.  I wonder if the issue I raised earlier is the case,  as long as it is defined it is valid as long as you never pass a timestamp through.  It only causes a problem then since it has no default constructor!
 
Jonathan

Scott Nichol <sn...@scottnichol.com> wrote:
If your code is working on a test set-up, I wonder whether the JDBC 
provider has implemented java.sql.Timestamp incorrectly. If you just 
run javap java.sql.Timestamp, you should not see a default ctor 
listed. If you do, you've got a funky implementation.

On 2 Jun 2003 at 10:44, Scott Nichol wrote:

> I don't see how it could ever work, unless some version of 
> java.sql.Timestamp has a default ctor. The following code in 
> BeanSerializer creates the bean:
> 
> private Object instantiateBean(Class javaType)
> throws IllegalArgumentException
> {
> try
> {
> return javaType.newInstance();
> }
> catch (Throwable t)
> {
> throw new IllegalArgumentException("Unable to instantiate '" +
> 
> StringUtils.getClassName(javaType) +
> "': " + t.getMessage());
> }
> }
> 
> The newInstance is only going to work if the class has a default ctor 
> (or in Sun's terminology, a "nullary constructor").
> 
> On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> 
> > HI Scott,
> > 
> > I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes. This seems to be fine on my machine but not on a deployment server. Could it be a class problem?
> > 
> > Cheers
> > 
> > Jonathan
> > 
> > Scott Nichol wrote:
> > java.sql.Timestamp does not have a default constructor, which Apache 
> > SOAP requires for instantiation. An alternative for you would be to 
> > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > de-serialize.
> > 
> > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > 
> > > Hi.
> > > 
> > > I'm getting the following errors on the response from the soap server :
> > > 
> > > on the 
> > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > call
> > > where Response r;
> > > and Call c;
> > > ---------------------------------------------------------------------------
> > > 
> > > Error report : 
> > > 1. If information exists and is returned :
> > > 
> > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > 
> > > You chose fetchAccountUsingAccountNo 10015301
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > 
> > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > 
> > > ----------------------------------------------------------------------------------------------------
> > > 2. If no information:
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > 
> > > Can't yet deserialize non-null Objects; 
> > > 
> > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > > 
> > > ------------------------------------------
> > > 
> > > Isssues : 
> > > 
> > > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > > 
> > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > //map the type
> > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > //telling the call object to use this mapping
> > > c.setSOAPMappingRegistry(smr);
> > > 
> > > 2. and the xml
> > > 
> > > > 
> > > xmlns:x="urn:xml-IVR-App" 
> > > 
> > > qname="x:java.sql.Timestamp"
> > > 
> > > javaType="java.sql.Timestamp"
> > > 
> > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > />
> > > 
> > > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > > 
> > > Any help would be appreciated.
> > > 
> > > Jonathan
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.





---------------------------------
Yahoo! Plus - For a better Internet experience

Re: de-serialisation problem

Posted by Scott Nichol <sn...@scottnichol.com>.
If your code is working on a test set-up, I wonder whether the JDBC 
provider has implemented java.sql.Timestamp incorrectly.  If you just 
run javap java.sql.Timestamp, you should not see a default ctor 
listed.  If you do, you've got a funky implementation.

On 2 Jun 2003 at 10:44, Scott Nichol wrote:

> I don't see how it could ever work, unless some version of 
> java.sql.Timestamp has a default ctor.  The following code in 
> BeanSerializer creates the bean:
> 
>   private Object instantiateBean(Class javaType)
>     throws IllegalArgumentException
>   {
>     try
>     {
>       return javaType.newInstance();
>     }
>     catch (Throwable t)
>     {
>       throw new IllegalArgumentException("Unable to instantiate '" +
>                                          
> StringUtils.getClassName(javaType) +
>                                          "': " + t.getMessage());
>     }
>   }
> 
> The newInstance is only going to work if the class has a default ctor 
> (or in Sun's terminology, a "nullary constructor").
> 
> On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:
> 
> > HI Scott,
> >  
> > I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes.  This seems to be fine on my machine but not on a deployment server.   Could it be a class problem?
> >  
> > Cheers
> >  
> > Jonathan
> > 
> > Scott Nichol <sn...@scottnichol.com> wrote:
> > java.sql.Timestamp does not have a default constructor, which Apache 
> > SOAP requires for instantiation. An alternative for you would be to 
> > return a java.util.Date, which Apache SOAP knows how to serialize and 
> > de-serialize.
> > 
> > On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> > 
> > > Hi.
> > > 
> > > I'm getting the following errors on the response from the soap server :
> > > 
> > > on the 
> > > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > > call
> > > where Response r;
> > > and Call c;
> > > ---------------------------------------------------------------------------
> > > 
> > > Error report : 
> > > 1. If information exists and is returned :
> > > 
> > > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > > 
> > > You chose fetchAccountUsingAccountNo 10015301
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > > 
> > > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > > 
> > > ----------------------------------------------------------------------------------------------------
> > > 2. If no information:
> > > 
> > > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > > 
> > > Can't yet deserialize non-null Objects; 
> > > 
> > > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > > 
> > > ------------------------------------------
> > > 
> > > Isssues : 
> > > 
> > > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > > 
> > > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > > //map the type
> > > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > > //telling the call object to use this mapping
> > > c.setSOAPMappingRegistry(smr);
> > > 
> > > 2. and the xml
> > > 
> > > > 
> > > xmlns:x="urn:xml-IVR-App" 
> > > 
> > > qname="x:java.sql.Timestamp"
> > > 
> > > javaType="java.sql.Timestamp"
> > > 
> > > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > > 
> > > />
> > > 
> > > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > > 
> > > Any help would be appreciated.
> > > 
> > > Jonathan
> > > 
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ---------------------------------
> > > Yahoo! Plus - For a better Internet experience
> > > 
> > 
> > 
> > Scott Nichol
> > 
> > Do not reply directly to this e-mail address,
> > as it is filtered to only receive e-mail from
> > specific mailing lists.
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: de-serialisation problem

Posted by Jonathan Roberts <j_...@yahoo.co.uk>.
Hi Scott,
 
I have 2 applications using a number of Value Objects.  One of these is a Web Service.  In the Web Service implementation the Timestamp is in one of the Value Objects however its value is nver set, and always null.  On my development server this seems to work fine and seems to deal with it (maybe false comfort).  
 
This is the same scenario on the deployment Server, however here it seems to fail.  It's as if its denomination xsi:null="true", is sufficent to allow it through the soap system, i.e. since it is always null, soap has never attempted to try and deserialize it.
 
Hope this makes sense.
 
Jonathan

Scott Nichol <sn...@scottnichol.com> wrote:
I don't see how it could ever work, unless some version of 
java.sql.Timestamp has a default ctor. The following code in 
BeanSerializer creates the bean:

private Object instantiateBean(Class javaType)
throws IllegalArgumentException
{
try
{
return javaType.newInstance();
}
catch (Throwable t)
{
throw new IllegalArgumentException("Unable to instantiate '" +

StringUtils.getClassName(javaType) +
"': " + t.getMessage());
}
}

The newInstance is only going to work if the class has a default ctor 
(or in Sun's terminology, a "nullary constructor").

On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:

> HI Scott,
> 
> I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes. This seems to be fine on my machine but not on a deployment server. Could it be a class problem?
> 
> Cheers
> 
> Jonathan
> 
> Scott Nichol wrote:
> java.sql.Timestamp does not have a default constructor, which Apache 
> SOAP requires for instantiation. An alternative for you would be to 
> return a java.util.Date, which Apache SOAP knows how to serialize and 
> de-serialize.
> 
> On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> 
> > Hi.
> > 
> > I'm getting the following errors on the response from the soap server :
> > 
> > on the 
> > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > call
> > where Response r;
> > and Call c;
> > ---------------------------------------------------------------------------
> > 
> > Error report : 
> > 1. If information exists and is returned :
> > 
> > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > 
> > You chose fetchAccountUsingAccountNo 10015301
> > 
> > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > 
> > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > 
> > ----------------------------------------------------------------------------------------------------
> > 2. If no information:
> > 
> > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > 
> > Can't yet deserialize non-null Objects; 
> > 
> > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > 
> > ------------------------------------------
> > 
> > Isssues : 
> > 
> > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > 
> > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > //map the type
> > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > //telling the call object to use this mapping
> > c.setSOAPMappingRegistry(smr);
> > 
> > 2. and the xml
> > 
> > > 
> > xmlns:x="urn:xml-IVR-App" 
> > 
> > qname="x:java.sql.Timestamp"
> > 
> > javaType="java.sql.Timestamp"
> > 
> > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > 
> > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > 
> > />
> > 
> > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > 
> > Any help would be appreciated.
> > 
> > Jonathan
> > 
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.





---------------------------------
Yahoo! Plus - For a better Internet experience

Re: de-serialisation problem

Posted by Scott Nichol <sn...@scottnichol.com>.
I don't see how it could ever work, unless some version of 
java.sql.Timestamp has a default ctor.  The following code in 
BeanSerializer creates the bean:

  private Object instantiateBean(Class javaType)
    throws IllegalArgumentException
  {
    try
    {
      return javaType.newInstance();
    }
    catch (Throwable t)
    {
      throw new IllegalArgumentException("Unable to instantiate '" +
                                         
StringUtils.getClassName(javaType) +
                                         "': " + t.getMessage());
    }
  }

The newInstance is only going to work if the class has a default ctor 
(or in Sun's terminology, a "nullary constructor").

On 2 Jun 2003 at 15:14, Jonathan Roberts wrote:

> HI Scott,
>  
> I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes.  This seems to be fine on my machine but not on a deployment server.   Could it be a class problem?
>  
> Cheers
>  
> Jonathan
> 
> Scott Nichol <sn...@scottnichol.com> wrote:
> java.sql.Timestamp does not have a default constructor, which Apache 
> SOAP requires for instantiation. An alternative for you would be to 
> return a java.util.Date, which Apache SOAP knows how to serialize and 
> de-serialize.
> 
> On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:
> 
> > Hi.
> > 
> > I'm getting the following errors on the response from the soap server :
> > 
> > on the 
> > r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> > call
> > where Response r;
> > and Call c;
> > ---------------------------------------------------------------------------
> > 
> > Error report : 
> > 1. If information exists and is returned :
> > 
> > Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> > 
> > You chose fetchAccountUsingAccountNo 10015301
> > 
> > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> > 
> > gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> > 
> > ----------------------------------------------------------------------------------------------------
> > 2. If no information:
> > 
> > Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> > 
> > Can't yet deserialize non-null Objects; 
> > 
> > targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> > 
> > ------------------------------------------
> > 
> > Isssues : 
> > 
> > 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> > 
> > QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> > //map the type
> > smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> > //telling the call object to use this mapping
> > c.setSOAPMappingRegistry(smr);
> > 
> > 2. and the xml
> > 
> > > 
> > xmlns:x="urn:xml-IVR-App" 
> > 
> > qname="x:java.sql.Timestamp"
> > 
> > javaType="java.sql.Timestamp"
> > 
> > java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > 
> > xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> > 
> > />
> > 
> > 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> > 
> > Any help would be appreciated.
> > 
> > Jonathan
> > 
> > 
> > 
> > 
> > 
> > 
> > ---------------------------------
> > Yahoo! Plus - For a better Internet experience
> > 
> 
> 
> Scott Nichol
> 
> Do not reply directly to this e-mail address,
> as it is filtered to only receive e-mail from
> specific mailing lists.
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.



Re: de-serialisation problem

Posted by Jonathan Roberts <j_...@yahoo.co.uk>.
HI Scott,
 
I thought I'd got around this by declaring the java.sql.Timestamp as a class in the xml file and loaded it with all the other classes.  This seems to be fine on my machine but not on a deployment server.   Could it be a class problem?
 
Cheers
 
Jonathan

Scott Nichol <sn...@scottnichol.com> wrote:
java.sql.Timestamp does not have a default constructor, which Apache 
SOAP requires for instantiation. An alternative for you would be to 
return a java.util.Date, which Apache SOAP knows how to serialize and 
de-serialize.

On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:

> Hi.
> 
> I'm getting the following errors on the response from the soap server :
> 
> on the 
> r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> call
> where Response r;
> and Call c;
> ---------------------------------------------------------------------------
> 
> Error report : 
> 1. If information exists and is returned :
> 
> Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> 
> You chose fetchAccountUsingAccountNo 10015301
> 
> Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> 
> gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> 
> ----------------------------------------------------------------------------------------------------
> 2. If no information:
> 
> Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> 
> Can't yet deserialize non-null Objects; 
> 
> targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> 
> ------------------------------------------
> 
> Isssues : 
> 
> 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> 
> QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
> //map the type
> smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
> //telling the call object to use this mapping
> c.setSOAPMappingRegistry(smr);
> 
> 2. and the xml
> 
> > 
> xmlns:x="urn:xml-IVR-App" 
> 
> qname="x:java.sql.Timestamp"
> 
> javaType="java.sql.Timestamp"
> 
> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> 
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> 
> />
> 
> 3. Wierder - this works on the development machine but not on the stand-alone Test Server.
> 
> Any help would be appreciated.
> 
> Jonathan
> 
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.





---------------------------------
Yahoo! Plus - For a better Internet experience

Re: de-serialisation problem

Posted by Scott Nichol <sn...@scottnichol.com>.
java.sql.Timestamp does not have a default constructor, which Apache 
SOAP requires for instantiation.  An alternative for you would be to 
return a java.util.Date, which Apache SOAP knows how to serialize and 
de-serialize.

On 2 Jun 2003 at 10:54, Jonathan Roberts wrote:

> Hi.
>  
> I'm getting the following errors on the response from the soap server :
>  
> on the 
> r = c.invoke ( new URL( mstrHostString + "/soap/servlet/rpcrouter"), "" );
> call
> where Response r;
> and Call c;
> ---------------------------------------------------------------------------
>  
> Error report : 
> 1. If information exists and is returned :
> 
> Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp
> 
> You chose fetchAccountUsingAccountNo 10015301
> 
> Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp; targetException=java.lang.IllegalAr
> 
> gumentException: Unable to instantiate 'java.sql.Timestamp': java.sql.Timestamp].
> 
> ----------------------------------------------------------------------------------------------------
> 2.  If no information:
> 
> Exception = [SOAPException: faultCode=SOAP-ENV:Client; msg=
> 
> Can't yet deserialize non-null Objects; 
> 
> targetException=java.lang.IllegalArgumentException: Can't yet deserialize non-null Objects]
> 
> ------------------------------------------
> 
> Isssues : 
> 
> 1. I'm aware of problems with the timestamp and have set it up in the client side thus have named it explicitly :
> 
>   QName qn9 = new QName("urn:xml-IVR-App", "java.sql.Timestamp");
>   //map the type
>   smr.mapTypes(Constants.NS_URI_SOAP_ENC, qn9, java.sql.Timestamp.class, bsr, bsr);
>   //telling the call object to use this mapping
>   c.setSOAPMappingRegistry(smr);
> 
> 2. and the xml
> 
> <isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
> 
> xmlns:x="urn:xml-IVR-App" 
> 
> qname="x:java.sql.Timestamp"
> 
> javaType="java.sql.Timestamp"
> 
> java2XMLClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> 
> xml2JavaClassName="org.apache.soap.encoding.soapenc.BeanSerializer"
> 
> />
> 
> 3.  Wierder  - this works on the development machine but not on the stand-alone Test Server.
> 
> Any help would be appreciated.
> 
> Jonathan
> 
> 
> 
> 
> 
> 
> ---------------------------------
> Yahoo! Plus - For a better Internet experience
> 


Scott Nichol

Do not reply directly to this e-mail address,
as it is filtered to only receive e-mail from
specific mailing lists.