2013年10月7日 星期一

[SOAP] 使用 curl,測試 Soap Service

1. Write soap Request in sample.xml
<?xml version=\"1.0\" encoding=\"UTF-8\"?>
  <SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:ns="urn:xxxx">"

      <SOAP-ENV:Body>
        <getFile> 
          <ID>jesse</ID>
          <FileName>/test</FileName>      
        </getFile>
      </SOAP-ENV:Body>

    </SOAP-ENV:Envelope>

2. curl command
curl -v\
  --header "content-type: text/soap+xml; charset=utf-8" \
  --data @sample.xml \
  http://[ip]:[port]/[directionary]


3. Result


Reference :
[1] Test a SOAP web service using curl

沒有留言:

張貼留言