curl命令发出";没有SOAPAction标题&引用;错误
我试图运行以下curl命令,但出现如下错误: 命令:curl命令发出";没有SOAPAction标题&引用;错误,curl,wsdl,Curl,Wsdl,我试图运行以下curl命令,但出现如下错误: 命令: curl -H "Content-Type: text/xml; charset=utf-8" \ -H "SOAPAction:" \ -d @amit.xml -X POST http://server-ip:8200/axis/services/SOAPRequestHandler 错误: <?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:so
curl -H "Content-Type: text/xml; charset=utf-8" \
-H "SOAPAction:" \
-d @amit.xml -X POST http://server-ip:8200/axis/services/SOAPRequestHandler
错误:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<soapenv:Fault>
<faultcode xmlns:ns1="http://xml.apache.org/axis/">ns1:Client.NoSOAPAction</faultcode>
<faultstring>no SOAPAction header!</faultstring>
<detail>
<ns2:hostname xmlns:ns2="http://xml.apache.org/axis/">stsosctwb10</ns2:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
ns1:Client.nosopacation
没有SOAPAction标题!
stsosctwb10
我读了几篇关于如何解决这个问题的文章,但没有任何帮助。在wsdl文件中,soapAction字段也是空的。下面是wsdl文件的内容:
<wsdl:operation name="processSync">
<wsdlsoap:operation soapAction=""/>
您能告诉我我的命令有什么问题吗?curl有一种特殊的语法,用于使用分号表示没有值的标题,请参阅: 如果发送没有值的自定义标头,则其标头必须以分号终止,例如-H“X-custom-header;”以发送“X-custom-header:” 但是,指定
-H“SOAPAction;”“
仍然会以无SOAPAction头结束!将消息发布到Axis Web服务时的消息。它适用于任何字符,如-H“SOAPAction:;”
或-H“SOAPAction:foo”
还要确保您的XML是有效的。在此处指定反SoapAction: curl--header“Content Type:text/xml;charset=UTF-8”--header“SOAPAction:ACTION\u YOU\u WANT\u TO\u CALL”--data@FILE\u NAME\u URL\u SOAP\u WEB\u服务端点 例如:
curl--header“Content Type:text/xml;charset=UTF-8”--header“SOAPAction:urn:my:service interaction:soap:soap:some action”--data@soap\u envelope.txt您试图从此行中获得什么:“-H”SOAPAction:\”?这难道不表明问题就在这里吗?尝试使用以下方法:为了根据curl命令的手册页测试WSDLA,-H选项是添加一个标题。因此,我使用此选项添加标题“SOAPAction”。此外,wsdl托管在客户机网络上,因此我无法使用SOAP UI或wsdlbrowser进行测试。我必须登录到连接所在的服务器&在那里我执行curl命令。