Webサービス/WSHでWebサービス
をテンプレートにして作成
Search in
this wiki
and
or
[
トップ
] [
新規
|
一覧
|
単語検索
|
最終更新
|
ヘルプ
]
開始行:
***[[Microsoft SOAP Toolkit:http://www.microsoft.com/japa...
[[Microsoft SOAP Toolkit:http://www.microsoft.com/japan...
HelloWorld.js
var service = WScript.CreateObject("MSSOAP.SoapClient");
service.mssoapinit("http://localhost/WebService1/Service...
var result = service.HelloWorld();
WScript.Echo(result);
-WSDL取得とサービスリクエストの2回、HTTPのやり取りが発生...
-[[Apache Axis1.1との連携で不具合>Webサービス/inter-opera...
-引数、戻り値にComplexTypeを利用することが難しい。COMオブ...
***(余談)User-Agent
上記の方法でWSHからASP.NET Webサービスをコールしたとき...
WSDL取得の時のUser-Agentは「''IE6''」と名乗っていますが...
WSDLリクエスト
GET /WebService1/Service1.asmx?wsdl HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows N...
Host: localhost
Connection: Keep-Alive
WSDLレスポンス
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Mon, 29 Dec 2003 17:08:21 GMT
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 2006
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl...
xmlns:soap="http://schemas.xmlsoap.org/wsdl...
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://tempuri.org/"
xmlns:soapenc="http://schemas.xmlsoap.org/s...
xmlns:tm="http://microsoft.com/wsdl/mime/te...
xmlns:mime="http://schemas.xmlsoap.org/wsdl...
targetNamespace="http://tempuri.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified" targetNamesp...
<s:element name="HelloWorld">
<s:complexType />
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="...
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters" element="s0:HelloWorldRespons...
</message>
<portType name="Service1Soap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
</portType>
<binding name="Service1Soap" type="s0:Service1Soap">
<soap:binding transport="http://schemas.xmlsoap.org/s...
<operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/Hell...
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="Service1">
<port name="Service1Soap" binding="s0:Service1Soap">
<soap:address location="http://localhost/WebService...
</port>
</service>
</definitions>
サービスリクエスト
POST /WebService1/Service1.asmx HTTP/1.1
SOAPAction: "http://tempuri.org/HelloWorld"
Content-Type: text/xml
User-Agent: SOAP Sdk
Host: localhost
Content-Length: 224
Connection: Keep-Alive
Cache-Control: no-cache
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmls...
<SOAP-ENV:Body>
<HelloWorld xmlns="http://tempuri.org/"/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
サービスレスポンス
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.1
Date: Mon, 29 Dec 2003 17:08:21 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Mon, 29 Dec 2003 17:08:21 GMT
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 376
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/...
xmlns:xsi="http://www.w3.org/2001/XMLSc...
xmlns:xsd="http://www.w3.org/2001/XMLSc...
<soap:Body>
<HelloWorldResponse xmlns="http://tempuri.org/">
<HelloWorldResult>こんにちは、世界</HelloWorldRe...
</HelloWorldResponse>
</soap:Body>
</soap:Envelope>
ちなみに.NET WindowsアプリケーションからWebサービスをコ...
終了行:
***[[Microsoft SOAP Toolkit:http://www.microsoft.com/japa...
[[Microsoft SOAP Toolkit:http://www.microsoft.com/japan...
HelloWorld.js
var service = WScript.CreateObject("MSSOAP.SoapClient");
service.mssoapinit("http://localhost/WebService1/Service...
var result = service.HelloWorld();
WScript.Echo(result);
-WSDL取得とサービスリクエストの2回、HTTPのやり取りが発生...
-[[Apache Axis1.1との連携で不具合>Webサービス/inter-opera...
-引数、戻り値にComplexTypeを利用することが難しい。COMオブ...
***(余談)User-Agent
上記の方法でWSHからASP.NET Webサービスをコールしたとき...
WSDL取得の時のUser-Agentは「''IE6''」と名乗っていますが...
WSDLリクエスト
GET /WebService1/Service1.asmx?wsdl HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows N...
Host: localhost
Connection: Keep-Alive
WSDLレスポンス
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Mon, 29 Dec 2003 17:08:21 GMT
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 2006
<?xml version="1.0" encoding="utf-8"?>
<definitions xmlns:http="http://schemas.xmlsoap.org/wsdl...
xmlns:soap="http://schemas.xmlsoap.org/wsdl...
xmlns:s="http://www.w3.org/2001/XMLSchema"
xmlns:s0="http://tempuri.org/"
xmlns:soapenc="http://schemas.xmlsoap.org/s...
xmlns:tm="http://microsoft.com/wsdl/mime/te...
xmlns:mime="http://schemas.xmlsoap.org/wsdl...
targetNamespace="http://tempuri.org/"
xmlns="http://schemas.xmlsoap.org/wsdl/">
<types>
<s:schema elementFormDefault="qualified" targetNamesp...
<s:element name="HelloWorld">
<s:complexType />
</s:element>
<s:element name="HelloWorldResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="...
</s:sequence>
</s:complexType>
</s:element>
</s:schema>
</types>
<message name="HelloWorldSoapIn">
<part name="parameters" element="s0:HelloWorld" />
</message>
<message name="HelloWorldSoapOut">
<part name="parameters" element="s0:HelloWorldRespons...
</message>
<portType name="Service1Soap">
<operation name="HelloWorld">
<input message="s0:HelloWorldSoapIn" />
<output message="s0:HelloWorldSoapOut" />
</operation>
</portType>
<binding name="Service1Soap" type="s0:Service1Soap">
<soap:binding transport="http://schemas.xmlsoap.org/s...
<operation name="HelloWorld">
<soap:operation soapAction="http://tempuri.org/Hell...
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
</operation>
</binding>
<service name="Service1">
<port name="Service1Soap" binding="s0:Service1Soap">
<soap:address location="http://localhost/WebService...
</port>
</service>
</definitions>
サービスリクエスト
POST /WebService1/Service1.asmx HTTP/1.1
SOAPAction: "http://tempuri.org/HelloWorld"
Content-Type: text/xml
User-Agent: SOAP Sdk
Host: localhost
Content-Length: 224
Connection: Keep-Alive
Cache-Control: no-cache
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmls...
<SOAP-ENV:Body>
<HelloWorld xmlns="http://tempuri.org/"/>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
サービスレスポンス
HTTP/1.1 100 Continue
Server: Microsoft-IIS/5.1
Date: Mon, 29 Dec 2003 17:08:21 GMT
HTTP/1.1 200 OK
Server: Microsoft-IIS/5.1
Date: Mon, 29 Dec 2003 17:08:21 GMT
X-AspNet-Version: 1.1.4322
Cache-Control: private, max-age=0
Content-Type: text/xml; charset=utf-8
Content-Length: 376
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/...
xmlns:xsi="http://www.w3.org/2001/XMLSc...
xmlns:xsd="http://www.w3.org/2001/XMLSc...
<soap:Body>
<HelloWorldResponse xmlns="http://tempuri.org/">
<HelloWorldResult>こんにちは、世界</HelloWorldRe...
</HelloWorldResponse>
</soap:Body>
</soap:Envelope>
ちなみに.NET WindowsアプリケーションからWebサービスをコ...
ページ名: