Hi All,

I crated a service with security and called via RPC call, I got below
error. Without security, it's working fine. Is anyone know what's the
problem for it. Also there is nothing happen on server for this error.


Thanks,
Glen

Unexpected error: WSDoAllReceiver: Error in converting to Document;
nested exception is: 
        org.apache.ws.security.WSSecurityException: Error in converting
SOAP Envelope to Document; nested exception is: 
        org.apache.axiom.om.OMException:
java.lang.IllegalStateException: Current state not START_ELEMENT
org.apache.axis2.AxisFault: WSDoAllReceiver: Error in converting to
Document; nested exception is: 
        org.apache.ws.security.WSSecurityException: Error in converting
SOAP Envelope to Document; nested exception is: 
        org.apache.axiom.om.OMException:
java.lang.IllegalStateException: Current state not START_ELEMENT
        at
org.apache.axis2.security.WSDoAllReceiver.processMessage(WSDoAllReceiver
.java:130)
        at
org.apache.axis2.security.handler.WSDoAllHandler.invoke(WSDoAllHandler.j
ava:82)
        at org.apache.axis2.engine.Phase.invoke(Phase.java:381)
        at
org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:473)
        at
org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:445)
        at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:355)
        at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisO
peration.java:279)
        at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:457
)
        at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:399
)
        at
org.apache.axis2.rpc.client.RPCServiceClient.invokeBlocking(RPCServiceCl
ient.java:60)
        at
com.hp.quix.service.SecureClientTest.main(SecureClientTest.java:99)
Caused by: org.apache.ws.security.WSSecurityException: Error in
converting SOAP Envelope to Document; nested exception is: 
        org.apache.axiom.om.OMException:
java.lang.IllegalStateException: Current state not START_ELEMENT
        at
org.apache.axis2.security.util.Axis2Util.getDocumentFromSOAPEnvelope(Axi
s2Util.java:126)
        at
org.apache.axis2.security.WSDoAllReceiver.processMessage(WSDoAllReceiver
.java:128)
        ... 10 more
Caused by: org.apache.axiom.om.OMException:
java.lang.IllegalStateException: Current state not START_ELEMENT
        at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:2
06)
        at
org.apache.axiom.om.impl.llom.OMNodeImpl.build(OMNodeImpl.java:298)
        at
org.apache.axis2.security.util.Axis2Util.getDocumentFromSOAPEnvelope(Axi
s2Util.java:90)
        ... 11 more
Caused by: java.lang.IllegalStateException: Current state not
START_ELEMENT
        at
com.ctc.wstx.sr.BasicStreamReader.getAttributeCount(BasicStreamReader.ja
va:559)
        at
org.apache.axiom.om.impl.builder.StAXBuilder.processAttributes(StAXBuild
er.java:141)
        at
org.apache.axiom.om.impl.mtom.MTOMStAXSOAPModelBuilder.createOMElement(M
TOMStAXSOAPModelBuilder.java:142)
        at
org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:1
32)
        ... 13 more

The cleint code is like below
package com.hp.quix.service;


        import java.util.*;

        import org.apache.axiom.om.OMElement;
        
        import org.apache.axis2.Constants;
        
        import org.apache.axis2.addressing.EndpointReference;

        import org.apache.axis2.client.Options;
        
        import org.apache.axis2.context.ConfigurationContext;
        import org.apache.axis2.context.ConfigurationContextFactory;
        
        import org.apache.axis2.rpc.client.RPCServiceClient;

import javax.xml.namespace.QName;

        public class SecureClientTest {

                public static void main(String[] argso) { 
                    
                         //Begin
                         try {
                                 //URL
                         EndpointReference targetEPR =
                     new
EndpointReference("http://ccequ01.cce.hp.com:8081/QXService/services/Sub
mit");
                        
                         //Operation (function)
                         QName operationName = new
QName("http://service.quix.hp.com/xsd";, "Submit", "req");
                                            
                         //Initial Call
                         Options options = new Options();
                     options.setTo(targetEPR);
        
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
        
options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
                     
                     String repo = "client_repo";
                      //ConfigurationContext configContext =
                                //
ConfigurationContextFactory.createConfigurationContextFromFileSystem(nul
l, null);
                     ConfigurationContext configContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(rep
o,"client_repo/conf/axis2.xml");
                    
                      RPCServiceClient sender = new
RPCServiceClient(configContext, null); 
                      sender.setOptions(options);
                     
                        //Initial input data
                        SubmitData submitdata = new SubmitData();
                        
                        submitdata.setTableId("1007");
                        submitdata.setProjectId("1182");
                        submitdata.setNote("Quix Submit Note \n Note
Content ...... ");
                        
                        ArrayList fds =  new ArrayList();
                        FieldData fd1 = new FieldData();
                        fd1.setFieldName("ISSUETYPE");
                        fd1.setFieldValue("9630");
                        fds.add(fd1);
                        FieldData fd2 = new FieldData();
                        fd2.setFieldName("SEVERITY");
                        fd2.setFieldValue("9476");
                        fds.add(fd2);
                        FieldData fd3 = new FieldData();
                        fd3.setFieldName("REQUESTER_SEVERITY");
                        fd3.setFieldValue("9512");
                        fds.add(fd3);                                   
                        FieldData fd4 = new FieldData();
                        fd4.setFieldName("SERVICE_LEVEL");
                        fd4.setFieldValue("9308");
                        fds.add(fd4);                                   
                        FieldData fd5 = new FieldData();
                        fd5.setFieldName("CASE_MANAGEMENT_LEVEL");
                        fd5.setFieldValue("10307");
                        fds.add(fd5);                                   
                        FieldData fd6 = new FieldData();
                        fd6.setFieldName("TITLE");
                        fd6.setFieldValue("Axis 2 Test");
                        fds.add(fd6);
                        FieldData fd7 = new FieldData();
                        fd7.setFieldName("DESCRIPTION");
                        fd7.setFieldValue("Test from Remote Call via
AXIS2");
                        fds.add(fd7);                   
                        FieldData fd8 = new FieldData();
                        fd8.setFieldName("CUSTOMER_ISSUE_TYPE");
                        fd8.setFieldValue("9830");
                        fds.add(fd8);                   
                        FieldData fd9 = new FieldData();
                        fd9.setFieldName("CUSTOMER_COMPANY");
                        fd9.setFieldValue("Glen Test");
                        fds.add(fd9);                   
                       
                        submitdata.setFieldData(fds);
                             
                        ArrayList args = new ArrayList();
                        args.add(submitdata);
                       //Call Service
                        
                        OMElement result=
sender.invokeBlocking(operationName, args.toArray());
                       //Output result
                        System.out.println(result);
                        
                        } catch (Exception e) {
                                System.out.println("Unexpected error: "
+ e.getMessage() );
                                e.printStackTrace(System.out);
                        }

                    
                    }
        }



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to