Thanks for the note David,

Yes, I can look at this.  Please open a WSCOMMONS JIRA and supply the test
method.
Assign the JIRA to me.


Rich Scheuerle
IBM Web Services
Apache Axis2 ([EMAIL PROTECTED])
512-838-5115  (IBM TL 678-5115)

"David Illsley" <[EMAIL PROTECTED]> wrote on 11/09/2007 05:42:32 AM:

> Hi Rich,
> I've just tried to get the CustomBuilder stuff working for SOAP
> Headers and I've run into a problem I'm hoping you can help with. I've
> reduced it to a simplified testcase which could be added to the
> CustomBuilderTest class.
>
> The test method is:
>
>     public void testHeaderCustomBuilder() throws Exception{
>        XMLStreamReader parser =
>             XMLInputFactory.newInstance().createXMLStreamReader(new
> FileReader(getTestResourceFile(TestConstants.SOAP_SOAPMESSAGE)));
>         StAXSOAPModelBuilder builder = new StAXSOAPModelBuilder(parser,
null);
>         builder.registerCustomBuilder(new
> QName("http://schemas.xmlsoap.org/ws/2004/03/addressing","To";), 3, new
> ByteArrayCustomBuilder("utf-8"));
>         SOAPEnvelope sourceEnv = (SOAPEnvelope)
builder.getDocumentElement();
>         SOAPHeader header = sourceEnv.getHeader();
>         ArrayList al =
> header.getHeaderBlocksWithNSURI("http://schemas.xmlsoap.
> org/ws/2004/03/addressing");
>         for(int i=0;i<al.size();i++){
>            SOAPHeaderBlock shb = (SOAPHeaderBlock)al.get(i);
>            if("To".equals(shb.getLocalName())){
>               assertNotNull(shb.getDataSource());
>            }
>         }
>     }
>
>
> The error is:
> org.apache.axiom.om.OMException: java.lang.IllegalStateException:
> Current state not START_ELEMENT
>    at org.apache.axiom.om.impl.builder.StAXOMBuilder.
> next(StAXOMBuilder.java:241)
>    at org.apache.axiom.om.impl.llom.OMElementImpl.
> buildNext(OMElementImpl.java:583)
>    at org.apache.axiom.om.impl.llom.OMNodeImpl.
> getNextOMSibling(OMNodeImpl.java:135)
>    at org.apache.axiom.soap.impl.llom.SOAPHeaderImpl.
> getHeaderBlocksWithNSURI(SOAPHeaderImpl.java:363)
>    at org.apache.axiom.om.impl.builder.CustomBuilderTest.
> testHeaderCustomBuilder(CustomBuilderTest.java:134)
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at sun.reflect.NativeMethodAccessorImpl.
> invoke(NativeMethodAccessorImpl.java:64)
>    at sun.reflect.DelegatingMethodAccessorImpl.
> invoke(DelegatingMethodAccessorImpl.java:43)
>    at java.lang.reflect.Method.invoke(Method.java:615)
>    at junit.framework.TestCase.runTest(TestCase.java:164)
>    at junit.framework.TestCase.runBare(TestCase.java:130)
>    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:120)
>    at junit.framework.TestSuite.runTest(TestSuite.java:230)
>    at junit.framework.TestSuite.run(TestSuite.java:225)
>    at org.eclipse.jdt.internal.junit.runner.junit3.
> JUnit3TestReference.run(JUnit3TestReference.java:128)
>    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: java.lang.IllegalStateException: Current state not
START_ELEMENT
>    at com.ctc.wstx.sr.BasicStreamReader.
> getAttributeCount(BasicStreamReader.java:591)
>    at org.apache.axiom.om.impl.builder.StAXBuilder.
> processAttributes(StAXBuilder.java:194)
>    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.
> constructNode(StAXSOAPModelBuilder.java:350)
>    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.
> createOMElement(StAXSOAPModelBuilder.java:208)
>    at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.
> createNextOMElement(StAXSOAPModelBuilder.java:190)
>    at org.apache.axiom.om.impl.builder.StAXOMBuilder.
> next(StAXOMBuilder.java:164)
>    ... 22 more
>
> Any help would be appreciated.
> Thanks,
> David
>
> --
> David Illsley - IBM Web Services Development
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>

Reply via email to