2

SOAP API にリクエストを送信していますが、残念ながら SOAP に関する知識は限られています。次の 2 つの要求はどちらも応答を返しますが、応答は異なります。動作しない例では、send_fax_response のみが返されます。この作業は、send_fax_response と send_fax_result を返します。理由についてのアイデアはありますか?それは注文でしょうか?

動作していません

SOAP request: https://faxregistration.com/SfaxWS/SfaxAPI.asmx
SOAPAction: "http://tempuri.org/sendFax", Content-Type: text/xml;charset=UTF-8, User-Agent: sfax-api gem 0.0.1
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:wsdl="http://tempuri.org" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ins0="http://tempuri.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <ins0:sendFax>
      <ins0:xDoc>
        <FaxRequest>
          <DocMerge>false</DocMerge>
          <RecipientFax>555.123.4567</RecipientFax>
          <Password>test</Password>
          <UserId>test</UserId>
          <image>PGh0bWw+PGJvZHk+VGVzdCBGYXg8L2JvZHk+PC9odG1sPg==</image>
          <DocType>html</DocType>
          <RecipientName>test</RecipientName>
        </FaxRequest>
      </ins0:xDoc>
    </ins0:sendFax>
  </env:Body>
</env:Envelope>

働く

SOAP request: https://faxregistration.com/SfaxWS/SfaxAPI.asmx
SOAPAction: "http://tempuri.org/sendFax", Content-Type: text/xml;charset=UTF-8, User-Agent: sfax-api gem 0.0.1
<?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>
    <sendFax xmlns="http://tempuri.org/">
      <xDoc>
        <FaxRequest>
          <UserId>test</UserId>
          <Password>test</Password>
          <RecipientName>test</RecipientName>
          <RecipientFax>555.123.4567</RecipientFax>
          <DocType>html</DocType>
          <image>PGh0bWw+PGJvZHk+VGVzdCBGYXg8L2JvZHk+PC9odG1sPg==</image>
          <DocMerge>false</DocMerge>
        </FaxRequest>
      </xDoc>
    </sendFax>
  </soap:Body>
</soap:Envelope>
4

3 に答える 3

1

私はRailsにSavonを使用しています。SOAP リクエストは常に失敗し、生成されたリクエストにはenv:Envelopeがあるのに、実際の例にはsoap:Envelopeがあることに気付きました。機能していないSOAP リクエストを機能する SOAP リクエストにするにはどうすればよいですか? 助けてください :)

于 2011-08-26T09:47:23.583 に答える
1

あなたの石鹸サーバーは本体を期待していると思います。つまり、要素内<sendFax>http://tempuri.org名前空間が定義されている必要があります。そうであれば、not_working SOAP リクエストでボディを変更することもできます。

<ins0:sendFax ins0:"http://tempuri.org/">
  <ins0:xDoc>
    <FaxRequest>
      <DocMerge>false</DocMerge>
      <RecipientFax>555.123.4567</RecipientFax>
      <Password>test</Password>
      <UserId>test</UserId>
      <image>PGh0bWw+PGJvZHk+VGVzdCBGYXg8L2JvZHk+PC9odG1sPg==</image>
      <DocType>html</DocType>
      <RecipientName>test</RecipientName>
    </FaxRequest>
  </ins0:xDoc>
</ins0:sendFax>
于 2011-08-25T01:42:39.087 に答える
1

最初に気付くのは、リクエストの最初の行がenv:Envelope「動作していません」の例とsoap:Envelope「動作している」の例にあることです。

それとは別に、このタグにも欠けている属性がいくつかあります。それらは重要かもしれませんが、破損を引き起こしているのはその外側の要素の命名だと思います.

于 2011-08-25T00:29:35.460 に答える