• Welcome to KonaKart Community Forum. Please login or sign up.
 

WebService Client Application Error

Started by sureshbabubv, March 24, 2010, 04:47:40 am

Previous topic - Next topic

sureshbabubv

Dear All,

I am trying to develop a clientside application to access the konakart webservices(updating the quantity of a product)



I am using eclipse and created all client side libraries(classes) using apache axis2 and following wsdl url given by the konakart people.

http://www.konakart.com/konakart/services/KKWebServiceEng?wsdl



When I am running the AxisExample.java application  and using the following code

com.konakart.wsapp.Product objProduct = (com.konakart.wsapp.Product) new         KKWSEngIfServiceLocator().getKKWebServiceEng().getProduct(sessionId, 18, 1);
            System.out.println("a "+objProduct.getName());
            System.out.println("aa "+objProduct.getQuantity());
            System.out.println("aaaa  "+objProduct.getManufacturerId());

this code is connecting to "http://www.konakart.com/konakart/services/KKWebServiceEng";  webservice, and when I changed it to http://localhost:8080/konakart/services/KKWebServiceEng in the KKWSEngIfServiceLocator.java page,  I am getting the following error.



org.apache.axis.InternalException: java.lang.Exception: Couldn't find a matching Java operation for WSDD operation "getCountry" (1 args)
   at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222)
   at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129)
   at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087)
   at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
   at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
   at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
   at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
   at javax.xml.parsers.SAXParser.parse(Unknown Source)
   at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
   at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
   at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
   at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62)
   at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
   at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
   at org.apache.axis.client.Call.invoke(Call.java:2767)
   at org.apache.axis.client.Call.invoke(Call.java:2443)
   at org.apache.axis.client.Call.invoke(Call.java:2366)
   at org.apache.axis.client.Call.invoke(Call.java:1812)
   at com.konakart.ws.KKWebServiceEngSoapBindingStub.getProduct(KKWebServiceEngSoapBindingStub.java:3426)
   at com.archiexcel.konakart.webservice.AxisExample.lowLevelVersion(AxisExample.java:97)
   at com.archiexcel.konakart.webservice.AxisExample.main(AxisExample.java:63)


how can I resolve the same.


Thanks & Regards,
B.V.Suresh Babu














sureshbabubv

Dear All,

I resolved this issue,

I didn't the change the configuration file (server wsdd) for allowedmethods.

Thanks & Regards,
B.V.Suresh Babu

heidi

As you have found, you need to enable the web services.  The easy way to do that is using the ant task enableWebServices.  Check the docs...

By the way, KonaKart uses Axis 1.4 for its web services.

Also, it's *far* easier to use the web services versions of the KonaKart engines (KKWSEng and KKWSAdmin) to code web service clients if you're using java.

The example you're following is possible but it's a lower-level technique.  With the web service versions of the KonaKart engines, you just instantiate the engines and you're ready to call methods..  all the SOAP work is done for you.   One advantage in using this technique over the way you're doing it is that the interfaces to the two KonaKart engines are identical between the direct and SOAP versions.  Therefore, this allows you to instantiate the engine you require (SOAP or direct) by name at runtime to give you tremendous implementation flexibility.

--Heidi