I suggest you do the following.
 
** MAKE SURE THE HELPER CLASSES YOU ARE USING ALL HAVE A DEFAULT EMPTY CONSTRUCTOR **
Then use Axis's Java2WSDL and WSDL2Java tools to create your artifacts (server and client) and host the service. All things should be in place then.
 
Regards
Jayachandra
 
On 1/4/06, Narayanan Nachiappan <[EMAIL PROTECTED]> wrote:
Jayachandra,
 
     Since, I already have Java component in place, i have exposed it as a WebService using deploy.wsdd alone.
 
     Axis Client i wrote it manually.
 
     If my approach is wrong, please guide on to overcome this issue?
 
Thanks & Regards,
Nachiappan.N


jayachandra <[EMAIL PROTECTED]> wrote:
How did u create your artifacts (both client and server), is it through Axis. If yes, let me know.
 
Jayachandra
 
On 1/4/06, Narayanan Nachiappan <[EMAIL PROTECTED] > wrote:
I have created a Webservice (Axis 1.2.1 implementation) of type DOCUMENT Wrapped Style.
 
There are no issues from the server side.  Through TCP-Mon I'm able to view the response sent back by the Webservice.
 
But, Axis Client is unable to parse the SOAP response.
 
I'm getting the following error:
 
ERROR [org.apache.axis.client.Call] Exception:
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:145)
      at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
      at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
      at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
      at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
      at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
      at org.apache.axis.client.Call.invoke(Call.java:2448)
      at org.apache.axis.client.Call.invoke(Call.java:2347)
      at org.apache.axis.client.Call.invoke(Call.java:1804)
       at com.xyz.test.TestService.main(TestService.java:153)
DEBUG [org.apache.axis.utils.NSStack] NSPush (32)
DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(empty00)
DEBUG [org.apache.axis.utils.NSStack] NSPop (empty)
DEBUG [org.apache.axis.utils.NSStack] NSPush (32)
DEBUG [org.apache.axis.i18n.ProjectResourceBundle] org.apache.axis.i18n.resource::handleGetObject(empty00)
DEBUG [org.apache.axis.utils.NSStack] NSPop (empty)
AxisFault
 faultSubcode:
 faultString: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
 faultActor:
 faultNode:
 faultDetail:
      { http://xml.apache.org/axis/}stackTrace: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:145)
      at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
      at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
      at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
      at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
      at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
      at org.apache.axis.client.Call.invoke(Call.java:2448)
      at org.apache.axis.client.Call.invoke(Call.java:2347)
      at org.apache.axis.client.Call.invoke(Call.java:1804)
      at com.xyz.test.TestService.main(TestService.java:153)
 
 
org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
      at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
      at org.apache.axis.client.Call.invoke(Call.java:2451)
      at org.apache.axis.client.Call.invoke(Call.java:2347)
      at org.apache.axis.client.Call.invoke(Call.java:1804)
      at com.xyz.test.TestService.main(TestService.java:153)
Caused by: org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.
    &nbsp ; at org.apache.axis.encoding.ser.SimpleDeserializer.onStartChild(SimpleDeserializer.java:145)
      at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
      at org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)
      at org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:1141)
      at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:345)
      at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)
      at org.apache.axis.client.Call.invoke(Call.java:2448)
      ... 3 more
 
 
Here is the background information about the Webservice which I have created.
 
Deploy.wsdd is as follows:
 
<deployment     name="LocatePharmacy" xmlns=" http://xml.apache.org/axis/wsdd/"
                                    xmlns:java=" http://xml.apache.org/axis/wsdd/providers/java">
 
<service name="LocatePharmacyService" provider="java:RPC" style="wrapped" use="literal">
           
            <parameter name="className" value="com.xyz.service.LocatePharmacyService" />
            <parameter name="allowedMethods" value="locateByAddress, locateByNABPNumber, getVersion, validateRequest" />
         &nbsp ;  <beanMapping qname="ns:LocatePharmacyRequest" xmlns:ns="LocatePharmacyService" languageSpecificType="java: com.xyz.data.LocatePharmacyRequest"/>
            <beanMapping qname="ns:Pharmacy" xmlns:ns="LocatePharmacyService" languageSpecificType="java: com.xyz.data.Pharmacy"/>
            <beanMapping qname="ns:MemberDetails" xmlns:ns="LocatePharmacyService" languageSpecificType="java: com.xyz.data.MemberDetails"/>
 
//Other bean mappings
.
.
.
.
           
 
</service>
 
</deployment>
 
 
Client code is as follows:
 
                       Service  service = new Service();
                       Call     call    = (Call) service.createCall();
 
                        QName    qn      = new QName( "LocatePharmacyService", "LocatePharmacyRequest" );
 
                        call.registerTypeMapping(com.xyz.data.LocatePharmacyRequest.class, qn,
                                      org.apache.axis.encoding.ser.BeanSerializerFactory.class,
                                      org.apache.axis.encoding.ser.BeanDeserializerFactory.class);
 
                        qn = new QName("LocatePharmacyService", "Pharmacy");
                        call.registerTypeMapping(com.xyz.data.Pharmacy.class, qn,
                                                org.apache.axis.encoding.ser.BeanSerializerFactory.class,
                                                org.apache.axis.encoding.ser.BeanDeserializerFactory.class);
 
                        //REGISTER ALL BEAN SERIALIZERS with respect to deploy.wsdd
 
            call.setTargetEndpointAddress( new java.net.URL(endpoint) );
                       call.setOperationName(new QName("LocatePharmacyService", "locateByNABPNumber"));
 
                        // CONSTRUCT the request object
 
                       LocatePharmacyResponse ret = (LocatePharmacyResponse) call.invoke( new Object[] { request } );
 
                       System.out.println("Response = " + ret);              
 
Webservice Details:
 
            I'm passing a user-defined Object (LocatePharmacyRequest).  It returns a user-defined object (LocatePharmacyResponse).  This user-defined object (LocatePharmacyResponse) in turn encap sulates a user-defined object(array).
 
            public LocatePharmacyResponse locateByNABPNumber(
                                    LocatePharmacyRequest locatorPharmacyRequest) {
                        ErrorList errorList = new ErrorList();
                        return component.locateByNABPNumber(locatorPharmacyRequest,errorList);
            }
 
 
Can anyone please help me out in resolving this issue?
 
 
Looking forward for your great help.
 
Thanks & Regards,
Nachiappan.N

Yahoo! DSL Something to write home about. Just $16.99/mo. or less



--
-- Jaya

 


Yahoo! Photos
Ring in the New Year with Photo Calendars. Add photos, events, holidays, whatever.




--
-- Jaya

Reply via email to