Consuming A WSE-enabled Web Service In A 2.0 Web Site?
Jan 25, 2011
I'm trying to consume a WSE enabled Web Service from an ASP.NET Web Site.I've installed WSE 3.0, used the config tool to add WSE info to my web.config and then done an Add Web Reference.I believe that the problem may be that this is a Web SITE, not a Web APPLICATION. As such, the proxy class is generated at runtime, perhaps not adding the WSE magic.I can access the proxy class from metadata, and it's of typeSystem.Web.Services.Protocols.SoapHttpClientProtocol, which as far as I can tell doesn't have any WSE functionality.I realize that this is all old technology, but I don't get to decide what the servers run :(
View 1 Replies
Similar Messages:
Mar 16, 2011
I have the following code for consuming a service that is not working for me. what I can do to narrow down whats going wrong?
The address is: http://localhost:57667/ExampleService.svc/
When visiting directly I get the 'You have created a service... message'
The code that goes wrong is here. It causes the following error:
_url = "http://localhost:57667/ExampleService.svc";
TextReader textReader = new StringReader(HttpPostClient.Post(new Uri(_url), bodyData.ToString(), _exampleServiceRequestEncoding, Properties.Settings.Default.HttpPostClientExampleAvailabilityTimeout));
ERROR MESSAGE:When visiting this URL directly: http://localhost:57667/ExampleService.svc/ProcessRequest
The exception message is 'No component for key example.ExternalWebServiceStubs.Example.ExampleService was found'.
Castle.MicroKernel.DefaultKernel.get_Item(String key) at Castle.Facilities.WcfIntegration.WindsorInstanceProvider.GetInstance
View 2 Replies
May 23, 2010
I have put a simple service on my site which requires the input of a string and it will return an array as its output.The service works fine on my PC; however, I have published the site online and the web services don't work?
View 9 Replies
Jun 14, 2010
I'm taking over a project for a former co-worker. We're consuming a web service which requires authentication. The former co-worker was unable to call the service using WCF. I'm mostly unfamiliar with web services but was also unable to get it to authenticate.Upon speaking w/ the original developer, I was told that I'd have to build a project in VS 2005 in order to consume the service and that WSE 3 would have to be used, instead of WCF. He has some code that did indeed build and run on his PC, while he was here. I'm now unable to get it to build.
I'm running VS 2005 on XP and have WSE 3.0 installed and enabled on the project, which is a C# class library. I successfully made a Web Reference to the service and generated a proxy. In trying to test it, the first few lines of my code look like this:
[Code]....
...problem is, it says that the proxy that was generated does not have RequestSoapContext!
View 4 Replies
Feb 23, 2011
I am trying to create a wrapper class for the MusicBrainz CD database using VB.NET. I have a test URL that produces an XML response:[URL]I need to get that response into an XMLDocument object in .NET. I have tried XMLDocument.Load, WebClient.DownloadString, and HttpWebRequest through a StreamReader. All produce: Unable to Connect To Remote Server. It is possible that my company firewall is the problem but I can access the URL just fine in a web browser.
View 2 Replies
Oct 4, 2010
Here's a simple question that Google isn't providing any good leads on:How I do consume this in VS 2008 or 2010?[URL]I have no control over it, I just have to consume it and use it. Adding it as a web reference in the project yields this error:[URL]was not recognized as a known document type.The error message from each known type may help you fix the problem:- Report from 'XML Schema' is 'The root element of a W3C XML Schema should be <schema> and its namespac"
View 6 Replies
Jan 14, 2011
I'm trying to consume the following web service http://ipinfodb.com/ip_location_api.php
this web service returns an xml response, the code below gets the XML response, but somehow when phasing the values from the XML response it does not work.
What is wrong with my code?
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.IO;
using System.Net;
using System.Xml;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
HttpWebRequest request = null;
HttpWebResponse response = null;
String Xml;
// Create the web request
request = WebRequest.Create("http://api.ipinfodb.com/v2/ip_query.php?key=<yourkey>&ip=74.125.45.100&timezone=true") as HttpWebRequest;
// Get response
using (response = request.GetResponse() as HttpWebResponse)
{
// Get the response stream
StreamReader reader = new StreamReader(response.GetResponseStream());
Xml = reader.ReadToEnd();
}
// Console xml output
Console.WriteLine(Xml); //see if we get the xml response, (YES we do)
Console.ReadLine();
string _currentField = "";
StringReader _sr = new StringReader(Xml);
XmlTextReader _xtr = new XmlTextReader(_sr);
_xtr.XmlResolver = null;
_xtr.WhitespaceHandling = WhitespaceHandling.None;
// get the root node
_xtr.Read();
if ((_xtr.NodeType == XmlNodeType.Element) && (_xtr.Name == "Response"))
{
while (_xtr.Read())
{
if ((_xtr.NodeType == XmlNodeType.Element) && (!_xtr.IsEmptyElement))
{
_currentField = _xtr.Name;
_xtr.Read();
if (_xtr.NodeType == XmlNodeType.Text)
{
switch (_currentField)
{
case "Status":
Console.WriteLine(_xtr.Value); //we print to console for testing purposes, normally assign it to a variable here!
break;
case "CountryCode":
Console.WriteLine(_xtr.Value);
break;
case "CountryName":
Console.WriteLine(_xtr.Value);
break;
case "RegionCode":
Console.WriteLine(_xtr.Value);
break;
case "RegionName":
Console.WriteLine(_xtr.Value);
break;
case "City":
Console.WriteLine(_xtr.Value);
break;
case "ZipPostalCode":
Console.WriteLine(_xtr.Value);
break;
case "Latitude":
Console.WriteLine(_xtr.Value);
break;
case "Longitude":
Console.WriteLine(_xtr.Value);
break;
case "Gmtoffset":
Console.WriteLine(_xtr.Value);
break;
case "Dstoffset":
Console.WriteLine(_xtr.Value);
break;
case "TimezoneName":
Console.WriteLine(_xtr.Value);
break;
case "Isdst":
Console.WriteLine(_xtr.Value);
break;
case "Ip":
Console.WriteLine(_xtr.Value);
break;
default:
// unknown field
throw new Exception("Unknown field in response.");
}
}
}
}
}
Console.ReadLine();
}
}
}
EDIT: this is the XML response returned
<?xml version="1.0" encoding="UTF-8" ?>
- <Response>
<Status>OK</Status>
<CountryCode>US</CountryCode>
<CountryName>United States</CountryName>
<RegionCode>06</RegionCode>
<RegionName>California</RegionName>
<City>Mountain View</City>
<ZipPostalCode>94043</ZipPostalCode>
<Latitude>37.4192</Latitude>
<Longitude>-122.057</Longitude>
<Gmtoffset>-28800</Gmtoffset>
<Dstoffset>0</Dstoffset>
<TimezoneName>America/Los_Angeles</TimezoneName>
<Isdst>0</Isdst>
<Ip>74.125.45.100</Ip>
</Response>
View 4 Replies
Aug 24, 2010
I'm working with an outside company to impletement their API into our program. Most of their member functions working pretty solid. I get to the one function where I have to pass an associated array to it and this is where it blows up. I create a hash table or namevaluecollection and of course I will get the error(The type System.Collections.Hashtable is not supported because it implements IDictionary.), which can't be serialized.
Is there an easy way to pass this associated array to them? I don't think their api is very flexible, but they seem to think so.
View 1 Replies
Nov 9, 2010
I need to access a web service. The WSDL is not available, even if I know everything about the service (url, method name and signature). I guess I could use HTTPRequest and HTTPResponse classes:HTTPResponse: should contains the XML Soap Response that I eventually parse.HTTPRequest: how to specify the service's and the method's parameters?
View 2 Replies
Mar 2, 2011
i have a requirement to build some sort of services that can easily be called to a 3dr party API.
the call can be done through simple
1) HTML page
2) ASPX page
3) MOBILE device
should i create a separate web service project separately and create few methods [WebMethod] ?
also the method can be static?
/// <summary>
/// Summary description for signup_service
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[Code]....
View 1 Replies
Apr 19, 2010
I've created a class library, now I'm trying to use it in a webservice.If I try and use it via a web method like this:
<WebMethod()> _Public
Function GetStaffList()
As List(Of ClassLibrary.Staff)
End
Function
I get this error:You must implement a default accessor on System.Security.Policy.Evidence because it inherits from ICollection. And I can't seem to find any coherent instructions on remedying this issue.If I copy the Staff class into the web service (app_code) it works hunky dory, so it must be security..I can't be the only one attempting this! MSDN doesn't explain this one too well :(
View 3 Replies
Jun 14, 2010
I have created a webservice which is publicly exposed. This publicly created webservice can be consumed in the application But my requirement is I have to create a webservice to expose the schema and cannot be consumed directly.How to consume the web service which is not exposed directly.
View 1 Replies
Jun 13, 2010
for the past couple of days i am facing an issue where the first call from my ASP.NET 4 application (VS 2010 Web Site) hosted in IIS 7 to an XML web service is dead-slow. subsequent calls are fast until the AppDomain is restarted.
I have tried all solutions related to pre-generating the serializer assembly but nothing worked. Anyway THEN I was sure it is an IIS-only issue because if i consume the xml web service from a console .net application then all the calls are fast. its even fast from an ASP.NET web site NOT hosted in IIS instead running on the development server. SO clearly the problem is there only when my app is hosted in IIS.
View 1 Replies
Aug 31, 2010
I have a WCF REST service built with C# and it returns an image as part of a CPU intensive operation. The client is running on Android (Java) By default, it will return a text JSON object that looks something like this:
{"d",[9,0,77,12,11,...]}
Those are they bytes of the image. Fine. However, all the solutions for decoding this JSON are intolerably slow. I've tried Gson, Jackson, and the built-in Android JSONObject class. I have no idea why they are so slow.
As an alternative solution, I have my REST service return a GUID, and then that GUID can be used by the Android client to go to a regular URL that serves up the image as a regular binary stream, via an MVC controller.
This works well, and it fast, and is pretty easy to handle on the Android side. However, it does feel like a bit of kludge and kind of a violation of the REST design principles. Am I missing something here? Is there a better way to do this?
View 4 Replies
Aug 30, 2010
I have consumed an external webservice in my client application using WCF. And every thing works great in my Dev box(XP with IIS5.1)But when the same application is moved to Prod server(Win Server 2003 with IIS6.0) it fails. Below is the exception caught:
There was no endpoint listening at http://MyExternalWebServiceUrlWithSessionId could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.And the InnerException is: Unable to connect to the remote server.My Config file has the below settings:
[Code]....
View 1 Replies
May 20, 2010
I am consuming the java web service in .net client, when i sent a request to that web service, i am getting one exception in response object.It says "Client found response content type of 'text/plain', but expected 'text/xml'", along with this message i am getting the response in that exception.
View 2 Replies
Jun 30, 2010
I'm fairly new to .NET development so I might be missing something very simple here. I'm trying to set up a web service as a data item so that I can bind it to a control on my page. I was reading some tutorials about doing this in an earlier version which seemed very simple. All you had to do was add the web reference, create a data source and use the object type, pick the web service and enter the name of the call that would retrieve the data.
In 2008 the object data source type doesn't seem to be available anymore when creating a new item unde app_data. I get options for SQL Server, XML and XML schema. I've tried adding an existing source and picking each of the files generated for my web service reference, with no success. I suspect that I have to use one of the XML options, though at this point my web service is a simple thing that only returns some strings for prototyping purposes (I'm not the one writing the web service, just the front ends. Our other developer hasn't come up with a stub service yet). I know there must be some way to set a web service up as a business object so that you can bind it to a control like a gridview.
View 2 Replies
Apr 13, 2010
I've a quick question and request you all to respond soon. I've developed a web service with Form based authentication as below. 1.An entry in web.config as below. <authentication mode="Forms">
View 1 Replies
Jan 18, 2011
For example, we are going to consume web method GetEmployeeByQuery(ConnInfoXML, Query, RecordDetail), ConnInfoXML is login information in XML, Query is a SQL statement selecting records, RecordDetail is all records retrieved. All data are in XML format.
So how to write these parameters in XML to consume this web method and get all the information in XML, and then transfer XML to normal string format ?
View 1 Replies
Mar 29, 2011
Most WCF web service I have developed were consumed in a server side code (by adding a service reference in visual studio or creating a proxy class using svcutil.exe. I have never consumed a web service in a client code. So I apologize if I am using wrong terminology or my question does not make sense.We have a browser add-on or plugin that connect to a device on client computer (think of it as active-x control for internet explorer) inside a asp.net web page.This browser plugin/add-on then will be sending measurement data to the web server. After some research it appears to me that I can do eithera) Develop an AJAX enabled WCF web service and use script manager and javascript to consume it inside the web page that interact with browser pluginb) Develop a WCF web servcice (not sure about AJAX enable) that serialize request and response to JSON, and use JQuery inside asp.net page to consume it.QuestionWhat's difference between approach a) and b)? Which is better in particular scenario I have described.
View 4 Replies
Apr 20, 2010
I have a problem. I just enabled ssl on a web site, the technologies used is DotNetNuke, Asp.net, Window Server 2003, and IIS 6. I installed a certificate that was copied on the server through an email, and basically just clicked on the certificate and chose all the defaults.
I set up the certificate by goiong into the web site's properties -> Directory Security -> Server Certificate and choosing the option "Assign existing certificate" and I keep port 443 as the ssl port for the web site.
When i try to access the web site by entering the url [URL]
it shows "Internet Explorer Cannot display the web page" when I diagnose the problem, it says "The host may be down or it may not support a secure connection." I know the site is working by entering in the regular [URL]
Google Chrome gives a bit more information, it displays "Error 107 (net::ERR_SSL_PROTOCOL_ERROR): Unknown error."
Mozilla displays "The connection to somesite was interrupted while the page was loading."
View 1 Replies
Jun 17, 2010
Just getting started
I upgrade to VWD2010, installed the Ajax ToolKit.
All of the Ajax videos indicate in VWD2010, I'll get a template called AJAX Enabled Web site. I don't have this template in my VWD2010. Is there a way to get the AJAX Enabled Web Site Template in VWD2010?
View 10 Replies
Nov 16, 2010
I'm working on a CMS that can run either with or without https enabled on the webserver. I'd like to be able to detect whether https is enabled or not, so that I can act accordingly (for example, display some https-related options to the administrator, and redirect to https for administrator logins).
I'm not looking for Request.IsSecureConnection because that only tells me if the current request is via https. I want something that will tell me whether the current bindings for the site in IIS include a binding for https at the same domain as the current request is on. So, for example, even if the current request is for [URL] and thus not secure, I want to know whether [URL] would work so I can (for example) redirect the user to it if they log in as administrator.
I've had no luck looking for anything in System.Web.Configuration that will tell me about the bindings of the current site, though.
View 2 Replies
Aug 20, 2010
is this something basic or am I missing something?My ASP.NET (4.0) site has a web.config with URL rewrite rules. When I run it in debug mode (local webserver) all the URLs fail because the local web server does not recognize the rules (e.g. I have /register which maps to register.aspx etc.)Is there someway I can get the debug system to recognize my URL rewrite rules? Should I be doing something else?
View 2 Replies
Jan 28, 2011
I have this Aja.svc in my root folder
[ServiceContract(Namespace = "")]
[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)]
public class Aja
{
[WebGet]
[OperationContract]
public string Hi()
{
return "hi world!";
}
}
and I'm trying to do this: $.get('Aja.svc?method=Hi', function(d) { alert(d.d); }); In firebug I see that the result is HTTP Error 404.17 - Not Found The requested content appears to be script and will not be served by the static file handler. I use .net 3.5, jquery 1.4.4
View 1 Replies