我正在使用Eclipse IDE开发一个Android应用程序.我正在尝试连接到.net webservice.我正在使用ksoap2版本2.3
当我调用没有参数的web方法时,它工作正常.当我将参数传递给webmethod时,我得到null(在调试我发现的web服务时),我从客户端代码中的webmethod得到一个null.
码:
package com.examples.hello;
import org.ksoap2.SoapEnvelope;
import org.ksoap2.serialization.PropertyInfo;
import org.ksoap2.serialization.SoapObject;
import org.ksoap2.serialization.SoapSerializationEnvelope;
import org.ksoap2.transport.HttpTransportSE;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
public class HelloActivity extends Activity {
/** Called when the activity is first created. */
private static final String SOAP_ACTION = "http://Innovation/HRService/stringBs";
private static final String METHOD_NAME = "stringBs";
private static final String NAMESPACE = "http://Innovation/HRService/";
private static final String URL = "http://196.205.5.170/mdl/hrservice.asmx";
TextView tv;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
tv=(TextView)findViewById(R.id.text1);
call();
}
public …Run Code Online (Sandbox Code Playgroud) 我有谷歌正式工作的oauth授权,我从联系人api获取数据.现在,我想以编程方式获取gmail用户的名字,姓氏和图片.哪个google api可以用来获取这些数据?
想象一下,我在C-land,我有
void* my_alloc(size_t size);
void* my_free(void*);
Run Code Online (Sandbox Code Playgroud)
然后我可以浏览我的代码并用my_alloc/my_free替换所有对malloc/free的调用.
怎么,我知道给了一个Foo课,我可以做新的安置; 我也可以重载新运算符.但是,有没有办法为我的所有 C++类做到这一点?(即我想为新的和新的[]使用我自己的分配器;但我不想破解并破解我定义的每个类.)
谢谢!
使用linq数据上下文的最佳方法是什么?链接如何与sql连接一起工作(何时打开连接以及何时关闭连接)?当我使用数据上下文时,我是否应该使用using语句?
对不起,问题列表.提前致谢.
java.lang.IllegalStateException来自Java文档的描述:
表示在非法或不适当的时间调用了方法.换句话说,Java环境或Java应用程序未处于所请求操作的适当状态.
IllegalStateException在.NET框架中是否有相同的东西?
我想在验证业务对象时显示警告和错误,并将这些信息以可视方式显示给用户.
例如,我有一个实现如下界面的业务对象类:
interface IOrderItem : IDataErrorInfo
{
int ProductId { get; set; }
string ProductName { get; set; }
decimal Price { get; set; }
IDictionary<string, string> Warnings { get; }
}
Run Code Online (Sandbox Code Playgroud)
这与用户界面绑定如下:
<TextBox Text="{Binding Price, ValidatesOnDataErrors=True}/>
Run Code Online (Sandbox Code Playgroud)
错误是:
当我使用IDataErrorInfo界面将错误消息放在业务对象上时,这很好地工作并在文本框周围绘制一个红色边框.
我想做的还是指定警告,例如:
这些警告会在文本框周围放置橙色边框,并告知用户可能存在问题但不会阻止它们继续运行.
警告以类似的方式存储在映射PropertyName => WarningMessage的字符串字典中IDataErrorInfo.
问题:最好的方法是什么?
如何在Eclipse 3.5中使用eclox?
我正在使用Ubuntu 9.04.我从ubuntu存储库安装了Doxygen(版本1.5.8).然后我通过更新站点在eclipse上安装了eclox.
尽管如此,我没有任何选项可以在任何菜单中启动它.
此外,eclox网站似乎没有任何"入门"指南.
请帮忙.
我是java和OpenGL的新手.
我正在尝试使用能够同时显示3d对象的相机预览屏幕.通过api演示中的示例,我认为在api演示中组合示例的代码就足够了.但不知何故它不起作用.强制我在启动时关闭,错误被称为空指针异常.有人可以和我分享我哪里出错了以及如何从那里开始.我如何为代码组合如下所示:
myoverview.xml
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<android.opengl.GLSurfaceView
android:id="@+id/cubes"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
<SurfaceView
android:id="@+id/camera"
android:layout_width="fill_parent"
android:layout_height="fill_parent"/>
</FrameLayout>
Run Code Online (Sandbox Code Playgroud)
myoverview.java
import android.app.Activity;
import android.os.Bundle;
import android.view.SurfaceView;
import android.view.Window;
public class MyOverView extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
// Hide the window title.
requestWindowFeature(Window.FEATURE_NO_TITLE);
// camera view as the background
SurfaceView cameraView = (SurfaceView) findViewById(R.id.camera);
cameraView = new CameraView(this);
// visual of both cubes
GLSurfaceView cubesView = (GLSurfaceView) findViewById(R.id.cubes);
cubesView = new GLSurfaceView(this);
cubesView.setRenderer(new CubeRenderer(false)); …Run Code Online (Sandbox Code Playgroud) 我想,我把手远离德尔福太久了.在过去的几年里,我一直忙于Java和PHP.现在,当我回到做一点Delphi工作时,我意识到我真的很想念Java和PHP都支持的条件运算符.
在Delphi程序中你会找到多少个这样的行?
var s : string;
begin
...<here the string result is manipulated>...
if combo.Text='' then
s := 'null'
else
s := QuotedStr(combo.Text);
result := result + s;
end;
Run Code Online (Sandbox Code Playgroud)
哪里很简单
result := result + (combo.text='')?'null':quotedStr(combo.text);
Run Code Online (Sandbox Code Playgroud)
就够了 我喜欢这个,它不仅缩短了代码,这样我也避免声明一些辅助s:string变量.
为什么条件运算符不是Delphi的一部分 - 它们是否会得到支持?我注意到2009版Delphi(泛型)有很多语言扩展,为什么不添加这个功能呢?
为什么JavaScript返回错误的数组长度?
var myarray = ['0','1'];
delete myarray[0];
alert(myarray.length); //gives you 2
Run Code Online (Sandbox Code Playgroud) .net ×2
android ×2
java ×2
arrays ×1
c# ×1
c++ ×1
constructor ×1
delphi ×1
delphi-2009 ×1
doxygen ×1
eclipse ×1
exception ×1
google-api ×1
javascript ×1
ksoap2 ×1
linq-to-sql ×1
new-operator ×1
oauth ×1
parameters ×1
surfaceview ×1
web-services ×1
wpf ×1