如何从 URL 触发 BluePrism 的可见 Web 服务?
How can a visible web service of BluePrism be triggered from URL?
我想将 BluePrism 的进程作为网络服务并使其可通过 API 调用进行调用。
我创建了一个进程并将其作为网络服务可见。
转到 URL 时可以看到 WSDL。
http://localhost:myPort/ws/CalcP?wsdl
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:blueprism:webservice:calcp" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="CalcPService" targetNamespace="urn:blueprism:webservice:calcp">
<wsdl:types>
<s:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:blueprism:webservice:calcp"/>
</wsdl:types>
<wsdl:message name="CalcPRequest"/>
<wsdl:message name="CalcPResponse"/>
<wsdl:portType name="CalcPPortType">
<wsdl:operation name="CalcP">
<wsdl:input message="tns:CalcPRequest"/>
<wsdl:output message="tns:CalcPResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CalcPSoapBinding" type="tns:CalcPPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CalcP">
<soap:operation soapAction="" style="rpc"/>
<wsdl:input>
<soap:body use="encoded" namespace="urn:blueprism:webservice:calcp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="urn:blueprism:webservice:calcp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CalcPService">
<wsdl:port name="CalcPSoap" binding="tns:CalcPSoapBinding">
<soap:address location="http://localhost:myPort/ws/CalcP"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
操作方法调用:
<wsdl:operation name="CalcP">...</wsdl:operation>
但是使用 URL 路径触发服务似乎不起作用:
http://localhost:myPort/ws/CalcP/CalcP
消息:ws GET 请求必须针对 WSDL
Blue Prism 生成的 SOAP API 仅响应 POST 请求。它响应的唯一 GET 请求(如您在错误文本中所见)是 WSDL 下载请求。
使用像 SoapUI 这样的实用程序根据提供的 WSDL 生成示例请求并在 POST 上测试它们。
这个结构对我有用
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:blueprism:webservice:CalcWS">
<soapenv:Header/>
<soapenv:Body>
<urn:Add soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<bpInstance xsi:type="xsd:string">auto</bpInstance>
<First xsi:type="xsd:decimal">5</First>
<Second xsi:type="xsd:decimal">9</Second>
</urn:Add>
</soapenv:Body>
</soapenv:Envelope>
我想将 BluePrism 的进程作为网络服务并使其可通过 API 调用进行调用。
我创建了一个进程并将其作为网络服务可见。 转到 URL 时可以看到 WSDL。 http://localhost:myPort/ws/CalcP?wsdl
<wsdl:definitions xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:blueprism:webservice:calcp" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" name="CalcPService" targetNamespace="urn:blueprism:webservice:calcp">
<wsdl:types>
<s:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="urn:blueprism:webservice:calcp"/>
</wsdl:types>
<wsdl:message name="CalcPRequest"/>
<wsdl:message name="CalcPResponse"/>
<wsdl:portType name="CalcPPortType">
<wsdl:operation name="CalcP">
<wsdl:input message="tns:CalcPRequest"/>
<wsdl:output message="tns:CalcPResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="CalcPSoapBinding" type="tns:CalcPPortType">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CalcP">
<soap:operation soapAction="" style="rpc"/>
<wsdl:input>
<soap:body use="encoded" namespace="urn:blueprism:webservice:calcp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:input>
<wsdl:output>
<soap:body use="encoded" namespace="urn:blueprism:webservice:calcp" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="CalcPService">
<wsdl:port name="CalcPSoap" binding="tns:CalcPSoapBinding">
<soap:address location="http://localhost:myPort/ws/CalcP"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
操作方法调用:
<wsdl:operation name="CalcP">...</wsdl:operation>
但是使用 URL 路径触发服务似乎不起作用: http://localhost:myPort/ws/CalcP/CalcP 消息:ws GET 请求必须针对 WSDL
Blue Prism 生成的 SOAP API 仅响应 POST 请求。它响应的唯一 GET 请求(如您在错误文本中所见)是 WSDL 下载请求。
使用像 SoapUI 这样的实用程序根据提供的 WSDL 生成示例请求并在 POST 上测试它们。
这个结构对我有用
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:blueprism:webservice:CalcWS">
<soapenv:Header/>
<soapenv:Body>
<urn:Add soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<bpInstance xsi:type="xsd:string">auto</bpInstance>
<First xsi:type="xsd:decimal">5</First>
<Second xsi:type="xsd:decimal">9</Second>
</urn:Add>
</soapenv:Body>
</soapenv:Envelope>