---
title: "Shell脚本调用WebService"
author: "godandghost"
date: "2013-10-14T16:01:04Z"
tags: ["WebService", "shell"]
categories: ["编程语言"]
slug: "shell-webservice"
draft: false
lastmod: "2013-10-14T16:01:04Z"
id: 1956750
url: "https://godandghost.iteye.com/blog/1956750"
---

使用wget命令访问WebService地址，并将返回值写入临时文件。


```java

url="${RPT_URL}"
wget -q -O file.tmp $url
local errorStr=`grep "Error" file.tmp`
local sucStr=`grep "Message" file.tmp`
rm -rf file.tmp

```