web-services

string in webclient class c# changed to uncorrect format

流过昼夜 提交于 2020-01-06 08:03:08
问题 I call my service in wcf as you can see : ClientRequest.Headers["Content-type"] = "application/json"; string result = ClientRequest.DownloadString(ServiceHostName + "/NajaService.svc/GetCarData/" + plaque); var javascriptserializer = new JavaScriptSerializer(); return javascriptserializer.Deserialize<NajaResult>(result); But the returned data is like this : {"CarColor":"آبي سير","CarModel":"1383","CarTip":"ال ايکس","CarType":"سواري","Chassis":"83844131","Family":"####",

Name Collision In Wsimport Generated Class And My Original Web Service Class

泄露秘密 提交于 2020-01-06 07:59:31
问题 I have a simple web service class defined as follows: package com.me.basiccalcws; import javax.jws.WebService; @WebService public class Calculator { public int add(int a, int b) { return a + b; } } I use the wsgen tool to generate a wsdl : wsgen -classpath ..\bin -wsdl -s src -r wsdl -d bin com.me.basiccalcws.Calculator Then I use wsimport to generate client stubs: wsimport -s src ..\_wsgen\wsdl\CalculatorService.wsdl The files that are generated after running wsimport are as follows: Add

Why doesn't webservice work manually?

∥☆過路亽.° 提交于 2020-01-06 07:30:31
问题 I have webservice that has more than one method. I use firefox soaclient plugin for test them. All methods work properly. These are normal until now. I wrote library on android for call these .net webservice. I have methods, first one prepares envelop, the other one calls method. All methods except one work with these way. I get prepared envelop from my lib for method that doesn't work and use this envelope on firefox soap client, it returns me response in correct way. My own method that

c# System.InvalidOperationException: The type foo was not expected

柔情痞子 提交于 2020-01-06 07:28:56
问题 This question is tied in with this other question that I asked I have this webservice that returns a class that within itself has a list of classes. When I try to call the method the following exception is being thrown: System.InvalidOperationException: The type YambushiDataClass.SCharacterProjectile was not expected. This is the class that it said it did not expect : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Xml.Serialization;

javascript sendfile binary data to web service

五迷三道 提交于 2020-01-06 07:28:16
问题 At work we are trying to upload files from a web page to a web service using html 5/javascript in the browser end and C# in the web service. But have some trouble with encoding of some sort. As for the javascript we get the file's binary data with help from a FileReader. var file = ... // gets the file from an input var fileReader = new FileReader(); fileReader.onload = dataRecieved; fileReader.readAsBinaryString(file); function dataRecieved() { // Here we do a normal jquery ajax post with

how to deal with this “unrecognized for URL…” problem?

≯℡__Kan透↙ 提交于 2020-01-06 07:09:21
问题 This is link which is explaining in detail, the problem i am facing right now. I am getting a frequent exception whenever a call made to my web services. It returns appropriate results but still complaining about URL format.:- Request format is unrecognized for URL unexpectedly ending in /WebServiceMethod So what do you suggest guys? Thanks. 回答1: There is quite a common issue that causes this error, that can easily be fixed by adding <configuration> <system.web> <webServices> <protocols> <add

how to deal with this “unrecognized for URL…” problem?

你离开我真会死。 提交于 2020-01-06 07:09:17
问题 This is link which is explaining in detail, the problem i am facing right now. I am getting a frequent exception whenever a call made to my web services. It returns appropriate results but still complaining about URL format.:- Request format is unrecognized for URL unexpectedly ending in /WebServiceMethod So what do you suggest guys? Thanks. 回答1: There is quite a common issue that causes this error, that can easily be fixed by adding <configuration> <system.web> <webServices> <protocols> <add

Webservice initialisation issue

时光总嘲笑我的痴心妄想 提交于 2020-01-06 07:06:31
问题 I have a simple web service. When I call my test method for the first time it takes about 5 seconds to respond and thereafter it takes very less time which is fine. But if my application stays idel for 5 mins and when i call the same method again it takes same amount of time took before to respond. How can I make it faster ? I tried by setting the keepalive = true and pre compiling and deploying, still no luck localhost.WebService1 svc = new WebSvcTest.localhost.WebService1(); private void

NullPointer Exception while calling webservice in play framework

╄→尐↘猪︶ㄣ 提交于 2020-01-06 07:05:16
问题 Anything wrong in this program ? I am getting nullPointerException while calling web service in play framework in version 2.4.3. package com.enkindle.box; import javax.inject.Inject; import play.libs.ws.WSClient; /** * @author thirumal * */ public class Sample { @Inject WSClient ws; public static void main(String[] args) { Sample sample = new Sample(); sample.callAPI(); } public void callAPI() { ws.url("www.thomas-bayer.com/sqlrest/CUSTOMER/").get(); } } 回答1: The issue is that your Sample

NullPointer Exception while calling webservice in play framework

霸气de小男生 提交于 2020-01-06 07:03:12
问题 Anything wrong in this program ? I am getting nullPointerException while calling web service in play framework in version 2.4.3. package com.enkindle.box; import javax.inject.Inject; import play.libs.ws.WSClient; /** * @author thirumal * */ public class Sample { @Inject WSClient ws; public static void main(String[] args) { Sample sample = new Sample(); sample.callAPI(); } public void callAPI() { ws.url("www.thomas-bayer.com/sqlrest/CUSTOMER/").get(); } } 回答1: The issue is that your Sample