[ http://issues.apache.org/jira/browse/AXIS2-853?page=all ]

Ajith Harshana Ranabahu resolved AXIS2-853.
-------------------------------------------

    Resolution: Invalid

Actually there is nothing wrong with the generated code except a simple 
omission in the client code :)
 The client code should have the following lines before the invocation

...
        foodDescription.setFatGrams(6);
        foodDescription.setFiberGrams(1);
        
        CalculatePointsDocument.CalculatePoints calcP =          
CalculatePointsDocument.CalculatePoints.Factory.newInstance();
        calcP.setParam0(foodDescription);

        calculatePointsDocument.setCalculatePoints(calcP);
....

If you don't set the new objects then the pullparser off the XMLBeans object 
will hit an exception!

> When invoking an operation on the stub, an java.lang.IllegalStateException is 
> thrown
> ------------------------------------------------------------------------------------
>
>                 Key: AXIS2-853
>                 URL: http://issues.apache.org/jira/browse/AXIS2-853
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>    Affects Versions: 1.0
>         Environment: Windows 2000, Eclipse 3.1.2, and Tomcat 5.5, and Axis2 
> Std 1.0 daily build for 23 June 2006
>            Reporter: James Bender
>         Assigned To: Ajith Harshana Ranabahu
>         Attachments: CalculatePointsDocument.java, PointsCalculatorStub.java, 
> WWPointsCalculator.wsdl
>
>
> Upon invoking an operation on the generated stub, and IllegalStateException 
> is thrown:
> Points Calculation, firing...
> Caught Throwable exception in runPointsCalculator: 
> org.apache.axiom.om.OMException: java.lang.Illega
> lStateExceptionorg.apache.axiom.om.OMException: 
> java.lang.IllegalStateException
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:206)
>       at 
> org.apache.axiom.om.impl.llom.OMDocumentImpl.getOMDocumentElement(OMDocumentImpl.java:144)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.getDocumentElement(StAXOMBuilder.java:322)
>       at 
> testexamples.types.PointsCalculatorStub.toOM(PointsCalculatorStub.java:213)
>       at 
> testexamples.types.PointsCalculatorStub.toEnvelope(PointsCalculatorStub.java:230)
>       at 
> testexamples.types.PointsCalculatorStub.calculatePoints(PointsCalculatorStub.java:105)
>       at 
> com.recursionsw.ve.tools.webservices.TestWebServicesEndToEndTestNG.runPointsCalculator(TestWebSe
> rvicesEndToEndTestNG.java:299)
>       at 
> com.recursionsw.ve.tools.webservices.TestWebServicesEndToEndTestNG.testGeneratorEndToEnd(TestWeb
> ServicesEndToEndTestNG.java:155)
>       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>       at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
>       at java.lang.reflect.Method.invoke(Unknown Source)
>       at org.testng.internal.MethodHelper.invokeMethod(MethodHelper.java:536)
>       at org.testng.internal.Invoker.invokeMethod(Invoker.java:395)
>       at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:672)
>       at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:92)
>       at org.testng.TestRunner.privateRun(TestRunner.java:624)
>       at org.testng.TestRunner.run(TestRunner.java:515)
>       at org.testng.SuiteRunner.privateRun(SuiteRunner.java:221)
>       at org.testng.SuiteRunner.run(SuiteRunner.java:147)
>       at org.testng.eclipse.runner.RemoteTestNG.run(RemoteTestNG.java:98)
>       at org.testng.eclipse.runner.RemoteTestNG.main(RemoteTestNG.java:138)
> Caused by: java.lang.IllegalStateException
>       at 
> org.apache.xmlbeans.impl.store.Jsr173$XMLStreamReaderForString.next(Jsr173.java:1110)
>       at 
> org.apache.xmlbeans.impl.store.Jsr173$SyncedJsr173.next(Jsr173.java:1138)
>       at org.apache.axis2.util.StreamWrapper.next(StreamWrapper.java:68)
>       at 
> org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:123)
>       ... 21 more
> This is the code where the operation is invoked:
>                       System.out.println("Points Calculation, firing...");
>                       PointsCalculatorStub stub = new 
> PointsCalculatorStub(null,
>                                       
> "http://localhost:8090/axis2/services/PointsCalculator";);
>             CalculatePointsDocument calculatePointsDocument = 
> CalculatePointsDocument.Factory
>                                       .newInstance();
>             FoodDescription foodDescription = 
> FoodDescription.Factory.newInstance();
>             foodDescription.setCalories(130);
>             foodDescription.setFatGrams(6);
>             foodDescription.setFiberGrams(1);
>  
>          CalculatePointsResponseDocument returnTranslationDocument = 
> stub.calculatePoints(calculatePointsDocument);
>          CalculatePointsResponse responseString = 
> returnTranslationDocument.getCalculatePointsResponse();
>          System.out.println("Client returned");
>          System.out.println("PointsCalculator: "+responseString);
>          System.out.println("PointsCalculation completed!!!");

-- 
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]

Reply via email to