Quantcast
Channel: SCN : Discussion List - SAP Sourcing
Viewing all articles
Browse latest Browse all 1416

Calling Web Service from Script

$
0
0

Hi expert,

 

As described into thread Call a Web Service from within an e-Sourcing script, I've used code described below:


import org.apache.axis.client.Call;

import org.apache.axis.client.Service;

import org.apache.axis.encoding.XMLType;

import javax.xml.rpc.ParameterMode;

import javax.xml.namespace.QName;

 

String endpoint = "http://api.google.com/search/beta2";

Service  service = new Service();      

Call call = (Call) service.createCall();      

call.setTargetEndpointAddress( new java.net.URL(endpoint) );      

call.setOperationName( "doSpellingSuggestion" );      

call.setOperationName(new QName("urn:GoogleSearch", "doSpellingSuggestion"));      

call.addParameter("key", XMLType.XSD_STRING, ParameterMode.IN);      

call.addParameter("phrase", XMLType.XSD_STRING, ParameterMode.IN);      

call.setReturnType( XMLType.XSD_STRING );      

String ret = (String) call.invoke( new Object[] { "googlekey", doc.getDocumentDescription()} );      

doc.setDocumentDescription(ret);

 


However, when I try to execute it (because I've included it in a toolbar script), following error is raised:

Typed variable declaration: Class: Service not found in namespace

 

If I understood correctly the information on the previous thread, the open source Axis library is included with E-Sourcing. Therefore, it should work because corresponding libraries have been imported at the very beginning of the code.

 

Could you please let me know what I'm doing wrong? Is my previous understanding correct regarding Axis library or should it be included in Sourcing system?

 

Just to add further information: I'm testing it in SAP Sourcing Wave 9.

 

Thanks in advance for your help and support and best regards,

Isaac


Viewing all articles
Browse latest Browse all 1416

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>