cancel
Showing results for 
Search instead for 
Did you mean: 

Calling Web Service from Script

isaac_ariza_cruz
Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Isaac,

as of version 9, SAP shifted from Axis to CXF.

kr,

Bram

isaac_ariza_cruz
Participant
0 Kudos

Hi Bram,

First of all, thanks for your answer.

 

I'm new in CXF technology so could you please send me any brief example or any kind of help documentation?

 

Thanks in advance and best regards,

Isaac

Former Member
0 Kudos

Hi,

I'm new in CXF technology as well. We are however using it on our current project and apparently you need to create a custom JAR and deploy it.

You can find more information in the SAP Sourcing 9 upgrade guid (section 'Migrating from Axis2 to CXF').

Bram

Answers (1)

Answers (1)

isaac_ariza_cruz
Participant
0 Kudos

Hi Bram,

Thanks again for the info.

I will keep on looking for further support on this topic. But thanks again for your answers.

 

@Rest of SND Experts: Have you ever worked in CXF technology? It will be very appreciated if you could help me in this topic.

Thanks a lot and best regards,

Isaac