Please check whether the response you get is as given in the wsdl. check whether the namesapce and element names are mapped correctly.
use tcpmon[1] to see the response comes back. thanks, Amila. [1] http://ws.apache.org/commons/tcpmon/ On Sun, Jul 20, 2008 at 8:06 PM, Zhang Qian <[EMAIL PROTECTED]> wrote: > Hi, > > I want to use my client to call a method provided by my web service, > but this error occures: > org.apache.axis2.AxisFault: org.apache.axis2.databinding.ADBException: > Unexpected subelement FindServiceResponse > at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430) > at > org.apache.axis2.wslclient.WebServiceLocatorServiceStub.fromOM(WebServiceLocatorServiceStub.java) > at > org.apache.axis2.wslclient.WebServiceLocatorServiceStub.FindService(WebServiceLocatorServiceStub.java:489) > at org.apache.axis2.wslclient.Client.doFindService(Client.java:24) > at org.apache.axis2.wslclient.Client.main(Client.java:11) > Caused by: java.lang.Exception: > org.apache.axis2.databinding.ADBException: Unexpected subelement > FindServiceResponse > at > org.apache.axis2.wslclient.WebServiceLocatorServiceStub$FindServiceResponse$Factory.parse(WebServiceLocatorServiceStub.java:27930) > ... 4 more > Caused by: org.apache.axis2.databinding.ADBException: Unexpected > subelement FindServiceResponse > at > org.apache.axis2.wslclient.WebServiceLocatorServiceStub$FindServiceResponse$Factory.parse(WebServiceLocatorServiceStub.java:27916) > ... 4 more > > It seems the element FindServiceResponse has some problems, here is > its definition in my wsdl file: > <xsd:element name="FindServiceResponse"> > <xsd:complexType> > <xsd:sequence> > <xsd:element name="InstanceLocation" type="xsd:string"/> > </xsd:sequence> > </xsd:complexType> > </xsd:element> > > My client code(Client.java): > package org.apache.axis2.wslclient; > > import > org.apache.axis2.wslclient.WebServiceLocatorServiceStub.FindServiceRequest; > import > org.apache.axis2.wslclient.WebServiceLocatorServiceStub.FindServiceResponse; > > public class Client { > > public static void main(java.lang.String args[]) { > try { > WebServiceLocatorServiceStub stub = new > WebServiceLocatorServiceStub("http://qzhang:9090/wsgservicec"); > doFindService(stub); > } catch(Exception e){ > e.printStackTrace(); > System.out.println("\n\n\n"); > } > } > > /* Do FindService*/ > public static void doFindService(WebServiceLocatorServiceStub stub) { > try { > FindServiceRequest req = new FindServiceRequest(); > req.setServiceName("qzhang_service"); > > FindServiceResponse res = stub.FindService(req, null); > System.out.println(res.getInstanceLocation()); > } catch(Exception e){ > e.printStackTrace(); > System.out.println("\n\n\n"); > } > } > } > > Could anyone help me out? Thanks in advance! > > > Regards, > Qian > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- Amila Suriarachchi, WSO2 Inc.
