473,503 Members | 1,685 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a issue about webservice(Method not implemented: method name or namespace not recogni

1 New Member
I want to use web service to communication with Java and C++. c++ as the server,using GSoap to publish and Java is the client side,using Apache's cxf. Here is the Client code:


Expand|Select|Wrap|Line Numbers
  1. import java.nio.charset.Charset;
  2. import java.rmi.RemoteException;
  3.  
  4. import javax.xml.namespace.QName;
  5. import javax.xml.rpc.ParameterMode;
  6. import javax.xml.rpc.ServiceException;
  7.  
  8. import org.apache.axis.client.Call;
  9. import org.apache.axis.client.Service;
  10. import org.apache.axis.encoding.XMLType;
  11.  
  12.  
  13. public class StartUpClient {
  14.     public static void main(String[] args)
  15.     {
  16.         try{
  17.             String endpoint = "http://localhost:8686/wscplus?wsdl";
  18.             Service service = new Service();
  19.  
  20.             Call call = (Call)service.createCall();
  21.             call.setTargetEndpointAddress(endpoint);
  22.  
  23.             call.setOperationName(new QName("urn:wscplus","helloservice"));
  24.             call.addParameter("param", XMLType.XSD_STRING, ParameterMode.IN);
  25.             call.addParameter("result", XMLType.XSD_STRING, ParameterMode.OUT);
  26.  
  27.             call.setReturnTypeAsHeader(XMLType.XSD_STRING);
  28.             String str = "237adsfasdfsdf";
  29.             String strParam = new String(str.getBytes(Charset.forName("UTF-8")));
  30.             String result = (String)call.invoke(new Object[]{strParam});
  31.             System.out.println("Get return result from c++ server" + result);
  32.  
  33.         }
  34.         catch(ServiceException e)
  35.         {
  36.             e.printStackTrace();
  37.  
  38.         }
  39.         catch(RemoteException e)
  40.         {
  41.             e.printStackTrace();
  42.         }
  43.  
  44.  
  45.     }
  46.  
  47. }

When I start the client after starting the serverside,it always report the error "Method 'ns1:helloservice' not implemented: method name or namespace not recognized", can you help me find the solution? Thanks a lot!
Feb 27 '17 #1
1 3600
Frinavale
9,735 Recognized Expert Moderator Expert
After starting your web service, if you open a web browser and enter the url of the wsdl ('http://localhost:8686/wscplus?wsdl') does it show up??
Feb 27 '17 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
2656
by: AngryGerbil | last post by:
hey, How do I acquire MethodInfo WITHOUT hardcoding method name as a string?!??!The fact I have to use xxx.Gettype.GetMethod("MyMethod", xxx) is making me want to drive an ice pick into my eye! I...
2
1709
by: Microsoft Newsgroups | last post by:
I am trying to consume a web service where there is a dot in the method name as defined in the portType and binding section of the WSDL file. Here is an example: <operation...
1
1595
by: =?Utf-8?B?VmlrcmFt?= | last post by:
is there any object available in c#/asp.net which can give me event name in that eevnt only. Like if I am in Page_load event, i should get Page_Load or if I am in Button_click event I should get...
24
2080
by: Mike Hofer | last post by:
Please forgive the cross-post to multiple forums. I did it intentionally, but I *think* it was appropriate given the nature of my question. I'm working on an open source code library to help...
7
3848
by: jackchang1 | last post by:
It's not difficult getting the function name of the caller but if the caller is an object's method, how do you get the method name? <html> <head> <script type="text/javascript"> function...
2
1049
by: Ashish Gupra | last post by:
Hi, Is there any method to know the interface name through which the class has been implemented? Example: Public Interface I1 Public funcation Test() as string End Interface
1
13360
by: Alex Dransfield | last post by:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; namespace FindFactors { class Program {
0
7202
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7086
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7280
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6991
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5578
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3167
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1512
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
736
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.