C# 在C中使用Amadeus Soap4.0#
C#代码: 请求:C# 在C中使用Amadeus Soap4.0#,c#,soap,amadeus,C#,Soap,Amadeus,C#代码: 请求: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://xml.amadeus.com/2010/06/Security_v1" xmlns:typ="http://xml.amadeus.com/2010/06/Types_v1" xmlns:iat="http://www.iata.org/IATA/2007/00/IATA2010.1
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sec="http://xml.amadeus.com/2010/06/Security_v1" xmlns:typ="http://xml.amadeus.com/2010/06/Types_v1" xmlns:iat="http://www.iata.org/IATA/2007/00/IATA2010.1" xmlns:app="http://xml.amadeus.com/2010/06/AppMdw_CommonTypes_v3" xmlns:link="http://wsdl.amadeus.com/2010/06/ws/Link_v1" xmlns:ses="http://xml.amadeus.com/2010/06/Session_v3" xmlns:fmp="http://xml.amadeus.com/FMPTBQ_14_3_1A">
<soapenv:Header>
<add:MessageID xmlns:add="http://www.w3.org/2005/08/addressing">29e8e874-3033-dd52-6b75-a2da58e10291</add:MessageID>
<add:Action xmlns:add="http://www.w3.org/2005/08/addressing">http://webservices.amadeus.com/fmptbq_14_3_1A</add:Action>
<add:To xmlns:add="http://www.w3.org/2005/08/addressing">https://noded1.test.webservices.amadeus.com/1asiwmlfpnp</add:To>
<link:TransactionFlowLink xmlns:link="http://wsdl.amadeus.com/2010/06/ws/Link_v1"/>
<oas:Security xmlns:oas="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<oas:UsernameToken oas1:Id="UsernameToken-1" xmlns:oas1="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<oas:Username>WSPNPMLF</oas:Username>
<oas:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">bTEzbk5LNElzZw==</oas:Nonce>
<oas:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">5lkky7mUVRujQPg4blzfKi5dSyg=</oas:Password>
<oas1:Created>2017-12-15T13:43:34:532Z</oas1:Created>
</oas:UsernameToken>
</oas:Security>
<AMA_SecurityHostedUser xmlns="http://xml.amadeus.com/2010/06/Security_v1">
<UserID AgentDutyCode="SU" POS_Type="1" PseudoCityCode="BLRVS32CY" RequestorType="U"/>
</AMA_SecurityHostedUser>
</soapenv:Header>
<soapenv:Body>
<Fare_MasterPricerTravelBoardSearch>
<numberOfUnit>
<unitNumberDetail>
<numberOfUnits>1</numberOfUnits>
<typeOfUnit>PX</typeOfUnit>
</unitNumberDetail>
<unitNumberDetail>
<numberOfUnits>250</numberOfUnits>
<typeOfUnit>RC</typeOfUnit>
</unitNumberDetail>
</numberOfUnit>
<paxReference>
<ptc>ADT</ptc>
<traveller>
<ref>1</ref>
</traveller>
</paxReference>
<fareOptions>
<pricingTickInfo>
<pricingTicketing>
<priceType>RP</priceType>
<priceType>RU</priceType>
<priceType>TAC</priceType>
<priceType>ET</priceType>
</pricingTicketing>
</pricingTickInfo>
</fareOptions>
<travelFlightInfo>
<cabinId>
<cabinQualifier>RC</cabinQualifier>
<cabin>Y</cabin>
</cabinId>
</travelFlightInfo>
<itinerary>
<requestedSegmentRef>
<segRef>1</segRef>
</requestedSegmentRef>
<departureLocalization>
<depMultiCity>
<locationId>DEL</locationId>
</depMultiCity>
</departureLocalization>
<arrivalLocalization>
<arrivalMultiCity>
<locationId>BOM</locationId>
</arrivalMultiCity>
</arrivalLocalization>
<timeDetails>
<firstDateTimeDetail>
<timeQualifier>TD</timeQualifier>
<date>201217</date>
<time>0000</time>
<timeWindow></timeWindow>
</firstDateTimeDetail>
</timeDetails>
</itinerary>
<itinerary>
<requestedSegmentRef>
<segRef>1</segRef>
</requestedSegmentRef>
<departureLocalization>
<depMultiCity>
<locationId>BOM</locationId>
</depMultiCity>
</departureLocalization>
<arrivalLocalization>
<arrivalMultiCity>
<locationId>DEL</locationId>
</arrivalMultiCity>
</arrivalLocalization>
<timeDetails>
<firstDateTimeDetail>
<timeQualifier>TD</timeQualifier>
<date>251217</date>
<time>0000</time>
<timeWindow></timeWindow>
</firstDateTimeDetail>
</timeDetails>
</itinerary>
</Fare_MasterPricerTravelBoardSearch>
</soapenv:Body>
</soapenv:Envelope>
29e8e874-3033-dd52-6b75-a2da58e10291
http://webservices.amadeus.com/fmptbq_14_3_1A
https://noded1.test.webservices.amadeus.com/1asiwmlfpnp
WSPNPMLF
bTEzbk5LNElzZw==
5lkky7mUVRujQPg4blzfKi5dSyg=
2017-12-15T13:43:34:532Z
1.
军中福利社
250
钢筋混凝土
ADT
1.
反相
茹
交咨会
ET
钢筋混凝土
Y
1.
德尔
物料清单
运输署
201217
0000
1.
物料清单
德尔
运输署
251217
0000
答复:
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>12|Presentation|soap message header incorrect</faultstring>
<faultactor>SI:muxDZ2</faultactor>
</soap:Fault>
</soap:Body>
</soap:Envelope>
soap:客户端
12 |演示| soap消息头不正确
SI:muxDZ2
当使用SoapUI传递相同的请求时,我会得到响应,但当使用C#代码时,我会得到上述响应。。如果有人在C#中实现了Amadeus Soap4.0 API,请提供帮助。也许您已经设置了SoapUI,以便对请求负载执行其他操作(因此请求不同) 我建议从给定的WSDL创建一个代理类。虽然这个代理类默认不支持Nonce,但它是可扩展的。退房
现在,您得到的12个错误代码也可能来自其他方面。。。。例如,我在那里没有看到您的
元素(除非这表示无状态请求?您必须手动创建Soap信封吗?如果您可以从WSDL生成代理类,则不会出现此问题。在代理类中,我们没有添加nonce令牌和密码的选项如果我运行您的代码,我会得到“表示消息寻址属性的头无效,无法处理消息”,这与您在问题中描述的错误不同。我在postman中尝试了您的soap信封,并收到以下响应:soap:Client 12 | Presentation | soap消息头不正确SI:muxDZ2似乎您的soap请求是错误的。如果它在soap UI中工作,而不是在您的代码中,我建议使用诸如Fiddler之类的代理来检查SOAP UI实际发送的内容是的,这是一个无状态请求,但是我们如何调用extension@AmarnathBalasubramanian如果您遵循该链接,它将导致包含您正在寻找的示例实现的链接。搜索写入“CustomCredentials:ClientCredentials”的部分
<?xml version="1.0" encoding="UTF-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<soap:Fault>
<faultcode>soap:Client</faultcode>
<faultstring>12|Presentation|soap message header incorrect</faultstring>
<faultactor>SI:muxDZ2</faultactor>
</soap:Fault>
</soap:Body>
</soap:Envelope>