2017-02-12 21 views
-1

当社は
数日前に、.NETベースのウェブサイトを持っている私たちは、私はローカルホストからのURLを開いたとき、彼は私にURL
を送っ当社のウェブサイトのプログラマと昨日からWebサービスを要求して示します私がプログラミングに要求している4つの方法(機能)のうちの1つを選択することができるページ。 1.1
次は、サンプルSOAP 1.1の要求および応答であるASMX HTTP POSTリクエスト

SOAP:それらのいずれかの新しいページを選択して
は、次のように恩恵を示しています。表示されるプレースホルダは実際の値に置き換える必要があります。

POST /webservices/findstatus.asmx HTTP/1.1ホスト:localhostの
のContent-Type:text/xmlで、文字セット= UTF-8のContent-Length:長さ
のSOAPAction: "http://tempuri.org/FindWith_CodeR_Serail"

<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
    <FindWith_CodeR_Serail xmlns="http://tempuri.org/"> 
     <CodeReception>int</CodeReception> 
     <Serial>string</Serial> 
    </FindWith_CodeR_Serail> 
    </soap:Body> 
</soap:Envelope> 

HTTP/1.1 200 OKのContent-Type:text/xmlで、 charset = UTF-8
のContent-Length:長さ1.2

以下
<?xml version="1.0" encoding="utf-8"?> 
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
    <FindWith_CodeR_SerailResponse xmlns="http://tempuri.org/"> 
     <FindWith_CodeR_SerailResult>string</FindWith_CodeR_SerailResult> 
    </FindWith_CodeR_SerailResponse> 
    </soap:Body> 
</soap:Envelope> 

SOAPサンプルSOAP 1.2の要求および応答です。表示されるプレースホルダは実際の値に置き換える必要があります。

POST /webservices/findstatus.asmx HTTP/1.1ホスト:localhostの
のContent-Type:アプリケーション/石鹸+ xmlの; charset = UTF-8のContent-Length:

<?xml version="1.0" encoding="utf-8"?> 
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> 
    <soap12:Body> 
    <FindWith_CodeR_Serail xmlns="http://tempuri.org/"> 
     <CodeReception>int</CodeReception> 
     <Serial>string</Serial> 
    </FindWith_CodeR_Serail> 
    </soap12:Body> 
</soap12:Envelope> 

HTTP/1.1 200 OKコンテンツタイプ:アプリケーション/石鹸+ xmlの。 charset = UTF-8
のContent-Length:長

<?xml version="1.0" encoding="utf-8"?> 
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> 
    <soap12:Body> 
    <FindWith_CodeR_SerailResponse xmlns="http://tempuri.org/"> 
     <FindWith_CodeR_SerailResult>string</FindWith_CodeR_SerailResult> 
    </FindWith_CodeR_SerailResponse> 
    </soap12:Body> 
</soap12:Envelope> 

HTTP POST
以下は、サンプルのHTTP POST要求および応答です。表示されるプレースホルダは実際の値に置き換える必要があります。

POST /webservices/findstatus.asmx/FindWith_CodeR_Serail HTTP/1.1
ホスト:ローカルホストコンテンツタイプ:application/x-www-form-urlencodedで
のContent-Length:長さCodeReception =ストリング&シリアル=ストリング
HTTP/1.1 200 OKコンテンツタイプ:text/xml;文字セット= UTF-8
のContent-Length:長さ

<?xml version="1.0" encoding="utf-8"?> 
<string xmlns="http://tempuri.org/">string</string> 

は今、私は私がそれを貼り付けることができ、完全なコードを送信してください2パラメータ
と、このWebサービスを呼び出すPHPコードに株式よテスト用のPHPファイル。 どのような方法を使用しても、SOAPまたはHTTP POST

私を助けてください。

私はこのPHPコードを使用し、すべてのものはOKです:

<?php 

$client = new SoapClient("http://www.MyWebSite.com/webservices/findstatus.asmx?WSDL"); 
$params=new stdClass(); 
$params->CodeReception = '11111'; 
$params->Serial = '22222222';  
$result = $client->FindWith_CodeR_Serail($params)->FindWith_CodeR_SerailResult; 
echo $result; 
?> 

答えて

0
<?php 

$client = new SoapClient("http://www.MyWebSite.com/webservices/findstatus.asmx?WSDL"); 
$params=new stdClass(); 
$params->CodeReception = '11111'; 
$params->Serial = '22222222';  
$result = $client->FindWith_CodeR_Serail($params)->FindWith_CodeR_SerailResult; 
echo $result; 
?> 
関連する問題