473,748 Members | 2,361 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem client soap(php) with server gsoap (c)

5 New Member
Hi community,
I have a problem with a Soap client written in php.
I have a local server (coded in c and a client in c too, it works fine), but i want to test client in php, and i have an error (I'm not sure to understand it...) :

Expand|Select|Wrap|Line Numbers
  1. SoapFault exception: [SOAP-ENV:Client] Method 'ns1:getMetadataRequest' not implemented: method name or namespace not recognized in beta_2/soap.php:26
  2. Stack trace:
  3. #0 /root/src/rxtxws/beta_2/soap.php(26): SoapClient->__soapCall('getMetadata', Array)
  4. #1 {main}
And when I run the server, I have this:
Expand|Select|Wrap|Line Numbers
  1. Socket connection successful: master socket = 3
  2. SOAP 1.1 fault: SOAP-ENV:Client [no subcode]
  3. "Method 'ns1:getMetadataRequest' not implemented: method name or namespace not recognized"
  4. Detail: [no detail]
  5.  
My wsdl file seems well:
Expand|Select|Wrap|Line Numbers
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- partie 1 : Definitions -->
  3. <wsdl:definitions
  4.     targetNamespace="http://192.168.0.16:8080"
  5.     xmlns:typens="http://192.168.0.16:8080"
  6.     xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  7.     xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
  8.     xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
  9.     xmlns="http://schemas.xmlsoap.org/wsdl/">
  10.  
  11. <!-- partie 2 : Types-->
  12.     <wsdl:types>
  13.       <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://192.168.0.16:8080">
  14.          <xsd:element name="getMetadataRequest">
  15.             <xsd:complexType>
  16.                <xsd:sequence>
  17.                   <xsd:element name="oldname" type="xsd:string" />
  18.                   <xsd:element name="newname" type="xsd:string" />
  19.                </xsd:sequence>
  20.             </xsd:complexType>
  21.          </xsd:element>
  22.  
  23.          <xsd:element name="getMetadataResponse">
  24.             <xsd:complexType>
  25.                <xsd:sequence>
  26.                   <xsd:element name="answer" type="xsd:string"/>
  27.                </xsd:sequence>
  28.             </xsd:complexType>
  29.          </xsd:element>
  30.         </xsd:schema>
  31.     </wsdl:types>
  32.  
  33.         <!-- partie 3 : Message -->
  34.     <wsdl:message name="getMetadataRequestMessage">
  35.         <wsdl:part name="input" element="typens:getMetadataRequest"/>
  36.     </wsdl:message>
  37.     <wsdl:message name="getMetadataResponseMessage">
  38.         <wsdl:part name="output" element="typens:getMetadataResponse"/>
  39.     </wsdl:message>
  40.  
  41.  
  42.         <!-- partie 4 : Port Type -->
  43.     <wsdl:portType name="WebServicesPortType">
  44.                 <!-- partie 5 : Operation -->
  45.         <wsdl:operation name="getMetadata">
  46.             <wsdl:input message="typens:getMetadataRequestMessage"/>
  47.             <wsdl:output message="typens:getMetadataResponseMessage"/>
  48.         </wsdl:operation>
  49.     </wsdl:portType>
  50.  
  51.         <!-- partie 6 : Binding -->
  52.     <binding name="WebServicesBinding" type="typens:WebServicesPortType">
  53.         <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  54.         <wsdl:operation name="getMetadata">
  55.             <soap:operation soapAction="getMetadata"/>
  56.             <wsdl:input><soap:body use="literal"/></wsdl:input>
  57.             <wsdl:output><soap:body use="literal"/></wsdl:output>
  58.         </wsdl:operation>
  59.     </binding>
  60.  
  61.         <!-- partie 7 : Service -->
  62.     <wsdl:service name="WebServices">
  63.                 <!-- partie 8 : Port -->
  64.         <wsdl:port name="WebServicesPort" binding="typens:WebServicesBinding">
  65.             <soap:address location="http://192.168.0.16:8080"/>
  66.         </wsdl:port>
  67. </wsdl:service>
  68. </wsdl:definitions>
  69.  
So I think my problem is in client.php, but, i don't find it:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. require_once 'SOAP/Client.php';
  3. ini_set("soap.wsdl_cache_enabled", FALSE);
  4. $wsdl_file =  'file.wsdl';
  5.  
  6. class getMetadataRequest
  7. {
  8.    public $oldname;
  9.    public $newname;
  10.    public function __construct( $oldname, $newname )
  11.    {
  12.       $this->oldname = $oldname;
  13.       $this->newname = $newname;
  14.    }
  15.  
  16. }
  17.  
  18. try {
  19.    $classmap = array('getMetadataRequest' => 'oldname', 'getMetadataRequest' => 'newname');
  20.    $soapClient = new SoapClient($wsdl_file, array('classmap' => $classmap, 'exception' => true, 'trace' => true));
  21.  
  22.       $oldname = "oldname";
  23.       $newname = "newname";
  24.  
  25.       $getMetadataRequest = new getMetadataRequest($oldname, $newname );
  26.       $getMetadataResponse = $soapClient->__soapCall(getMetadata, array($getMetadataRequest));
  27.       /* $getMetadataResponse = $soapClient->getMetadata($getMetadataRequest); */
  28.       $result = $getMetadataResponse->answer;
  29.       echo $result;
  30.    }
  31. catch (SoapFault $fault)
  32. {
  33.    echo $fault."\n";
  34. }
  35.  
  36. ?>
  37.  
A test with nc show me some informations are received, but...
Expand|Select|Wrap|Line Numbers
  1. $nc -l -p 8080
  2. POST / HTTP/1.1
  3. Host: 192.168.0.16:8080
  4. Connection: Keep-Alive
  5. User-Agent: PHP-SOAP/5.2.0-8+etch11
  6. Content-Type: text/xml; charset=utf-8
  7. SOAPAction: "getMetadata"
  8. Content-Length: 307
  9.  
  10. <?xml version="1.0" encoding="UTF-8"?>
  11. <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://192.168.0.16:8080"><SOAP-ENV:Body><ns1:getMetadataRequest><oldname>oldname</oldname><newname>newname</newname></ns1:getMetadataRequest></SOAP-ENV:Body></SOAP-ENV:Envelope>
  12.  

If you have any ideas, suggestions, I'll take it
Thanks in advance

--regards
Greg
Jul 29 '08 #1
4 12054
gcharbon
5 New Member
arg, shame on me.

Don't forget to check nsmap file. If ip/host aren't consistent, it can't work....

Sorry for that.

--
regards
Greg
Jul 29 '08 #2
mikemike28
2 New Member
good day, i have problem too, but the error is "method not implemented or namespace not recognized".. does this have something to do with nsmap? by the way what is nsmap? can you detail me the solution? thanks..
Mar 25 '10 #3
Dormilich
8,658 Recognized Expert Moderator Expert
I’m not doing much SOAP, but the nsmap refers to (I think) to the namespace mapping (one of the features of XML), if both parties (sender/receiver) don’t use the same namespaces, the XML just won’t match.
Mar 25 '10 #4
mikemike28
2 New Member
oks, thanks to all.. i got now what im looking for, gcharbon helped a lot
Mar 30 '10 #5

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

Similar topics

0
3656
by: snowdrop | last post by:
Hi folks, try the SOAP library written in C. Using csoap you can also implement a SOAP server in C. This library depends on libxml2. Homepage: http://csoap.sourceforge.net Example client using CSOAP ----------------------------------------------
6
3736
by: Ken Allen | last post by:
I am relatively new to .Net and C#, but I hav ebeen programing in other languages and done some COM work for a number of years. I am attempting to understand how to map an older program architecture into .Net -- not looking to do it at this time, just to understand how I would achieve it. In the old environment, we had two classes, a client and a server class, that managed a data object. The server object knew how to interface with the...
3
14385
by: Salina | last post by:
I am new in C#.Net and going to write a window client/server application. my database is mysql and the data will update every min. what i need to do is push the up-to-date data to clients from server directly. Clients just need to read the data, not neccessary for modification. Can anyone recommend me what method I should use? DataSet or Threading or anything else? Any samples? Please help
1
2442
by: Alexandre (www.pointnetsolutions.com) | last post by:
I am looking at building a distributed system, and i have been looking at many different options, in some cases i was thinking of a client server relation where a client would send a string to the system as a command. i also looked at the GOF Command pattern which i could somewhat use with
0
943
by: Julio Delgado | last post by:
Hi: I am new to try to programm an application accesing a SOAP Server. The only information I have about the server is the http://servername/rfid and that it is running on port 50002 . How can I access this SOAP server. I try to add a web reference on VS2003 and I get the following error The proxy settings on this computer are not configured correctly for web discovery. I know I can access the web services from Google site. Any...
6
2964
by: Pieter Coucke | last post by:
Hi, Which technology's are used to make Windows Forms (Fat) Client - Server application with VB.NET (2.0)? - XML Webservices, Remoting, DCOM, ... are there others? - Which are used the most and why? - Pro's and cons? Any help or usefull links would be really appreciated!
0
1491
by: johnmiloo | last post by:
Can some one get me started with a working SOAP server that works over https. (SSL)? I have M2Crypto installed and found the following sample, but something is wrong in ssl_context = SSL.Context() Any help or tutorial appreciated? from SOAPpy import SOAPServer
1
5502
by: gezerpunta | last post by:
Hi I have to find a soap client to be able to connet to java apache soap server.And I must send a file and envelope xml.I found nusoap but I can t achieve to communicate it. Does anybody knows anything about it? thks.
4
3934
by: shreedhan | last post by:
hi i am trying to write a simple client server chat program. the code of server program is: #define PORT 9999 int main() { struct sockaddr_in server_addr,client_addr;
0
8984
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8823
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9363
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9238
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6793
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4864
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3300
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 we have to send another system
3
2206
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.