2017-09-27 8 views
0

私はWebサービスを呼び出す際に問題に直面しています。私の応答のための私の要素の名前は、WSDLの名前と同じではありません。しかし、要求のために、それは完全に動作します。私のWebサービス応答の名前空間が正しくありません

あなたはこれについて考えていますか?異なる名前が私にはうまく見えます。

これはWSDLです:

<?xml version="1.0" encoding="UTF-8"?> 
<definitions name="test-existence-muna-service" 
    targetNamespace="http://www.fimasys.com/fsb" 
    xmlns="http://schemas.xmlsoap.org/wsdl/" 
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
    xmlns:tns="http://www.fimasys.com/fsb" 
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"> 

    <types> 
     <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.fimasys.com/fsb"> 
      <element name="TestExistenceMuna_Input_Message"> 
       <complexType> 
        <sequence> 
         <element minOccurs="1" name="muna" type="string"/> 
        </sequence> 
       </complexType> 
      </element> 
      <element name="TestExistenceMuna_Output_Message"> 
       <complexType> 
        <sequence> 
         <element minOccurs="1" name="existenceMuna" type="boolean"/> 
        </sequence> 
       </complexType> 
      </element> 
     </schema> 
    </types> 

    <message name="TestExistenceMuna_Input_Message"> 
     <part name="parameters" element="tns:TestExistenceMuna_Input_Message"></part> 
    </message> 
    <message name="TestExistenceMuna_Output_Message"> 
     <part name="parameters" element="tns:TestExistenceMuna_Output_Message"></part> 
    </message> 

    <portType name="testExistenceMunaPortType"> 
     <operation name="getExistenceMuna"> 
      <input message="tns:TestExistenceMuna_Input_Message" /> 
      <output message="tns:TestExistenceMuna_Output_Message" /> 
     </operation> 
    </portType> 

    <binding name="testExistenceMunaBinding" type="tns:testExistenceMunaPortType"> 
     <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/> 
     <operation name="getExistenceMuna"> 
      <soap:operation soapAction="http://www.fimasys.com/fsb/getExistenceMuna" /> 
      <input> 
       <soap:body use="literal" /> 
      </input> 
      <output> 
       <soap:body use="literal" /> 
      </output> 
     </operation> 
    </binding> 

    <service name="test-existence-muna-service"> 
     <port binding="tns:testExistenceMunaBinding" name="testExistenceMunaPort"> 
      <soap:address location="http://0.0.0.0:8088/fsb/test-existence-muna-service/"/> 
     </port> 
    </service> 
</definitions> 

これはSOAPUIでリクエストです:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:fsb="http://www.fimasys.com/fsb"> 
    <soapenv:Header/> 
    <soapenv:Body> 
     <fsb:TestExistenceMuna_Input_Message> 
     <muna>07282166.12</muna> 
     </fsb:TestExistenceMuna_Input_Message> 
    </soapenv:Body> 
</soapenv:Envelope> 

これはSOAPUIのレスポンスです:

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> 
    <soap:Body> 
     <ns2:getExistenceMunaResponse xmlns:ns2="http://www.fimasys.com/fsb"> 
     <existenceMuna>true</existenceMuna> 
     </ns2:getExistenceMunaResponse> 
    </soap:Body> 
</soap:Envelope> 
+0

はどこかWSDLで 'getExixtenceMunaResponse'として参照あなたの応答の要素ではなく、名前空間についての詳細を読むことができますか? wsdlファイルを表示できますか? – bilak

+0

あなたの答えをありがとう。私は元の投稿を編集しました。 –

+0

実装にもアクセスできますか?いくつかのラッパーや要素の名前を変更する原因は何ですか? – bilak

答えて

0

あなたは間違いなく持っに関してれルックス要求と応答の接頭辞、すなわちfsbと対ns2、右?

同じ名前空間を使用している限り、どのプレフィックスを使用するかは関係ありません。要求と応答の両方を見ると、両方とも名前空間、つまりhttp://www.fimasys.com/fsbを指しています。

あなたはhere

+0

これはありがとうございます。私の本当の問題はWSDLです。私の応答はに設定されていますが、soapuiは代わりに ...入力はOKですが、WSDLとsoapuiでは