This is a discussion on WebServices in DotNet within the ASP and ASP.NET Programming forums, part of the Web Development category; Here is a sample code for that Ramesh.... Go thru this... Code: HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url); request.Method = &...
| |||||||
| Register | FAQ | Members List | Calendar | Mark Forums Read |
| |||
| Here is a sample code for that Ramesh.... Go thru this... Code: HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(url);
request.Method = "PUT";
request.ContentType = ContentType // Here is ur ContentType
request.ContentLength = byteArr.Length;
Stream dataStream = request.GetRequestStream();
dataStream.Write(byteArr, 0, byteArr.Length);
dataStream.Close();
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| Sponsored Links |
| |||
| Yes.... You can create php web service for C#. Here is sample code... Code: //ws.php
require_once("lib/nusoap.php");
$ns="http://your.server.address/";
$param = array('x' => 'xsd:string','y' => 'xsd:string');
$return = array('return'=>'xsd:string');
$server = new soap_server();
$server->configureWSDL('WS Test',$ns);
$server->wsdl->schemaTargetNamespace=$ns;
$server->register('TestFunction',$param,$return,$ns);
function TestFunction($x,$y){
$ret=$x+$y;
return new soapval('return','xsd:string',$ret);
}
$server->service($HTTP_RAW_POST_DATA); Random Byte: Creating a php webservice for C#
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| Hi Vinoth, Thanks for ur kind reply... It's working for me...but... Can u clear me the contenttype? I need to upload image files with the format of Jpg.... thnx in advance! |
| |||
| Ya sure Ramesh! The ContentType property sets the HTTP content type for the request and response object. ContentType for Text is Code: ContentType = "text/plain" Code: Contenttype="text/xml" Code: Contenttype="text/html" Code: application/x-mmc.icon; Code: img/bmp Code: application/x-mmc.ringtone Code: audio/wav Code: ContentType="image/JPEG" Code: ContentType ="image/tiff" and so on...
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| I am trying to make a client in C# that use a PHP Web Service. I am using NuSOAP for creating the Web Services. It creates the WDSL ok and C# recognizes it but during run Time its throws an exception. Has anybody tryied to interoperate with PHP web services and C# client ? Please let me know your experience.
__________________ thanx n regards jeyaprakash.c |
| |||
| while it has PHP in it, C# is the one throwing an exception so it's a C# problem. Check it out in C# programme.... ![]()
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| Getting the Webservice running on the .NET server is easy. The hard part was getting the PHP page to call the webservice and return the values that we needed. Here is a demo method: Code: [WebMethod] public Order GetOrder() { Order myOrder = new Order(); myOrder.SalesNum = “123″; myOrder.OrderDate = “05/24/2006″; myOrder.ShipDate = “Tomorrow”; myOrder.PaymentRec = “05/24/2006″; myOrder.OrderStatus = “InProgress”; return myOrder; } ![]()
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| $result is the return var from the webservice $result[’GetOrderResult’][’SalesNum’] $result[’GetOrderResult’][’OrderDate’] etc… for more see the following link.... Random » PHP calling C# .NET Webservice
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| I've noticed that XmlSerializer won't serialize objects that implement IDictionary by default. you can visit this msdn link for reference. http://msdn.microsoft.com/msdnmag/is...s/default.aspx It might be useful for you. Read the last question and answer in the link. |
| |||
| WebMethod framework uses the XmlSerializer plumbing, it's now possible to return DictionarySerializer objects from WebMethods. For example, let's consider the WebMethod that returns a Hashtable through a DictionarySerializer wrapper as shown in the following code: Code: [WebMethod]
public DictionarySerializer GetHashTable()
{
Hashtable ht = new Hashtable();
ht.Add(1, "Aaron");
ht.Add(2, "Monica");
ht.Add(3, "Michelle");
return new DictionarySerializer (h1);
}
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| The XmlSerializer errors when serializing an object with a public property of type IList<T>. Since IList<T> is an ICollection, this should work. Also, it similarly errors when using properties that are of any interface type that inherits from IList<T>. Making that interface explicitly implement IEnumerable doesn't work either (even though the documentation implies that this should work). XmlSerializer does not support members of type ICollection or IEnumerable since V1. It requires that all members typed to collection types have a default indexer and Add method. ICollection and IEnumerable both do not have Add methods. In the following msdn link explains about this error..... Feedback: XmlSerializer can't serialize properties of type IList<T>
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| Hi friendz, I have web service written on C# I want call this service from code on C/C++ (I want that this code stably working) What is better way to do this call? What framework better use? Axis C++ 1.x or Axis2C ???
__________________ Raja. Myblog |
| |||
| Well I cannot comment on the suitability of Axis2 C++, because I did not use it for some time. And I could not test it with C#. But on Axis2/C, you can interop with .NET. Also, if you want WS-* stuff, such as WS-Addressing, WS-Security and WS-RM, then you would be better off using Axis2/C as it has proved to work with .NET with those specs.
__________________ cheers Aman |
| |||
| Hello, I have created a web service and am trying to use it in a Windows application. But I'm getting the error when I run my code as follows, The request failed with HTTP status 401: Unauthorized. I've created a virtual directory in IIS and am trying to run it locally. Any thoughts would be great. Here is my code: private void button1_Click(object sender, EventArgs e) { myService.Service service=new myService.Service(); MessageBox.Show(service.Message()); } ![]() |
| |||
| Hi friend, If Anonymous is allowed then you need to check permissions on your application folder. Give Network services and ASP.NET user permisison. And if your Web Service uses other resources like writing to file etc you need to check permission to those resources.
__________________ S.VinothkumaR Behind me is infinite power, Before me is Endless Possibility, Around me is Boundless Opportunity, Why should I fear! |
| |||
| This might seem like a silly questions. We are moving web service from out test service to production.Now my Web Application is referencing Web Service on the test server. When i move my application to production, i would like to reference the production server instead. Would it be possible to change the reference link by changing the link to the web service through web.config?
__________________ Krishnakumar.S Beware of Everything -that is un true; stick to the Truth shall succeed slowly but steadily |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Easy Property Class Generator for DOTNET Developers | Anandavinayagam | ASP and ASP.NET Programming | 4 | 01-16-2008 03:54 AM |
| What is Ngen.exe in DotNet? | leoraja8 | VB.NET Programming | 11 | 10-31-2007 02:17 AM |
| OOPs Tips for DotNet. | S.Vinothkumar | Interview Questions & Answers and Tips | 11 | 10-29-2007 07:20 AM |
| Transaction Scope in DotNet using C#. | S.Vinothkumar | C# Programming | 52 | 09-22-2007 01:15 AM |
| Does Using Json Instead Of Xml Speeds Up Webservices Architecture | ramkumaraol | HTML, CSS and Javascript Coding Techniques | 0 | 07-18-2007 02:59 AM |