У меня работает веб-сервис, который возвращает изображение и номер
Я хочу получить к нему доступ через Curl (потому что компания меня об этом попросила)
curl -v -XGET --user MYUSER:MYPASS --header "Content-Type: text/xml;charset=UTF-8" --data @my_xml.wsdl MYURL
My XML файл выглядит так:
< ?xml version="1.0" encoding="utf-8" ? >
< env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" >
< env:Body >
< n1:login xmlns:n1="urn:enterprise.soap.sforce.com" >
< n1:username>op</n1:username >
< n1:password>bg</n1:password >
< /n1:login >
< / env:Body >
< / env:Envelope >
, а затем они дали мне этот файл WSDL, который я не могу понять, для чего он нужен:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="urn:sap-com:document:sap:rfc:functions" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<wsdl:documentation>
<sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" />
</wsdl:documentation>
<wsp:UsingPolicy wsdl:required="true" />
<wsp:Policy wsu:Id="zws_pen">
<wsp:ExactlyOne xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
<wsp:All>
<sp:TransportBinding>
<wsp:Policy>
<sp:TransportToken>
<wsp:Policy>
<sp:HttpsToken>
<wsp:Policy>
<sp:HttpBasicAuthentication />
</wsp:Policy>
</sp:HttpsToken>
</wsp:Policy>
</sp:TransportToken>
<sp:AlgorithmSuite>
<wsp:Policy>
<sp:TripleDesRsa15 />
</wsp:Policy>
</sp:AlgorithmSuite>
<sp:Layout>
<wsp:Policy>
<sp:Strict />
</wsp:Policy>
</sp:Layout>
</wsp:Policy>
</sp:TransportBinding>
</wsp:All>
</wsp:ExactlyOne>
<saptrnbnd:OptimizedXMLTransfer xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" uri="http://xml.sap.com/2006/11/esi/esp/binxml" wsp:Optional="true" />
</wsp:Policy>
<wsp:Policy wsu:Id="if_zws_pecv">
<sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/">
<sapsession:enableSession>false</sapsession:enableSession>
</sapsession:Session>
<sapcentraladmin:CentralAdministration xmlns:sapcentraladmin="http://www.sap.com/webas/700/soap/features/CentralAdministration/" wsp:Optional="true">
<sapcentraladmin:BusinessApplicationID>511479EC35CF64CAE1000000AC100364</sapcentraladmin:BusinessApplicationID>
</sapcentraladmin:CentralAdministration>
</wsp:Policy>
<wsp:Policy wsu:Id="pend">
<sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/">false</sapcomhnd:enableCommit>
<sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking>
<saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required>
<saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM>
</wsp:Policy>
<wsdl:types>
<xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<xsd:simpleType name="char10">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="char17">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="17" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="char5">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="5" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="char6">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="6" />
</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType name="string">
<xsd:restriction base="xsd:string" />
</xsd:simpleType>
<xsd:complexType name="ZEBGRAUTHENTICATION">
<xsd:sequence>
<xsd:element name="TIPO" type="tns:char6" />
<xsd:element name="USERNAME" type="tns:char10" />
<xsd:element name="PASSWORD" type="tns:char10" />
</xsd:sequence>
</xsd:complexType>
<xsd:element name="imb_bed">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="AUTHENTICATION" type="tns:ZEBGRAUTHENTICATION" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="imb_bedResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="PENDING" type="tns:string" />
<xsd:element name="PHOTO" type="tns:string" />
<xsd:element name="REQUEST_NUMBER" type="tns:char17" />
<xsd:element name="STATUS" type="tns:char5" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="imb_bed">
<wsdl:part name="parameters" element="tns:imb_bed" />
</wsdl:message>
<wsdl:message name="imb_bedResponse">
<wsdl:part name="parameter" element="tns:imb_bedResponse" />
</wsdl:message>
<wsdl:portType name="imb_bed">
<wsp:Policy>
<wsp:PolicyReference URI="#if_zws_pecv" />
</wsp:Policy>
<wsdl:operation name="imb_bed">
<wsp:Policy>
<wsp:PolicyReference URI="#pend" />
</wsp:Policy>
<wsdl:input message="tns:ZF_PECV_BGR_IMG_PED_PENDENTE" />
<wsdl:output message="tns:ZF_PECV_BGR_IMG_PED_PENDENTEResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="imb_bed" type="tns:imb_bed">
<wsp:Policy>
<wsp:PolicyReference URI="#zws_pen" />
</wsp:Policy>
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" />
<wsdl:operation name="imb_bed">
<soap:operation soapAction="" style="document" />
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="imb_bedService">
<wsdl:port name="imb_bed" binding="tns:ZWS_PECV_BGR_IMG_PED_PENDENTE">
<soap:address location="URL" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Я думаю, что подключаюсь к веб-сервису. Требуется базовая c авторизация, а для доступа к веб-сервису нам нужны учетные данные xml. Но веб-сервис возвращает некоторую проблему и смотрит на сервер (у меня нет доступа к нему).
Я что-то не так делаю? В команде что ли?
Сообщение:
* upload completely sent off: 7271 out of 7271 bytes
* Mark bundle as not supporting multiuse
< HTTP/1.1 500 Internal Server Error
< set-cookie: sap-usercontext=sap-client=100; path=/
< content-type: text/xml; charset=utf-8
< content-length: 456
< accept: text/xml
< sap-srt_id: 20200527/235619/v1.00_final_6.40/367BDBBBE02A1EEAA88DA8EB8BCE5F01
< connection: close
<
<soap-env:Envelope xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"><soap-env:Header/><soap-env:Body><soap-env:Fault><faultcode>soap-env:Client</faultcode><faultstring xml:lang="en">Erro no processamento do Web Service; Outros detalhes no log de erros do Web Service do lado do provedor (Registro hora UTC 20200527225619; ID transação 5ECAE7BA52A951FAE1000000AC100365)</faultstring><detail/></soap-env:Fault></soap-env:Body></soap-env:Envelope>* Closing connection 0