You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Swapna Gupta <sg...@concord-usa.com> on 2005/05/04 18:46:13 UTC

SAXException SimpleDeserializer

Hi,

I am very new to Axis, SOAP etc. I am constructing a client to consume a
webservice  (Amazon webservice). The server on which the client is to
run, provides me with access to Axis 1.0, and I have no control over
making them use higher versions of Axis. 

 

Using the WSDL available at:
http://webservices.amazon.com/AWSECommerceService/US/AWSECommerceService
.wsdl

And the WSDL2Java from Axis 1.0 I generated the stub classes.

 

 

 

I am getting following error when the client code tries to consume the
service:

 

 

 

org.xml.sax.SAXException: SimpleDeserializer encountered a child
element, which is NOT expected, in something it was trying to
deserialize.

            at
org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeser
ializer.java:188)

            at
org.apache.axis.encoding.DeserializationContextImpl.startElement(Deseria
lizationContextImpl.java:893)

            at
org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:
200)

            at
org.apache.axis.message.MessageElement.publishToHandler(MessageElement.j
ava:684)

            at
org.apache.axis.message.RPCElement.deserialize(RPCElement.java:241)

            at
org.apache.axis.message.RPCElement.getParams(RPCElement.java:265)

            at org.apache.axis.client.Call.invoke(Call.java:1871)

            at org.apache.axis.client.Call.invoke(Call.java:1777)

            at org.apache.axis.client.Call.invoke(Call.java:1315)

            at
com.amazon.xml.AWSECommerceService.AWSECommerceServiceBindingStub.itemLo
okup(AWSECommerceServiceBindingStub.java:1322)

            at
net.concordusa.bridge.amazon.WebCTAmazon.getItem(WebCTAmazon.java:119)

            at
net.concordusa.bridge.amazon.WebCTAmazon.getDisplay(WebCTAmazon.java:65)

            at
net.concordusa.bridge.amazon.WebCTAmazon.getHTML(WebCTAmazon.java:55)

            at
com.masterfileapi.bridge.webct.vista.powerlink.amazon.authentication.Web
CTAmazonAuthentication.commit(WebCTAmazonAuthentication.java:41)

            at
com.webct.platform.coreservice.security.authentication.module.ProxyAuthe
nticationModule.commit(ProxyAuthenticationModule.java:182)

            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)

            at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
a:39)

            at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
Impl.java:25)

            at java.lang.reflect.Method.invoke(Method.java:324)

            at
javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)

            at
javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)

            at
javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)

            at java.security.AccessController.doPrivileged(Native
Method)

            at
javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:60
7)

            at
javax.security.auth.login.LoginContext.login(LoginContext.java:535)

            at
com.webct.platform.coreservice.security.authentication.common.VistaAgent
.authenticate(VistaAgent.java:118)

            at
com.webct.platform.coreservice.security.authentication.common.VistaAuthe
nticationManager.getAgent(VistaAuthenticationManager.java:226)

            at
com.webct.platform.coreservice.security.authentication.common.Authentica
tionHandler.handleRequest(AuthenticationHandler.java:155)

            at
com.webct.platform.tools.proxytool.actions.PTLaunchAction.perform(PTLaun
chAction.java:203)

            at org.apache.struts.action.Action.execute(Action.java:420)

            at
org.apache.struts.action.RequestProcessor.processActionPerform(RequestPr
ocessor.java:484)

            at
com.webct.platform.coreservice.action.RequestProcessor.process(RequestPr
ocessor.java:194)

            at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)

            at
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)

            at
javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

            at
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

            at
weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(Se
rvletStubImpl.java:971)

            at
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.
java:402)

            at
weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)

            at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27)

            at
com.webct.platform.coreservice.action.CacheControlFilter.doFilter(CacheC
ontrolFilter.java:68)

            at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27)

            at
com.webct.platform.coreservice.action.RequestCleanupFilter.doFilter(Requ
estCleanupFilter.java:96)

            at
weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:
27)

            at
weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.r
un(WebAppServletContext.java:6363)

            at
weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSu
bject.java:317)

            at
weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118
)

            at
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServl
etContext.java:3635)

            at
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.
java:2585)

            at
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)

            at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)

 

 

 

My client side code from WebCTAmazon.java:

 

 

 

private ItemType3[] getItem(String isbn) throws Exception {

     

             AWSECommerceService service = new
AWSECommerceServiceLocator();

             AWSECommerceServicePortType port =
service.getAWSECommerceServicePort();

 

             ItemLookupRequest request = new ItemLookupRequest();

             request.setResponseGroup(RESPONSE_GROUPS);

             request.setItemId(new String[]{isbn});

             request.setIdType(idType);

 

             ItemLookup itemLookup = new ItemLookup();

             itemLookup.setSubscriptionId(subscriptionId);

             itemLookup.setAssociateTag(associateId);

            try {  itemLookup.setRequest(new
ItemLookupRequest[]{request}); } catch(Exception e){}

            ItemLookupResponse     response = null;

             response = port.itemLookup(itemLookup);            

             ItemType3 items [] = response.getItems()[0].getItem();

             Errors errors =
response.getItems()[0].getRequest().getErrors();

             if (errors != null)

             throw new Exception(errors.getError()[0].getMessage());

             return items;

     }

 

 

The error causing line, i.e., line 119 is

response = port.itemLookup(itemLookup);

 

 

 

 

Please Help!!!

 

Thanks in advance,

Swapna

 

 

 


Re: SAXException SimpleDeserializer

Posted by Anne Thomas Manes <at...@gmail.com>.
If you're forced to use Axis 1.0, then I think you will have to use
the message API and construct the messages manually. Axis 1.0 doesn't
support this type of complex document/literal service.

Anne

On 5/4/05, Swapna Gupta <sg...@concord-usa.com> wrote:
>  
>  
> 
> Hi, 
> 
> I am very new to Axis, SOAP etc. I am constructing a client to consume a
> webservice  (Amazon webservice). The server on which the client is to run,
> provides me with access to Axis 1.0, and I have no control over making them
> use higher versions of Axis. 
> 
>   
> 
> Using the WSDL available at:
> http://webservices.amazon.com/AWSECommerceService/US/AWSECommerceService.wsdl
> 
> And the WSDL2Java from Axis 1.0 I generated the stub classes. 
> 
>   
> 
>   
> 
>   
> 
> I am getting following error when the client code tries to consume the
> service: 
> 
>   
> 
>   
> 
>   
> 
> org.xml.sax.SAXException: SimpleDeserializer encountered a child element,
> which is NOT expected, in something it was trying to deserialize. 
> 
>             at
> org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:188)
> 
>             at
> org.apache.axis.encoding.DeserializationContextImpl.startElement(DeserializationContextImpl.java:893)
> 
>             at
> org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:200)
> 
>             at
> org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:684)
> 
>             at
> org.apache.axis.message.RPCElement.deserialize(RPCElement.java:241)
> 
>             at
> org.apache.axis.message.RPCElement.getParams(RPCElement.java:265)
> 
>             at
> org.apache.axis.client.Call.invoke(Call.java:1871) 
> 
>             at
> org.apache.axis.client.Call.invoke(Call.java:1777) 
> 
>             at
> org.apache.axis.client.Call.invoke(Call.java:1315) 
> 
>             at
> com.amazon.xml.AWSECommerceService.AWSECommerceServiceBindingStub.itemLookup(AWSECommerceServiceBindingStub.java:1322)
> 
>             at
> net.concordusa.bridge.amazon.WebCTAmazon.getItem(WebCTAmazon.java:119)
> 
>             at
> net.concordusa.bridge.amazon.WebCTAmazon.getDisplay(WebCTAmazon.java:65)
> 
>             at
> net.concordusa.bridge.amazon.WebCTAmazon.getHTML(WebCTAmazon.java:55)
> 
>             at
> com.masterfileapi.bridge.webct.vista.powerlink.amazon.authentication.WebCTAmazonAuthentication.commit(WebCTAmazonAuthentication.java:41)
> 
>             at
> com.webct.platform.coreservice.security.authentication.module.ProxyAuthenticationModule.commit(ProxyAuthenticationModule.java:182)
> 
>             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:324) 
> 
>             at
> javax.security.auth.login.LoginContext.invoke(LoginContext.java:675)
> 
>             at
> javax.security.auth.login.LoginContext.access$000(LoginContext.java:129)
> 
>             at
> javax.security.auth.login.LoginContext$4.run(LoginContext.java:610)
> 
>             at
> java.security.AccessController.doPrivileged(Native Method) 
> 
>             at
> javax.security.auth.login.LoginContext.invokeModule(LoginContext.java:607)
> 
>             at
> javax.security.auth.login.LoginContext.login(LoginContext.java:535)
> 
>             at
> com.webct.platform.coreservice.security.authentication.common.VistaAgent.authenticate(VistaAgent.java:118)
> 
>             at
> com.webct.platform.coreservice.security.authentication.common.VistaAuthenticationManager.getAgent(VistaAuthenticationManager.java:226)
> 
>             at
> com.webct.platform.coreservice.security.authentication.common.AuthenticationHandler.handleRequest(AuthenticationHandler.java:155)
> 
>             at
> com.webct.platform.tools.proxytool.actions.PTLaunchAction.perform(PTLaunchAction.java:203)
> 
>             at
> org.apache.struts.action.Action.execute(Action.java:420) 
> 
>             at
> org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
> 
>             at
> com.webct.platform.coreservice.action.RequestProcessor.process(RequestProcessor.java:194)
> 
>             at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
> 
>             at
> org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
> 
>             at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
> 
>             at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> 
>             at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:971)
> 
>             at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:402)
> 
>             at
> weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:28)
> 
>             at
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
> 
>             at
> com.webct.platform.coreservice.action.CacheControlFilter.doFilter(CacheControlFilter.java:68)
> 
>             at
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
> 
>             at
> com.webct.platform.coreservice.action.RequestCleanupFilter.doFilter(RequestCleanupFilter.java:96)
> 
>             at
> weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:27)
> 
>             at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6363)
> 
>             at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)
> 
>             at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)
> 
>             at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3635)
> 
>             at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2585)
> 
>             at
> weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
> 
>             at
> weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) 
> 
>   
> 
>   
> 
>   
> 
> My client side code from WebCTAmazon.java: 
> 
>   
> 
>   
> 
>   
> 
> private ItemType3[] getItem(String isbn) throws Exception { 
> 
>      
> 
>              AWSECommerceService service = new AWSECommerceServiceLocator();
> 
>              AWSECommerceServicePortType port =
> service.getAWSECommerceServicePort(); 
> 
>   
> 
>              ItemLookupRequest request = new ItemLookupRequest(); 
> 
>              request.setResponseGroup(RESPONSE_GROUPS); 
> 
>              request.setItemId(new String[]{isbn}); 
> 
>              request.setIdType(idType); 
> 
>   
> 
>              ItemLookup itemLookup = new ItemLookup(); 
> 
>              itemLookup.setSubscriptionId(subscriptionId); 
> 
>              itemLookup.setAssociateTag(associateId); 
> 
>             try {  itemLookup.setRequest(new ItemLookupRequest[]{request});
> } catch(Exception e){} 
> 
>             ItemLookupResponse     response = null; 
> 
>              response = port.itemLookup(itemLookup);            
> 
>              ItemType3 items [] = response.getItems()[0].getItem(); 
> 
>              Errors errors =
> response.getItems()[0].getRequest().getErrors(); 
> 
>              if (errors != null) 
> 
>              throw new Exception(errors.getError()[0].getMessage()); 
> 
>              return items; 
> 
>      } 
> 
>   
> 
>   
> 
> The error causing line, i.e., line 119 is 
> 
> response = port.itemLookup(itemLookup); 
> 
>   
> 
>   
> 
>   
> 
>   
> 
> Please Help!!! 
> 
>   
> 
> Thanks in advance, 
> 
> Swapna 
> 
>   
> 
>   
> 
>