我想通過C調用webservice。我不能使用任何現有的庫。所以我打開Tomcat端口8080上的套接字(某些應用程序在Tomcat上運行)。通過HTTP在C套接字中發送的SOAP消息
我發送HTTP POST請求來經由插座,其包括SOAP消息的Tomcat。我能夠調用webservice,但無法接收以SOAP形式發送的數據。這裏是一個HTTP請求與SOAP,我通過套接字發送給Tomcat
POST http://hostip.com:8080/APP/WebServiceName HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://www.companyname.com/webservices"
User-Agent: Jakarta Commons-HttpClient/3.1
Host: 192.168.50.151
Content-Length: length
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:web="http://www.company.com/webservices">
<soapenv:Header/>
<soapenv:Body>
<web:DataRequest>
<web:Scope>iOWNjuYroYC6HB</web:Scope>
<web:Source>
<web:ChildLine>
<web:ID>RnUNjuYroYC6HB</web:ID>
<web:Matrix>15</web:Matrix>
</web:ChildLine>
</web:Source>
<web:UserVariables>
<web:Variable>
<web:Key>Rule</web:Key>
<web:Value>Working</web:Value>
</web:Variable>
<web:Variable>
<web:Key>543</web:Key>
<web:Value>96</web:Value>
</web:Variable>
</web:UserVariables>
</web:DataRequest>
</soapenv:Body>
</soapenv:Envelope>
歡迎來到stackoverflow.com。請花些時間閱讀[幫助頁面](http://stackoverflow.com/help),尤其是名爲[「我可以問些什麼話題?」]的章節(http://stackoverflow.com/help/)討論話題)和[「我應該避免問什麼類型的問題?」](http://stackoverflow.com/help/dont-ask)。更重要的是,請閱讀[Stack Overflow問題清單](http://meta.stackexchange.com/questions/156810/stack-overflow-question-checklist)。您可能還想了解如何創建[最小化,完整和可驗證的示例](http://stackoverflow.com/help/mcve)。 –