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 ni...@wipro.com on 2004/06/16 13:42:23 UTC

problem connecting to webservice through proxy

Hi All,
 
I am trying to connect to the MapPoint WebService through proxy. My program is throwing the given exception. Can anyone let me know how to set Proxy, Portname, Userid and  Password while using axis.
 
{http://xml.apache.org/axis/}stackTrace: java.net.ProtocolException: Server redirected too many times (20)

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)

at java.net.URLConnection.getContentType(Unknown Source)

at SimpleHTTPSender.readFromConnection(SimpleHTTPSender.java:100)

at SimpleHTTPSender.invoke(SimpleHTTPSender.java:66)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)

at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)

at org.apache.axis.client.Call.invokeEngine(Call.java:2626)

at org.apache.axis.client.Call.invoke(Call.java:2615)

at org.apache.axis.client.Call.invoke(Call.java:2279)

at org.apache.axis.client.Call.invoke(Call.java:2198)

at org.apache.axis.client.Call.invoke(Call.java:1695)

at net.mappoint.s.mappoint_30.FindServiceSoapStub.findAddress(FindServiceSoapStub.java:1110)

at MapPointClientBP.getAddressMatches(MapPointClientBP.java:525)

at MapPointClientBP.main(MapPointClientBP.java:94)

 

java.net.ProtocolException: Server redirected too many times (20)

java.net.ProtocolException: Server redirected too many times (20)

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)

at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)

at java.net.URLConnection.getContentType(Unknown Source)

at SimpleHTTPSender.readFromConnection(SimpleHTTPSender.java:100)

at SimpleHTTPSender.invoke(SimpleHTTPSender.java:66)

at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:71)

at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:150)

at org.apache.axis.SimpleChain.invoke(SimpleChain.java:120)

at org.apache.axis.client.AxisClient.invoke(AxisClient.java:180)

at org.apache.axis.client.Call.invokeEngine(Call.java:2626)

at org.apache.axis.client.Call.invoke(Call.java:2615)

at org.apache.axis.client.Call.invoke(Call.java:2279)

at org.apache.axis.client.Call.invoke(Call.java:2198)

at org.apache.axis.client.Call.invoke(Call.java:1695)

at net.mappoint.s.mappoint_30.FindServiceSoapStub.findAddress(FindServiceSoapStub.java:1110)

at MapPointClientBP.getAddressMatches(MapPointClientBP.java:525)

at MapPointClientBP.main(MapPointClientBP.java:94)

java.lang.RuntimeException: ; nested exception is: 

java.net.ProtocolException: Server redirected too many times (20)

at MapPointClientBP.getAddressMatches(MapPointClientBP.java:541)

at MapPointClientBP.main(MapPointClientBP.java:94)

 

Cheers,

Nishit

	-----Original Message----- 
	From: Banck, Arent-Jan [mailto:ajbanck@informatica.com] 
	Sent: Wed 6/16/2004 4:14 PM 
	To: axis-user@ws.apache.org 
	Cc: 
	Subject: How to add types to Axis 1.2 deployment descriptor?
	
	
	How do I add classes to the deploment / type section of the generated WSDL?
	With Java2WSDL I can specify --extraClasses to add a class name, but I can't find how to add classes using the WSDD description. The classes are in the wsdd as beanmappings, but Axis 1.2 seems to remove them anyway.
	 
	Situation: Two data-objects, one extends the other. One result that has an array of the base class. Method returns an the result type that contains an array with type of the base class, but elements of the array are the derived objects:
	 
	public class BaseObject  {}
	public class DerivedObject extends BaseObject implements java.io.Serializable {}
	public class SearchResult implements java.io.Serializable {
	
	public class SearchResult implements java.io.Serializable {
	    private ArrayList foundObjects;
	    public SearchResult() {        foundObjects = new ArrayList();    }
	    public BaseObject[] getFoundObjects() {        return (BaseObject[]) foundObjects.toArray(new BaseObject[0]);    }
	    public void setFoundObjects(BaseObject[] aBaseObject) {        foundObjects = new ArrayList(Arrays.asList(aBaseObject));    }
	    public void addFoundObject(BaseObject aBaseObject) {        foundObjects.add(aBaseObject);    }
	}
	 
	 
	public class SearchObjects  {
	  public SearchResult search() {
	    SearchResult result = new SearchResult();
	    result.addFoundObject(new DerivedObject () );
	    return result;
	  }
	}
	 
	When reading the generated wsdl through the service (services/myservice?wsdl) only BaseObject/ArrayOfBaseObject and SearchResult are in the types section. In Axis 1.1 all defined mappings are included, so also BaseObject
	 
	When using the method, I get an SAXException: Invalid element on the properties of the derived object.
	 
	In WSDD:
	 
	  <beanMapping qname="ipa:SearchResult" xmlns:ipa="http://common.services"
	               languageSpecificType="java:SearchResult"/>
	  <beanMapping qname="ipa:BaseObject" xmlns:ipa="http://common.services"
	               languageSpecificType="BaseObject"/>
	  <beanMapping qname="ipa:DerivedObject" xmlns:ipa="http://common.services <http://common.services.api4.ias.informatica.com> "
	               languageSpecificType="DerivedObject"/>