2012-03-12 8 views
1

みんな!SOAP :: Lite要素 'yyyy'の未解決のプレフィックス 'xxxx'

私は、SOAPでリクエストの応答を解析する際に問題があります:perlのLiteライブラリ。ここで

は私がSOAPで送信していますXML要求である:ここで

SOAP::Transport::HTTP::Client::send_receive: HTTP::Request=HASH(0x9c62028) 
SOAP::Transport::HTTP::Client::send_receive: POST https://109.235.185.235:8443/tvrauto   
HTTP/1.1 
Accept: text/xml 
Accept: multipart/* 
Accept: application/soap 
Content-Length: 571 
Content-Type: text/xml; charset=utf-8 
SOAPAction: "soapenv#PutCoord" 

<?xml version="1.0" encoding="UTF-8"?> 
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 

xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ws="soapenv" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"> 
<soapenv:Body> 
    <ws:PutCoord> 
    <ObjectID>79032058458</ObjectID> 
    <Coord time="2010-01-29T01:28:01Z" lon="37.754689" lat="55.6586458" speed="20.1" dir="301" valid="1"/> 
    </ws:PutCoord> 
</soapenv:Body> 
</soapenv:Envelope> 

は、リモートサーバーからのXML応答である:ここで

<?xml version="1.0" encoding="windows-1251"?> 
    <soapenv:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope"> 
    <soapenv:Header/> 
     <soapenv:Body> 
     <ws:PutCoordResponse> 
      <ObjectID>79032058458</ObjectID> 
     </ws:PutCoordResponse> 
     </soapenv:Body> 
    </soapenv:Envelope> 

は、SOAPからのエラーのリストです:: Liteの:

ここで
Unresolved prefix 'soapenv' for element 'Envelope' 
Wrong SOAP version specified. Supported versions: 
    1.1 (http://schemas.xmlsoap.org/soap/envelope/) 
    1.2 (http://www.w3.org/2003/05/soap-envelope) 
Unresolved prefix 'soapenv' for element 'Header' 
Unresolved prefix 'soapenv' for element 'Body' 
Unresolved prefix 'ws' for element 'PutCoordResponse' 

Perlのコードです:

#!/usr/bin/perl 

use SOAP::Lite +autodispatch; 
use SOAP::Lite +trace; 

use SOAP::Transport::HTTP; 

sub SOAP::Transport::HTTP::Client::get_basic_credentials { 
    return 'yyyyyy' => 'xxxxxxxxxx'; 
} 

$soap = SOAP::Lite 
    -> uri('soapenv') 
    -> proxy('https://109.235.185.235:8443/tvrauto'); 

$soap->default_ns('https://109.235.185.235:8443','soapenv'); 
$soap->ns('soapenv', 'ws'); 
$soap->envprefix('soapenv'); 
$soap->uri('soapenv'); 
$soap->soapversion('1.2'); 

$xml=<<XML; 
    <ObjectID>79032058458</ObjectID> 
    <Coord time="2010-01-29T01:28:01Z" lon="37.754689" lat="55.6586458" speed="20.1" dir="301" valid="1"/> 
XML 


$params=SOAP::Data->type('xml' => $xml); 

print $soap->PutCoord($params)->result; 
print "\n"; 

質問は「未解決の接頭辞」エラーを回避する方法です。私はウイスと名前空間を別の組み合わせで試してみましたが、結果は得られません。

そして、接続された質問 - SOAPバージョンの問題は何ですか?私が見ることができるように、サーバーはバージョン情報を私たちに返さなかった。

ありがとうございます。 。愚かな質問のため申し訳ありません - 私はあなたの返事を楽しみまったく:( SOAPと本当に慣れていないんだ

答えて

0

$ SOAPベース> SOAPVERSIONを使用しないでください( '1.2');

使用

$ SOAPベース> SOAPVERSION( '1.1');