473,698 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

consuming a .net web service using php

3 New Member
Hi,
I am trying to access a .net web service using php.A member function in the web service has an object as a parameter.
I was not able to access that member function.
Here is the web service coding..
Expand|Select|Wrap|Line Numbers
  1. public MemberView ChangeEmailAddress(InfiSession infiSes, string oldEmailAddress, string newEmailAddress)
  2.         {
  3.             try
  4.             {
  5.                 MemberManager memberManager = new MemberManager(infiSes);
  6.                 Member mem = memberManager.ChangeEmailAddress(infiSes.MemberId, oldEmailAddress, newEmailAddress);
  7.                 MemberView memView = memberManager.GetMemberViewByEmailAddress(mem.EmailAddress);
  8.                 return (memView);
  9.             }
  10.             catch (Exception ex)
  11.             {
  12.                 InfiDebugLog.AppServer.WriteError(ex);
  13.                 throw FaultUtility.GetFaultException(ex);
  14.             }
  15.         }
  16.  
  17. I am trying to access the above member function ChangeEmailAddress.
  18. For that i have to pass 3 parameters 1.an object 2.old email address 3.new email address.
  19.  
  20. Here is my php coding...
  21.  
  22. <?php
  23. ob_start();
  24. session_start();
  25. require_once('nusoap.php');
  26. $client = new nusoap_client('http://n1app1exc.corp.lan:8082/MemberService.svc?wsdl', 'wsdl'); 
  27.  
  28. $err = $client->getError();
  29.  
  30. //$memberid =($client->"InfiSession.infiSes");
  31. if ($err) {
  32.     echo '<h2>Constructor error</h2><pre>' . $err . '</pre>';
  33. }
  34.  
  35. $client->soap_defencoding = 'UTF-8';
  36. $client->setHTTPEncoding('deflate, gzip');
  37.  
  38.  
  39. //ss$infiSes =new InfiSession;
  40.  
  41. $id = $infiSes =$_SESSION['mid'];
  42.  
  43.  
  44. //$memberid= $_SESSION['mid'];
  45. echo $memberid;
  46. $old = $_REQUEST['oldemail']; 
  47. $new = $_REQUEST['Newemail'];     
  48. //echo $id;
  49.  
  50. //echo $infiSes;
  51. print "<pre>";
  52. $infi=$client->call("MemberService->InfiSession()" );
  53.  
  54.  
  55.               //s  MemberService.InfiSession myInfiSession = new MemberService.InfiSession();
  56.  
  57. //var_dump($client);
  58. class InfiSession
  59. {
  60. function  getvalue()
  61.     {
  62. $_MemberId=$id;
  63. $_ContextOrgId="0";
  64. $_OrgMemberId="0";
  65. $_ServerUrl="";
  66.     }
  67. }
  68. $infiSes=new InfiSession;
  69.  
  70.  $result = $client->call('ChangeEmailAddress', array ("InfiSession infiSses" =>$infiSes,"oldEmailAddress"=>$old,"newEmailAddress" =>$new));
  71. var_dump($result);
  72. if($result['faultstring']!="")
  73. { echo $result['faultstring']['!'];
  74. }
  75. print_r($result); 
  76.  
  77. ?>
i was not able access the function..
Please help me..
I have to do this with in a week..
Thanks in advance

Riaz

Please enclose any code within the proper code tags. See the Posting Guidelines on how to do that. - moderator
Mar 5 '08 #1
1 2232
pbmods
5,821 Recognized Expert Expert
Heya, Riaz.

In my experience, NuSoap does not work properly with .NET webservices because .NET doesn't understand namespaces properly.

Try passing some sample XML that you know should work to your .NET server to see if that part of it is working.
Jun 27 '08 #2

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

Similar topics

1
1416
by: Ezhil | last post by:
Hi All, we have an asp.net application which is consuming a third party java web service.In order to access the web service a login and password are required and they're passed as SOAP headers. We need to include this header in the soap message request. There is no separate method available for authentication in the web service. We have no control over the web service methods. We are just generating the proxy class and using it.
3
6503
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07162002.asp) but I don't want clients to have to add two web references and then manually have to edit the proxy classes. After doing some searching I found that putting references to multiple web services in a .disco...
6
2334
by: kbs | last post by:
Hi, I'm looking for some good examples that illustrate how to code a web service that exposes a custom collection so that the properties of the collection are accessible on the client without having to do a httpwebreqeust call.
1
4391
by: BestofAbhi | last post by:
I am consuming Java Web Services in .NET. The Java Web Services have been coded using Apache Axis. The binding style in the WSDL is 'Document' and type is 'Literal'. I have added these Java Web Services both as Web Reference and Reference (ie dll generated using wsdl.exe) in the Project in order to access them. I am able to get the output for web methods that return just a string. However when it comes to complex data like an object /...
0
1362
by: Abhijit Salvi | last post by:
I am consuming Java Web Services in .NET. The Java Web Services have been coded using Apache Axis. The binding style in the WSDL is 'Document' and type is 'Literal'. I have added these Java Web Services both as Web Reference and Reference (ie dll generated using wsdl.exe) in the Project in order to access them. I am able to get the output for web methods that return just a string. However when it comes to complex data like an object /...
1
3426
by: leslie_tighe | last post by:
Hello, I have webservice created with Axis 1.2.1 and that I am trying to consuming in .NET (VB) using the Microsoft provided tools. While I am able to consume methods on the service that return simple type, I cannot consume methods that return complex objects. I have tried experimenting, with this, but am at a bit of loss on where the problem lies. When I call the services from a browser, I do get back the response that contains valid...
2
1457
by: Glenn Venzke | last post by:
Is there any way to tell what type of application is consuming a web service? I'm writing a web service that returns a string with 2 carriage returns. What I want to do is replace these carriage returns with "<br>" tags ONLY if a web application is consuming.
0
1567
by: plmanikandan | last post by:
I need to develop a application to consume a webservice. For consuming web service i tried a example in Consuming a Web Service in C# in http://www.csharphelp.com.But i am uanble to use that webservices in http://upload.eraserver.net/circle24/worldtime/worldtime.asmx?WSDL.Can anybody give me simple example(website link) for consuming webservice(other than local host). Mani
3
6095
by: Jeremy Chapman | last post by:
I've writtin a very simple web service in axis which returns an array of classes. I consume it in a .net app. When receiving the response, my .net app generates an error "Cannot assign object of type System.Object to an object of type PersonWS.WorkGroupData.". I've included the wsdl of the consumed axis web service, the request/responses of the web service by the .net app and the exception and stack trace. Hoping someone can tell me...
1
1649
by: =?Utf-8?B?R29yZG9u?= | last post by:
Hi; I can consume a web service from an asp.net application with no problem. The web service connects to a remote server through ODBC and returns a data set to the consuming software. When I try to consume the WS from a windows app is gives a 407 error. I didn't think that the consuming application had to worry about connecting
0
8672
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
8600
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
9155
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8890
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7711
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5859
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
4360
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4614
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2322
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.