[ https://issues.apache.org/jira/browse/AXIS2-1820?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
zhuwei updated AXIS2-1820: -------------------------- Attachment: WebServiceLocator.java Hi I use the NTLM authentication. seems this bug exist. The invoking code I used is : stub = new PrincipalManagementStub(serviceURL); // for NTLM Authentication logger.debug(">>begin NTLM Authentication"); Options options = new Options(); options.setTo(new EndpointReference(serviceURL)); HttpTransportProperties.Authenticator auth = new HttpTransportProperties.Authenticator(); auth.setUsername("mstvuser"); auth.setPassword("mstvuser"); auth.setHost("localhost"); auth.setPort(90); auth.setAllowedRetry(true); auth.setPreemptiveAuthentication(true); auth.setDomain("domain"); List schemas = new ArrayList(1); schemas.add(auth.NTLM); auth.setAuthSchemes(schemas); options.setProperty(HTTPConstants.AUTHENTICATE, auth); logger.debug("options is " + options); stub._getServiceClient().setOptions(options); the exception log is : org.apache.axis2.AxisFault: problem accessing the parser. Parser already accessed! at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417) at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:72) at org.apache.axis2.transport.http.AxisRequestEntity.writeRequest(AxisRequestEntity.java:84) at org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:495) at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973) at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993) 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:520) at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:191) at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:327) at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:206) at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396) at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:374) at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:211) at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163) at com.hp.mstv.client.PrincipalManagementStub.CreateAccount(PrincipalManagementStub.java:1409) at com.hp.usb.IDO.service.ServiceLocatorTest.testgetMSTVPrincipalManagementStub(ServiceLocatorTest.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:585) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:130) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196) Caused by: javax.xml.stream.XMLStreamException: problem accessing the parser. Parser already accessed! at org.apache.axiom.om.impl.llom.OMStAXWrapper.next(OMStAXWrapper.java:906) at org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeNode(StreamingOMSerializer.java:72) at org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serialize(StreamingOMSerializer.java:57) at org.apache.axiom.om.impl.util.OMSerializerUtil.serializeByPullStream(OMSerializerUtil.java:525) at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:789) at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:814) at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.serializeInternally(SOAPEnvelopeImpl.java:237) at org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:225) at org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:814) at org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:421) at org.apache.axis2.transport.http.SOAPMessageFormatter.writeTo(SOAPMessageFormatter.java:68) ... 35 more thanks > javax.xml.stream.XMLStreamException: problem accessing the parser when using > NTLM and stubs generated by xmlbeans > ----------------------------------------------------------------------------------------------------------------- > > Key: AXIS2-1820 > URL: https://issues.apache.org/jira/browse/AXIS2-1820 > Project: Axis 2.0 (Axis2) > Issue Type: Bug > Affects Versions: 1.1 > Environment: jdk 1.5.0_8. Windows xp servicepack 2 > Reporter: Tor Jonsson > Assignee: Deepal Jayasinghe > Priority: Critical > Attachments: SendPageClient.java, WebServiceLocator.java > > > When generating a java client with xmlbeans NTLM authentication breaks: > WSDL (Test.wsdl): > <?xml version="1.0" encoding="UTF-8"?> > <wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" > xmlns:tns="http://www.example.org/Test/" > xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" > xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Test" > targetNamespace="http://www.example.org/Test/"> > <wsdl:types> > <xsd:schema targetNamespace="http://www.example.org/Test/"> > <xsd:element name="NewOperation"> > <xsd:complexType> > <xsd:sequence> > <xsd:element name="in" type="xsd:string"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > <xsd:element name="NewOperationResponse"> > <xsd:complexType> > <xsd:sequence> > <xsd:element name="out" type="xsd:string"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > </xsd:schema> > </wsdl:types> > <wsdl:message name="NewOperationRequest"> > <wsdl:part element="tns:NewOperation" name="parameters"/> > </wsdl:message> > <wsdl:message name="NewOperationResponse"> > <wsdl:part element="tns:NewOperationResponse" name="parameters"/> > </wsdl:message> > <wsdl:portType name="Test"> > <wsdl:operation name="NewOperation"> > <wsdl:input message="tns:NewOperationRequest"/> > <wsdl:output message="tns:NewOperationResponse"/> > </wsdl:operation> > </wsdl:portType> > <wsdl:binding name="TestSOAP" type="tns:Test"> > <soap:binding style="document" > transport="http://schemas.xmlsoap.org/soap/http"/> > <wsdl:operation name="NewOperation"> > <soap:operation soapAction="http://www.example.org/Test/NewOperation"/> > <wsdl:input> > <soap:body use="literal"/> > </wsdl:input> > <wsdl:output> > <soap:body use="literal"/> > </wsdl:output> > </wsdl:operation> > </wsdl:binding> > <wsdl:service name="Test"> > <wsdl:port binding="tns:TestSOAP" name="TestSOAP"> > <soap:address location="http://www.host.com/Services.asmx"/> > </wsdl:port> > </wsdl:service> > </wsdl:definitions> > Command to generate Java cllient stubs: > wsdl2java -uri Test.wsdl -d xmlbeans > ClientTest.java > package com.volvo.ums.test; > import java.rmi.RemoteException; > import java.util.ArrayList; > import java.util.List; > import org.apache.axis2.client.Options; > import org.apache.axis2.transport.http.HTTPConstants; > import org.apache.axis2.transport.http.HttpTransportProperties; > import org.example.www.test.NewOperationDocument; > import org.example.www.test.NewOperationResponseDocument; > import org.example.www.test.TestStub; > import org.example.www.test.NewOperationDocument.NewOperation; > public class ClientTest { > public static void main(String[] args) { > ClientTest cli = new ClientTest(); > > try { > cli.doTest(); > } catch (RemoteException e) { > e.printStackTrace(); > } > } > public void doTest( )throws RemoteException > { > TestStub stub = new TestStub( > "http://www.host.com/Services.asmx" ); > Options opts = stub._getServiceClient().getOptions(); > HttpTransportProperties.Authenticator auth = > getAuthProperties(); > opts.setProperty(HTTPConstants.AUTHENTICATE, auth ); > NewOperationDocument doc = > NewOperationDocument.Factory.newInstance(); > NewOperation operation = doc.addNewNewOperation(); > operation.setIn( "Hello" ); > NewOperationResponseDocument resp = stub.NewOperation( doc ); > } > /** > * generates the properties needed for NTLM authentication > * > */ > public HttpTransportProperties.Authenticator getAuthProperties() > { > HttpTransportProperties.Authenticator auth = new > HttpTransportProperties.Authenticator(); > List<String> l = new ArrayList<String>(); > l.add( HttpTransportProperties.Authenticator.NTLM ); > auth.setAuthSchemes(l); > auth.setUsername( "username" ); > auth.setPassword("password"); > auth.setDomain( "domain" ); > auth.setHost( "www.host.com" ); > auth.setPort( 80 ); > return auth; > } > } > StackTrace: > 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:225) > at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:670) > at > org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:365) > at > org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOperation.java:295) > at org.example.www.test.TestStub.NewOperation(TestStub.java:141) > at com.volvo.ums.test.ClientTest.doTest(ClientTest.java:86) > at com.volvo.ums.test.ClientTest.main(ClientTest.java:28) > 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:340) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:205) > ... 6 more > 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! > at > org.apache.axis2.transport.http.SOAPOverHTTPSender$AxisSOAPRequestEntity.writeRequest(SOAPOverHTTPSender.java:246) > at > org.apache.commons.httpclient.methods.EntityEnclosingMethod.writeRequestBody(EntityEnclosingMethod.java:495) > at > org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:1973) > at > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:993) > 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:534) > at > org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPSender.java:119) > at > org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:334) > ... 7 more > Caused by: javax.xml.stream.XMLStreamException: problem accessing the parser. > Parser already accessed! > at > org.apache.axiom.om.impl.llom.OMStAXWrapper.next(OMStAXWrapper.java:897) > at > org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serializeNode(StreamingOMSerializer.java:74) > at > org.apache.axiom.om.impl.serialize.StreamingOMSerializer.serialize(StreamingOMSerializer.java:59) > at > org.apache.axiom.om.impl.util.OMSerializerUtil.serializeByPullStream(OMSerializerUtil.java:469) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:812) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:837) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerialize(OMElementImpl.java:808) > at > org.apache.axiom.soap.impl.llom.SOAPEnvelopeImpl.internalSerialize(SOAPEnvelopeImpl.java:177) > at > org.apache.axiom.om.impl.llom.OMElementImpl.internalSerializeAndConsume(OMElementImpl.java:837) > at > org.apache.axiom.om.impl.llom.OMNodeImpl.serializeAndConsume(OMNodeImpl.java:411) > at > org.apache.axis2.transport.http.SOAPOverHTTPSender$AxisSOAPRequestEntity.handleOMOutput(SOAPOverHTTPSender.java:190) > at > org.apache.axis2.transport.http.SOAPOverHTTPSender$AxisSOAPRequestEntity.writeRequest(SOAPOverHTTPSender.java:232) > ... 17 more -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]