`
jiguansheng
  • 浏览: 125447 次
  • 性别: Icon_minigender_1
  • 来自: 九江
社区版块
存档分类
最新评论
收藏列表
标题 标签 来源
联通VAC WebService接口
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:tns3="http://rsp.sync.soap.bossagent.vac.unicom.com" xmlns:impl="http://soap.bossagent.vac.unicom.com" xmlns:intf="http://soap.bossagent.vac.unicom.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns2="http://req.sync.soap.bossagent.vac.unicom.com" xmlns:tns4="http://type.sync.soap.bossagent.vac.unicom.com" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://soap.bossagent.vac.unicom.com">
	<wsdl:types>
		<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://req.sync.soap.bossagent.vac.unicom.com">
			<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
			<complexType name="OrderRelationUpdateNotifyRequest">
				<sequence>
					<element name="recordSequenceId" nillable="true" type="soapenc:string"/>
					<element name="userIdType" nillable="true" type="soapenc:int"/>
					<element name="userId" nillable="true" type="soapenc:string"/>
					<element name="serviceType" nillable="true" type="soapenc:string"/>
					<element name="spId" nillable="true" type="soapenc:string"/>
					<element name="productId" nillable="true" type="soapenc:string"/>
					<element name="updateType" nillable="true" type="soapenc:int"/>
					<element name="updateTime" nillable="true" type="soapenc:string"/>
					<element name="updateDesc" nillable="true" type="soapenc:string"/>
					<element name="linkId" nillable="true" type="soapenc:string"/>
					<element name="content" nillable="true" type="soapenc:string"/>
					<element name="effectiveDate" nillable="true" type="soapenc:string"/>
					<element name="expireDate" nillable="true" type="soapenc:string"/>
					<element name="time_stamp" nillable="true" type="soapenc:string"/>
					<element name="encodeStr" nillable="true" type="soapenc:string"/>
				</sequence>
			</complexType>
		</schema>
		<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://rsp.sync.soap.bossagent.vac.unicom.com">
			<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
			<complexType name="OrderRelationUpdateNotifyResponse">
				<sequence>
					<element name="recordSequenceId" nillable="true" type="soapenc:string"/>
					<element name="resultCode" type="xsd:int"/>
				</sequence>
			</complexType>
		</schema>
	</wsdl:types>
	<wsdl:message name="orderRelationUpdateNotifyRequest">
		<wsdl:part name="orderRelationUpdateNotifyRequest" type="tns2:OrderRelationUpdateNotifyRequest"/>
	</wsdl:message>
	<wsdl:message name="orderRelationUpdateNotifyResponse">
		<wsdl:part name="orderRelationUpdateNotifyReturn" type="tns3:OrderRelationUpdateNotifyResponse"/>
	</wsdl:message>
	<wsdl:portType name="SyncNotifySPService">
		<wsdl:operation name="orderRelationUpdateNotify" parameterOrder="orderRelationUpdateNotifyRequest">
			<wsdl:input name="orderRelationUpdateNotifyRequest" message="impl:orderRelationUpdateNotifyRequest"/>
			<wsdl:output name="orderRelationUpdateNotifyResponse" message="impl:orderRelationUpdateNotifyResponse"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="SyncNotifySPSoapBinding" type="impl:SyncNotifySPService">
		<wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="orderRelationUpdateNotify">
			<wsdlsoap:operation/>
			<wsdl:input>
				<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.bossagent.vac.unicom.com"/>
			</wsdl:input>
			<wsdl:output>
				<wsdlsoap:body use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://soap.bossagent.vac.unicom.com"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="SyncNotifySPServiceService">
		<wsdl:port name="SyncNotifySP" binding="impl:SyncNotifySPSoapBinding">
			<wsdlsoap:address location="http://localhost/services/VacSync"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>
android camera android_camera
Android实现摄像头拍照
2011年4月1日9:54来源:Android中文网我有话说(0)  如果你想在自己的应用中使用摄像头,需要在AndroidManifest.xml中增加以下代码:
  
  <uses-permissionandroid:name="android.permission.CAMERA"/>
  设定摄像头布局
  这是开发工作的基础,也就是说我们希望在应用程序中增加多少辅助性元素,如摄像头各种功能按钮等。在本文中我们采取最简方式,除了拍照外,没有多余摄像头功能。下面我们一起看一下本文示例将要用到的布局文件“camera_surface.xml”。
  
  <LinearLayoutxmlns:android="http://schemas.android.com/apk/res/android"
  
  android:layout_width="fill_parent"android:layout_height="fill_parent"
  
  androidrientation="vertical">
  
  <SurfaceViewandroid:id="@+id/surface_camera"
  
  android:layout_width="fill_parent"android:layout_height="10dip"
  
  android:layout_weight="1">
  
  </SurfaceView>
  
  </LinearLayout>
  小提示:记住不要在资源文件名称中使用大写字母,如果你把该文件命名为“CameraSurface.xml”,会给你带来不必要的麻烦。
  该布局非常简单,只有一个LinearLayout视图组,在它下面只有一个SurfaceView视图,也就是我们的摄像头屏幕。
  摄像头实现代码
  现在我们已经查看了摄像头的xml代码,下面再来看一下Android代码。让我们创建一个名为“CameraView”的Activity类,实现SurfaceHolder.Callback接口:
  
  publicclassCamaraViewextendsActivityimplementsSurfaceHolder.Callback
  接口SurfaceHolder.Callback被用来接收摄像头预览界面变化的信息。它实现了三个方法:
  surfaceChanged
  当预览界面的格式和大小发生改变时,该方法被调用。
  surfaceCreated
  初次实例化,预览界面被创建时,该方法被调用。
  surfaceDestroyed
  当预览界面被关闭时,该方法被调用。
  下面我们一起看一下在摄像头应用中如何使用这个接口,首先看一下在Activity类中的onCreate方法。
  
  super.onCreate(icicle);
  
  getWindow().setFormat(PixelFormat.TRANSLUCENT);
  
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
  
  WindowManager.LayoutParams.FLAG_FULLSCREEN);
  
  setContentView(R.layout.camera);
  
  mSurfaceView=(SurfaceView)findViewById(R.id.surface_camera);
  
  mSurfaceHolder=mSurfaceView.getHolder();
  
  mSurfaceHolder.addCallback(this);
  
  mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  
  }
  下面我们逐一对代码进行一下说明。
  
  getWindow().setFormat(PixelFormat.TRANSLUCENT);
  
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
  
  WindowManager.LayoutParams.FLAG_FULLSCREEN);
  通过上述代码,我们告诉屏幕两点信息:
  1、摄像头预览界面将通过全屏显示,没有“标题(title)”;
  2、屏幕格式为“半透明”。
  
  setContentView(R.layout.camera_surface);
  
  mSurfaceView=(SurfaceView)findViewById(R.id.surface_camera);
  在以上代码中,我们通过setContentView来设定Activity的布局为前面我们创建的camera_surface,并创建一个SurfaceView对象,从xml文件中获得它。
  
  mSurfaceHolder=mSurfaceView.getHolder();
  
  mSurfaceHolder.addCallback(this);
  
  mSurfaceHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
  通过以上代码,我们从surfaceview中获得了holder,并增加callback功能到“this”。这意味着我们的操作(activity)将可以管理这个surfaceview。
  我们看一下callback功能时如何实现的:
  
  publicvoidsurfaceCreated(SurfaceHolderholder){
  
  mCamera=Camera.open();
  
  mCamera是“Camera”类的一个对象。在surfaceCreated方法中我们“打开”摄像头。这就是启动它的方式。
  
  publicvoidsurfaceChanged(SurfaceHolderholder,intformat,intw,inth){
  
  if(mPreviewRunning){
  
  mCamera.stopPreview();
  
  }
  
  Camera.Parametersp=mCamera.getParameters();
  
  p.setPreviewSize(w,h);
  
  mCamera.setParameters(p);
  
  try{
  
  mCamera.setPreviewDisplay(holder);
  
  }catch(IOExceptione){
  
  e.printStackTrace();
  
  }
  
  mCamera.startPreview();
  
  mPreviewRunning=true;
  
  }
  该方法让摄像头做好拍照准备,设定它的参数,并开始在Android屏幕中启动预览画面。我使用了一个“semaphore”参数来防止冲突:当mPreviewRunning为true时,意味着摄像头处于激活状态,并未被关闭,因此我们可以使用它。
  
  
  
  publicvoidsurfaceDestroyed(SurfaceHolderholder){
  
  mCamera.stopPreview();
  
  mPreviewRunning=false;
  
  mCamera.release();
  
  }
  通过这个方法,我们停止摄像头,并释放相关的资源。正如大家所看到的,我们在这儿设置mPreviewRunning为false,以此来防止在surfaceChanged方法中的冲突。原因何在?因为这意味着我们已经关闭了摄像头,而且我们不能再设置其参数或在摄像头中启动图像预览。
  最后我们看一下本例中最重要的方法:
  
  Camera.PictureCallbackmPictureCallback=newCamera.PictureCallback(){
  
  publicvoidonPictureTaken(byte[]imageData,Camerac){
  
  }
  
  };
  当拍照时,该方法被调用。举例来说,你可以在界面上创建一个OnClickListener,当你点击屏幕时,调用PictureCallBack方法。这个方法会向你提供图像的字节数组,然后你可以使用Android提供的Bitmap和BitmapFactory类,将其从字节数组转换成你想要的图像格式。
Global site tag (gtag.js) - Google Analytics