[ http://issues.apache.org/jira/browse/AXIS2-1380?page=comments#action_12443375 ] Robert Luo commented on AXIS2-1380: -----------------------------------
Feature request: Can we add the proxy setting in code generation? During the code generating input screen, it will be nice to have an option to allow user to set proxy info and then generate the code needed as part of the process. Thanks, Robert Luo > Error calling a service thru proxy > ---------------------------------- > > Key: AXIS2-1380 > URL: http://issues.apache.org/jira/browse/AXIS2-1380 > Project: Apache Axis 2.0 (Axis2) > Issue Type: Bug > Components: transports > Affects Versions: 1.0 > Environment: Axis2.0 version 1.0 on Windows XP > Reporter: Robert Luo > Priority: Critical > > I used the Eclipse Plug-in Wizard to generate the client code to a public web > servcie. I ran into problem trying to call the service. I am doing this > behind our company proxy and I have modified the generated stub code as > follow (I am using the adb binding). I ahev tried using: > System.getProperties().setProperty() and > _serviceClient.getOptions().setProperty(HTTPConstants.PROXY, proxyProperties); > public MyServiceWSStub( > org.apache.axis2.context.ConfigurationContext configurationContext, > java.lang.String targetEndpoint) throws java.lang.Exception { > //To populate AxisService > populateAxisService(); > populateFaults(); > _serviceClient = new > org.apache.axis2.client.ServiceClient(configurationContext, > _service); > _serviceClient.getOptions().setTo(new > org.apache.axis2.addressing.EndpointReference( > targetEndpoint)); > // added the following lines. > System.getProperties().setProperty("http.proxySet", "true"); > System.getProperties().setProperty("http.proxyUser", "uid"); > System.getProperties().setProperty("http.proxyPassword", "password"); > > System.getProperties().setProperty("http.proxyHost","proxy.server.name"); > System.getProperties().setProperty("http.proxyPort","80"); > > HttpTransportProperties.ProxyProperties proxyProperties > = new HttpTransportProperties().new ProxyProperties(); > proxyProperties.setProxyName("proxy.server.name"); > proxyProperties.setProxyPort(80); > proxyProperties.setUserName("uid"); > proxyProperties.setPassWord("password"); > _serviceClient.getOptions().setProperty( > HTTPConstants.PROXY, proxyProperties); > } > However, no matter what I did. I got the following error: > The first time I called, I will get: > org.apache.axis2.AxisFault: problem accessing the parser. Parser already > accessed!; nested exception is: > javax.xml.stream.XMLStreamException: problem accessing the parser. > Parser already accessed!; nested exception is: > org.apache.axis2.AxisFault: problem accessing the parser. Parser > already accessed!; nested exception is: > javax.xml.stream.XMLStreamException: problem accessing the parser. > Parser already accessed!; nested exception is: > org.apache.axis2.AxisFault: problem accessing the parser. Parser > already accessed!; nested exception is: > javax.xml.stream.XMLStreamException: problem accessing the parser. > Parser already accessed!; nested exception is: > org.apache.axis2.AxisFault: problem accessing the parser. Parser > already accessed!; nested exception is: > javax.xml.stream.XMLStreamException: problem accessing the parser. > Parser already accessed! > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:223) > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589) > at > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:328) > at > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:279) > at > cag.conagrafoods.foodservicews.FoodServiceWSStub.getSalesRepsByZipCode(FoodServiceWSStub.java:408) > at com.conagrafoods.mdm.ws.Test.main(Test.java:24) > Caused by: org.apache.axis2.AxisFault: problem accessing the parser. Parser > already accessed!; nested exception is: > javax.xml.stream.XMLStreamException: problem accessing the parser. > Parser already accessed!; nested exception is: > org.apache.axis2.AxisFault: problem accessing the parser. Parser > already accessed!; nested exception is: > javax.xml.stream.XMLStreamException: problem accessing the parser. > Parser already accessed! > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:305) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:207) > ... 5 more > If I try again, sometime I will get: > org.apache.axis2.AxisFault: Connection reset; nested exception is: > java.net.SocketException: Connection reset; nested exception is: > org.apache.axis2.AxisFault: Connection reset; nested exception is: > java.net.SocketException: Connection reset > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:223) > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:589) > at > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:328) > at > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:279) > at > cag.conagrafoods.foodservicews.FoodServiceWSStub.getSalesRepsByZipCode(FoodServiceWSStub.java:408) > at com.conagrafoods.mdm.ws.Test.main(Test.java:24) > Caused by: org.apache.axis2.AxisFault: Connection reset; nested exception is: > java.net.SocketException: Connection reset > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:305) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:207) > ... 5 more > Caused by: java.net.SocketException: Connection reset > at java.net.SocketInputStream.read(SocketInputStream.java:168) > at java.io.BufferedInputStream.fill(BufferedInputStream.java:183) > at java.io.BufferedInputStream.read(BufferedInputStream.java:201) > at > org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:77) > at > org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:105) > at > org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1115) > at > org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1832) > at > org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1590) > at > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:995) > at > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:397) > at > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) > at > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:346) > at > org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:530) > at > org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:92) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:299) > ... 6 more > What am I missing here? -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]