这是我尝试连接并使用其中一些操作的 Web 服务 URL。要使用的操作是 RealTimeTransaction。此方法接受一个输入 Corerealtimerequest 对象并返回一个 CoreRealtimeResposne 对象。一切都很好。Web 服务返回一个 Fiddler 能够捕获的肥皂响应,但代理返回 null。
此 wsdl 包含许多未解析的链接。当我将所有出现的 b2borexatest 更改为 orseviceb2btest 时,wsdl 引用就解决了。服务 url 中共有 4 个对 b2borextest 的引用。通过这样做,我能够使用 svcutil 创建一个代理类。
https://b2borexatest.oracleoutsourcing.com/soa-infra/services/default/MMISSOAPRequestReceiver!1.0/CORERule220.wsdl
to
https://orserviceb2btest.oracleoutsourcing.com/soa-infra/services/default/MMISSOAPRequestReceiver!1.0/CORERule220.wsdl
这就是这些对象在 wsdl 中的定义方式
<types>-<xsd:schema xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://www.caqh.org/SOAP/WSDL/" elementFormDefault="qualified">
<xsd:import schemaLocation="https://b2borexatest.oracleoutsourcing.com:443/soa-infra/services/default/MMISSOAPRequestReceiver!1.0*soa_d48cf4e0-5e7b-43ad-b430-727180d48841/RouteEDITransactions_ep?XSD=xsd/CORERule2.2.0.xsd" namespace="http://www.caqh.org/SOAP/WSDL/CORERule2.2.0.xsd"/>
</xsd:schema>
</types>-<message name="RealTimeRequestMessage">
<part name="body" element="CORE-XSD:COREEnvelopeRealTimeRequest"/>
</message>
<message name="RealTimeResponseMessage">
<part name="body" element="CORE-XSD:COREEnvelopeRealTimeResponse"/>
</message>
这是soap的一部分:Fiddler请求中的Body看起来像
`<s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<COREEnvelopeRealTimeRequest xmlns="http://www.caqh.org/SOAP/WSDL/CORERule2.2.0.xsd">
<PayloadType xmlns="">X12_270_Request_005010X279A1</PayloadType>
<ProcessingMode xmlns="">RealTime</ProcessingMode><PayloadID xmlns="">461726944</PayloadID>
<TimeStamp xmlns="">2013-07-23T07:35:22Z</TimeStamp>
<SenderID xmlns="">SID</SenderID>
<ReceiverID xmlns="">RID</ReceiverID>
<CORERuleVersion xmlns="">`
来自 Soap UI 或 Fiddler 的响应。我对 COreRealtimResponse 感兴趣的对象。当我使用代理调用服务方法时,这个为空。
HTTP/1.1 200 OK
Date: Fri, 19 Jul 2013 21:10:32 GMT
Server: Oracle-Application-Server-11g
Content-Length: 3030
Set-Cookie: JSESSIONID=; expires=Thu, 01-Jan-1970 01:00:00 GMT; path=/; HttpOnly
Set-Cookie: _WL_AUTHCOOKIE_JSESSIONID=; expires=Thu, 01-Jan-1970 01:00:00 GMT; path=/; secure; HttpOnly
X-ORACLE-DMS-ECID: 004sUF1pzHw9PdyN06aAUF00037x000S4e
SOAPAction: ""
X-Powered-By: Servlet/2.5 JSP/2.1
Keep-Alive: timeout=5, max=100
Connection: Keep-Alive
Content-Type: multipart/related;type="application/xop+xml";boundary="----=_Part_52_444854407.1374268236586";start="<283134dc77544061b8c4d5788ee9bd44>";start-info="text/xml"
Content-Language: en
------=_Part_52_444854407.1374268236586
Content-Type: application/xop+xml;charset=UTF-8;type="text/xml"
Content-Transfer-Encoding: 8bit
Content-ID: <283134dc77544061b8c4d5788ee9bd44>
<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" <env:Body>
<COREEnvelopeRealTimeResponse xmlns:cor="http://www.caqh.org/SOAP/WSDL/CORERule2.2.0.xsd" xmlns="http://www.caqh.org/SOAP/WSDL/CORERule2.2.0.xsd"><cor:PayloadType>X12_271_Response_005010X279A1</cor:PayloadType><cor:ProcessingMode>RealTime</cor:ProcessingMode>
<cor:PayloadID>339408072</cor:PayloadID>
<cor:TimeStamp>2013-07-19T16:10:36.517-05:00</cor:TimeStamp>
<cor:SenderID>SID</cor:SenderID>
<cor:ReceiverID>RECID</cor:ReceiverID>
<cor:CORERuleVersion>2.2.0</cor:CORERuleVersion>
<cor:Payload>ISA*00* *00* ~</cor:Payload>
<cor:ErrorCode>Successful</cor:ErrorCode>
<cor:ErrorMessage>Envelope was processed successfully</cor:ErrorMessage>
</COREEnvelopeRealTimeResponse>
</env:Body>
</env:Envelope>
------=_Part_52_444854407.1374268236586--
代码:
var ORrealTimeTrans = new ORMCDProxy.COREEnvelopeRealTimeRequest()
{
PayloadType = "X12_270_Request_005010X279A1",
ProcessingMode = procMode,
PayloadID = InterchangeControlNumber,
CORERuleVersion = ruleVersion,
SenderID = senderId,
ReceiverID = receiverId,
TimeStamp = DateTime.UtcNow.ToString("yyyy-MM-ddThh:mm:22Z"),
Payload = Query270
};
ORMCDProxy.COREEnvelopeRealTimeResponse resp = ORMCDProxy.RealTimeTransaction(ORrealTimeTrans);
此响应对象为空。
http://webservices20.blogspot.com/2008/10/interoperability-gotcha-visual-studio.html记录了问题和解决方案是添加 Web 引用而不是服务引用。
但这对我来说不是一个选项,因为服务 wsdl 有未解析的链接,我无法控制它。