WCF / ASMX :: Consuming Freight Price Calculation Webservice?
Jul 13, 2010
how to consume a webservice from Brazilian Correios (kind of USA Fedex).
The Web Service address is [URL]
The instructions says that I need to use the method CalcPrecoPrazo and send those parameters listed below (I already filled the variables with the correct content to help you use that webservice).
Dim nCdEmpresa As String = ""
Dim sDsSenha As String = ""
Dim nCdServico As String = "41106"
Dim sCepOrigem As String = "87047130"
Dim sCepDestino As String = "80610320"
Dim nVIPeso As Decimal = 1
Dim nCDFormato As Integer = 1
Dim nVIComprimento As Decimal = 20
Dim nVIAltura As Decimal = 30
Dim nVILargura As Decimal = 30
Dim nVIDiametro As Decimal = 0
Dim sCdMaoPropria As String = "N"
Dim nVIValorDeclarado As Decimal = 0
Dim sCdAvisoRecebimento As String = "N"
The result will be send by the parameter RESULTADO.SERVICOS in a array format.
View 3 Replies
Similar Messages:
Jan 4, 2011
I want to pass some values to price method of provided webservice, but the parameter schema is like this:
[Code]....
how I must send the price parameter value? in array or as a class?
View 1 Replies
Jun 18, 2010
I am trying to consume a webservice. I added the web reference. But when i try to access the method, I am getting the error as:"The request failed with HTTP status 401: Unauthorized."The web service has username as "user1", password as "pass".I tried this:
Service1.TestPrcsService serv = new Service1.TestPrcsService();
serv.PreAuthenticate = true;
serv.Custom_methodname(true);
How to pass the username and password to access the method?
View 2 Replies
Sep 6, 2010
I'm developing a .NET application using .NET 3.5 .My application is using a JAVA
WebService (wsdl url)
When I run the application I want to consume the web service (wsdl file) written in XML. i either keep getting the Operation Time out Error or the following exception while debugging
Possible SOAP version mismatch: Envelope namespace
http://schemas.xmlsoap.org/wsdl/ was unexpected.
View 2 Replies
Mar 18, 2010
I am trying to consume an array of strings from a webservice that I wrote. I keep getting the error: "System.NullReferenceException: Object reference not set to an instance of an object."
I know I am doing some thing wrong at an extremely basic level, but it's not coming to me.
I have tried adding New but get the error that you can't declare arrays with New
Here is the dummed down webservice method:<WebMethod( _
Description:="Testing ")> _
Public Function TestArray(ByVal Address1 As String, ByVal zip As String) As String()
Dim strTest(4) As String
strTest(0) = "It's"
strTest(1) = "a"
strTest(2) = "great"
strTest(3) = "day"
Return strTest
End Function
<--Here is the call that generates the null reference error-->
Private Sub FindAddress()
Dim svc As ws.Service
Dim strAddresses() As String
strAddresses = svc.TestArray(txtAddress.Text, txtZip.Text)
End Sub
View 3 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
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
Apr 5, 2010
I want to know can php client consume asp.net web services with
1: returning basic types int, string etc.
2: returning DataSets
View 5 Replies
Sep 13, 2010
i am a share thader and a develpoer i want a web service which can give me opening and closing price of a particular company.i use the side www.moneycontrol.com for share threading.threading start at 9amand cloase at 4pm.so on this time a webservice shold give me at what price shareof reliance open at 9am and at what price share of reliance close at 4pm.is it possible and at 4 pm in closing time of share market price of reliance share is 400Rupee.so how i can determine with the help of web service
View 3 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
Aug 26, 2010
I wrote some webservices in my solution and it works fine when i consume it in my local machine... BUT when i deploy it in the public IP and using https. I'm not able to consume the webservices i got a "The provided URI scheme 'https' is invalid; expected 'http'. Parameter name: via" Error...
I tried to change my configuration in my web app from security mode="None" into security mode = "transport" and I got an error... (forgot to log the error)
Note* I'm using virtual IIS (this is where i test my project)
View 2 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 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
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
May 3, 2010
I've been trying off and on with no success to get VWD-2008 to (deserialize?) a usable object from a PHP SOAP service that returns a serialized associative array (key/value). Client only, BTW I do not have access to change the service itself.
I DO get a response as an XmlNode[] (sample below). I would just shrug and parse the XML manually (shudder) but since all the elements are named "item", "key", or "value", and then they nest in themselves, this will get really hairy. Especially, since there are a bunch of different functions from this same service that I'd like to use, and almost all of them return an associative array.
If I understand this right, the response doesn't deserialize the associative array The HelloWorld test in the WSDL works fine. From what I gather, the SoapFormatter won't deserialize generics. To be truthful, my understanding of processing data at this level in .Net is sketchy and tenuous at best, but I'll do whatever I have to do to get a workable result from this.
In theory, I should be able to use the XmlSerializer to deserialize to an IDictionary Hashtable or the like, but I'm at a loss as to how I would go about doing that. Do I have to intercept the IDE generated SOAP call? Do I have to hack the WSDL? I've even tried writing a custom class to dump the response into just so I can use it, but I've yet to pull it off, and I've got more than one or two of these to do. I've hit forum after forum and have not found where anyone has give a successful answer to this recurring issue.
The really irritating part is that it is only 3 lines of code in PHP to declare, call, and consume the service to get a usable object and I'm giving myself fits to do it in C#. It CAN'T be THIS hard to do it!
Basic format is the Java Hashtable here:
http://www.ibm.com/developerworks/webservices/library/ws-soapmap1/
XML Node array response:
[Code]....
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
Nov 10, 2010
On my page I have a dropdown for country.
On my asmx service I want to get the value of the dropdownlist to filter the next input which will be state/providence.
My code on the asmx:
[Code]....
I want to add another clause to the WHERE statement to restrict Country = @Country so I will need to get that value to the web service.
View 2 Replies
Jan 7, 2010
I'm building an application, my client wants me to create new control using AJAX. This control should look like thisThis control includes price(dolars and cents) and when user clicks on specific price(suppose 95 dolars and 33 cents) this price should jump inside to textboxs(one for dolars and one for cents)Does anybody have a clue how to implement this control creation??
View 4 Replies
Feb 24, 2011
I have datatable consist of 20 records and i want to bulk insert into sqlserver through the asmx webservice. Can anybody guide to me or provide Sample BusinessLogic and webservice code.
View 1 Replies