You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by "Pasca, Romulus" <ro...@bankofamerica.com> on 2004/05/27 20:34:56 UTC

java.lang.IllegalStateException: can't declare any more prefixes in this context

Hi guys, 
I am getting this error(on the client side) when I am trying to access a web
service. Also
I got this error if I am tring to see the wsdl of my web services from the
web browser

Any clues?
Romulus

-----Original Message-----
From: Ashish Varan [mailto:ashish_varan@NextLinx.com]
Sent: Thursday, May 27, 2004 1:02 PM
To: axis-user@ws.apache.org
Subject: RE: RE: RE: Passing user-defined objects between Java server
(Apache AXIS) and a C# (:Net) Client


Nitesh,

No idea about .Net, and C#. I depend 100% on Java for my food :)

This might help you.

http://www.error-bank.com/microsoft.public.dotnet.framework.webservices/
5372_Thread.aspx

Ashish


-----Original Message-----
From: NITESH GUPTA [mailto:nitesh.gupta@epfl.ch] 
Sent: Thursday, May 27, 2004 11:58 AM
To: axis-user@ws.apache.org
Subject: Re: RE: RE: Passing user-defined objects between Java server
(Apache AXIS) and a C# (:Net) Client


Hi Asish,

Thanks for the help once again. I would definately try doing it this
way. But in the meanwhile I tried writing the interface and the classes
and using the Java2WSDL and WSDL2Java tools. I deployed the web service
using the deploy.wsdd that was generated using Java2WSDL. 

But when I called this webservice with the C# client it gave the
following error :

InvalidOperationException
Server foung request content type to be 'text/html;charset=ISO-8859-1?,
butexpected 'text/xml'.

The same client was working absolutely fine (with simple objects like
int, string and array of strings) when I deployed the class asa a .jws.

Any idea what might be wrong?

Thanks,
Nitesh

----- Original Message -----
From: Ashish Varan <as...@NextLinx.com>
Date: Wednesday, May 26, 2004 9:46 pm
Subject: RE: RE: Passing user-defined objects between Java server
(Apache AXIS) and a C# (:Net) Client

> With this you can pass alomost anything you want ( all axis 
> datatypes -
> key value in hashtable ) and don't need to do any more R & D.
> If you add a handler key ( a class that handles the request and 
> returnshashtable ( server side ) , you may write 1000 web service 
> call in 7
> days !!!
> ( w/o writing any additional line in framework )
> Try a string key and vector having string values etc.
> 
> Client Call
> ________________________________________________
> Object[] params = new Object[2];
> params[0] = new RPCParam("parms", your hashtable instance);
> params[1] = new RPCParam("parms2","anyOtherParam");
> 
> //you can add as many params you want 
> 
> Service service = new Service();
> Call call = (Call) service.createCall();
> call.setTargetEndpointAddress(new java.net.URL("your url"));
> HashMap h = (HashMap) call.invoke("myservice", params );
> 
> return new Hashtable(h);
> 
> Server Side
> ________________________________________________
> class MyServiceProvider{
> public static Hashtable myservice(Hashtable h, String anyOtherParam){
> 
> //you get your hashtable here after the call
> //process the request and return hashtable
> 
> //optional  get the HTTP Request if you want to get other params 
> as well
> MessageContext mc = MessageContext.getCurrentContext();
> ServletContext sc =
> ((HttpServlet) mc.getProperty(HTTPConstants.MC_HTTP_SERVLET))
> .getServletContext();
> //get the attributes of the request object that will be used to
> HttpServletRequest request =
> (HttpServletRequest) mc.getProperty(
> HTTPConstants.MC_HTTP_SERVLETREQUEST);
> 
>  retyrn hashtable;
> }
> }
> _________________________________________________
> Axis server condig.wsdd file
> 
> <service name="MyServiceProvider" provider="java:RPC">
>  <parameter name="allowedMethods" value="myservice"/>
>  <parameter name="className" value="mypackage.MyServiceProvider"/>
> </service>
> 
> HTH
> Ashish
> Senior Software Enginner ( NextLinx Corp )
> 
> 
> 
> -----Original Message-----
> From: NITESH GUPTA [nitesh.gupta@epfl.ch] 
> Sent: Wednesday, May 26, 2004 11:30 AM
> To: axis-user@ws.apache.org
> Subject: Re: RE: Passing user-defined objects between Java server
> (Apache AXIS) and a C# (:Net) Client
> 
> 
> Hi Ashish,
> 
> Thanks for the mail. Since I'm new to this sort of stuff its a bit 
> hardfor me to figure out how to do it with hash tables and 
> vectors. It would
> be great if you could givem some directions about this or an 
> example. 
> 
> Thanks a lot for the help,
> 
> Nitesh
> 
> ----- Original Message -----
> From: Ashish Varan <as...@NextLinx.com>
> Date: Wednesday, May 26, 2004 5:15 pm
> Subject: RE: Passing user-defined objects between Java server (Apache
> AXIS) and a C# (:Net) Client
> 
> > Why don't u put all this in Hashtable. A few lines of code can pass
> > anthing. Vector is suppored, so you can pass vector of all supported
> > datatypes.
> > 
> > 
> > -----Original Message-----
> > From: NITESH GUPTA [nitesh.gupta@epfl.ch] 
> > Sent: Tuesday, May 25, 2004 11:06 AM
> > To: axis-user@ws.apache.org
> > Subject: Passing user-defined objects between Java server 
> (Apache 
> > AXIS)and a C# (:Net) Client
> > 
> > 
> > Hi,
> > 
> > I'm new to SOAP and AXIS and want some help. 
> > 
> > I am trying to implement a simple hello world type of example on 
> a PDA
> > which has a C# .Net webservice client and  a java server on 
> Apache 
> > AXISserver running on some machine.  
> > 
> > Till now I have been able to pass objects like int, strings and 
> arrays> of strings but am not able to figure out how to pass user-
> defined> objects. 
> > 
> > I have deployed the server in form of a .jws using Tomcat server
> > 
> > this is what the server side code looks like: 
> > 
> > public class HelloServer
> > {
> > 	public String sayHelloTo(String name)
> > 	{
> >          System.out.println("sayHelloTo(String name)");
> >          return "Hello " + name + ", How are you doing?";      
> > 	}
> > 
> > 	public String sayHelloTo(String[] names)
> > 	{
> >        	String reply = "";
> >        	for(int i = 0; i < names.length; i++)
> >        	{
> >                	System.out.println("sayHelloTo(String name)");
> >                	reply += "Hello " + names[i] + ", How are you
> > doing? \n";
> >        	}
> >        	return reply;
> > 	}
> > 
> > 	public int add(int num1, int num2)
> > 	{
> >        	return num1 + num2;
> > 	}
> > }	
> > 
> > I want to pass a user-defined object  . some thing like :
> > 
> > public class HelloUser {
> > 	int userID;
> > 	String userName;
> > 	String[] userAdd; 
> > }
> > 
> > If someone can guide me about how to do this, the help would be 
> really> appriciated.
> > 
> > Thanks,
> > Nitesh
> > 
> > 
> 
>