我有两个环境 - 本地和UAT,它们是在WAS 7上部署的SOAP Web服务。本地环境中的响应。是正确的,因为它只发送错误,但 uat正在发送请求中发送的内容+错误,这是不合需要的
本地
请求
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://xmlns.scania.com/logistics/schema/transport/v1">
<soapenv:Body>
<v1:TransportInformationRequest>
<!--1 or more repetitions:-->
<v1:ChassisNumber>9181398</v1:ChassisNumber>
</v1:TransportInformationRequest>
</soapenv:Body>
</soapenv:Envelope>
响应
<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" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>Faults indicating that the consumer agent is failed by a authentication or authorization mechanism.</faultstring>
<detail>
<SecurityFault>
<FaultTypeDescription>Faults indicating that the consumer agent is failed by a authentication or authorization mechanism.</FaultTypeDescription>
<CustomMessage>Security header not present in the SOAP request</CustomMessage>
</SecurityFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
UAT
请求
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://xmlns.scania.com/logistics/schema/transport/v1">
<soapenv:Header/>
<soapenv:Body>
<v1:TransportInformationRequest>
<!--1 or more repetitions:-->
<v1:ChassisNumber>9181398</v1:ChassisNumber>
</v1:TransportInformationRequest>
</soapenv:Body>
</soapenv:Envelope>
响应
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://xmlns.scania.com/logistics/schema/transport/v1">
<soapenv:Body>
<v1:TransportInformationRequest>
<!--1 or more repetitions:-->
<v1:ChassisNumber>9181398</v1:ChassisNumber>
</v1:TransportInformationRequest>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>Faults indicating that the consumer agent is failed by a authentication or authorization mechanism.</faultstring>
<detail>
<SecurityFault>
<FaultTypeDescription>Faults indicating that the consumer agent is failed by a authentication or authorization mechanism.</FaultTypeDescription>
<CustomMessage>Security header not present in the SOAP request</CustomMessage>
</SecurityFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>
我们能看到的唯一区别是当地的环境。在soapenvelope中返回3个名称空间xsd,xsi和soapenc,而UAT只返回v1名称空间。
WSDL是:
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="TransportInformationService" xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:sch="http://xmlns.scania.com/logistics/schema/transport/v1"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:fault="http://xmlns.scania.com/common/schema/fault/v4"
xmlns:tns="http://xmlns.scania.com/logistics/contract/transport/v1"
xmlns:tns1="http://xmlns.scania.com/productdev/contract/part/v1"
targetNamespace="http://xmlns.scania.com/logistics/contract/transport/v1">
<types>
<xsd:schema>
<xsd:import namespace="http://xmlns.scania.com/logistics/schema/transport/v1"
schemaLocation="logistics_transport_v1.xsd" />
</xsd:schema>
</types>
<message name="GetTransportInformationRequest">
<part element="sch:TransportInformationRequest" name="parameters" />
</message>
<message name="GetTransportInformationResponse">
<part element="sch:TransportInformationResponse" name="parameters" />
</message>
<message name="EmptyChasisInformationFault">
<part element="sch:EmptyChasisFault" name="fault" />
</message>
<message name="UnknownServerFault">
<part name="UnknownServerFault" element="sch:UnknownServerFault" />
</message>
<message name="RequestMessageFormatFault">
<part name="RequestMessageFormatFault" element="sch:RequestMessageFormatFault" />
</message>
<message name="NonExistingEntityFault">
<part name="NonExistingEntityFault" element="sch:NonExistingEntityFault" />
</message>
<message name="SystemResourceUnavailableFault">
<part name="SystemResourceUnavailableFault" element="sch:SystemResourceUnavailableFault" />
</message>
<message name="SecurityFault">
<part name="SecurityFault" element="sch:SecurityFault" />
</message>
<portType name="TransportInformationDelegate">
<operation name="GetTransportInformation">
<input message="tns:GetTransportInformationRequest" />
<output message="tns:GetTransportInformationResponse" />
<fault message="tns:EmptyChasisInformationFault" name="EmptyChasisInformationFault"/>
<fault name="SystemResourceUnavailableFault" message="tns:SystemResourceUnavailableFault"/>
<fault name="NonExistingEntityFault" message="tns:NonExistingEntityFault"/>
<fault name="RequestMessageFormatFault" message="tns:RequestMessageFormatFault"/>
<fault name="UnknownServerFault" message="tns:UnknownServerFault"/>
<fault name="SecurityFault" message="tns:SecurityFault"/>
</operation>
</portType>
<binding name="TransportInformationPortBinding" type="tns:TransportInformationDelegate">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<operation name="GetTransportInformation">
<soap:operation
soapAction="http://xmlns.scania.com/logistics/contract/transport/v1/GetTransportInformation" />
<input>
<soap:body use="literal" />
</input>
<output>
<soap:body use="literal" />
</output>
<fault name="EmptyChasisInformationFault">
<soap:fault name="EmptyChasisInformationFault" use="literal" />
</fault>
<fault name="SystemResourceUnavailableFault">
<soap:fault name="SystemResourceUnavailableFault" use="literal"/>
</fault>
<fault name="NonExistingEntityFault">
<soap:fault name="NonExistingEntityFault" use="literal"/>
</fault>
<fault name="RequestMessageFormatFault">
<soap:fault name="RequestMessageFormatFault" use="literal"/>
</fault>
<fault name="UnknownServerFault">
<soap:fault name="UnknownServerFault" use="literal"/>
</fault>
<fault name="SecurityFault">
<soap:fault name="SecurityFault" use="literal"/>
</fault>
</operation>
</binding>
<service name="TransportInformationService">
<port binding="tns:TransportInformationPortBinding" name="TransportInformationPort">
<soap:address
location="http://localhost:9081/SoleilWS.WEB/TransportInformationService" />
</port>
</service>
</definitions>
xsd:
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" xmlns:types="http://ws.soleil.scania.com/"
xmlns="http://xmlns.scania.com/logistics/schema/transport/v1"
targetNamespace="http://xmlns.scania.com/logistics/schema/transport/v1">
<xs:complexType name="chassisInfo">
<xs:sequence>
<xs:element name="ChassisNumber" type="xs:int" />
<xs:element name="TransportLegs" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="From" type="xs:string" />
<xs:element name="To" type="xs:string" />
<xs:element name="OutsideEU" type="xs:boolean" />
<xs:element name="ModeOfTransport" type="xs:string" />
<xs:element name="NameOfTransport" type="xs:string"
minOccurs="0" />
<xs:element name="NationalityOfTransport" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:annotation>
<xs:documentation>Two character ISO 3166-1 code for the
nationality of the transport
</xs:documentation>
</xs:annotation>
<xs:length value="2" />
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Departure" type="xs:dateTime"
minOccurs="0" />
<xs:element name="EstimateTimeOfArrival" type="xs:dateTime"
minOccurs="0" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="TransportInformationRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="ChassisNumber" type="xs:int" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="TransportInformationResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="Chassis" type="chassisInfo" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="EmptyChasisFault">
<xs:complexType>
<xs:sequence>
<xs:element minOccurs="0" name="message" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="CustomMessage">
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:simpleType name="FaultTypeDescription">
<xs:restriction base="xs:string" />
</xs:simpleType>
<xs:element name="RequestMessageFormatFault">
<xs:complexType>
<xs:sequence>
<xs:element
fixed="Request message format validation fault. Note that there may be other fault message types capturing faults for more specific request message problems."
name="FaultTypeDescription" type="FaultTypeDescription" />
<xs:element minOccurs="0" name="CustomMessage" type="CustomMessage" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SystemResourceUnavailableFault">
<xs:complexType>
<xs:sequence>
<xs:element
fixed="Faults which are of temporary character and not caused by incorrect request messages. This message may be used to communicate that the client can expect an invocation with the same request message to work at a later time. Example: required resource of the service realization, such as a database or another service, is temporarily inaccessible."
name="FaultTypeDescription" type="FaultTypeDescription" />
<xs:element minOccurs="0" name="CustomMessage" type="CustomMessage" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="UnknownServerFault">
<xs:complexType>
<xs:sequence>
<xs:element
fixed="Faults which are not classified to any other category. Note that there may be, although so should be avoided when possible, other undeclared fault message types as well."
name="FaultTypeDescription" type="FaultTypeDescription" />
<xs:element minOccurs="0" name="CustomMessage" type="CustomMessage" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NonExistingEntityFault">
<xs:complexType>
<xs:sequence>
<xs:element
fixed="Faults indicating that the request message is referencing an entity not existing in the service datastore."
name="FaultTypeDescription" type="FaultTypeDescription" />
<xs:element minOccurs="0" name="CustomMessage" type="CustomMessage" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="InvalidReferenceFault">
<xs:complexType>
<xs:annotation>
<xs:documentation>This fault may be extended using specific faults
for specific, or specific groups of, foreign keys.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element
fixed="Faults indicating that the entity contained in the request has an invalid reference to another entity."
name="FaultTypeDescription" type="FaultTypeDescription" />
<xs:element minOccurs="0" name="CustomMessage" type="CustomMessage" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="NotSupportedForEntityStateFault">
<xs:complexType>
<xs:annotation>
<xs:documentation>This fault may be extended using specific faults
for specific, or specific groups of, state-machine rules.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element
fixed="Faults indicating that the operation issued on an entity is not permitted due to the state of the same entity."
name="FaultTypeDescription" type="FaultTypeDescription" />
<xs:element minOccurs="0" name="CustomMessage" type="CustomMessage" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="SecurityFault">
<xs:complexType>
<xs:annotation>
<xs:documentation>This fault may be extended for specific security
faults. Remember, however, that revealing too much information on
the inner workings of a security mechanism in fault messages may
risk the security of the solution.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element
fixed="Faults indicating that the consumer agent is failed by a authentication or authorization mechanism."
name="FaultTypeDescription" type="FaultTypeDescription" />
<xs:element minOccurs="0" name="CustomMessage" type="CustomMessage" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
为什么回复之间存在差异?
答案 0 :(得分:0)
环境有什么不同?检查WAS服务包级别,JVM服务包级别,功能部件包版本,WAS配置等。两个环境是否具有相同的网络访问权限?
您的日志文件是否显示有任何差异?也许您可以提高日志记录级别或打开WAS跟踪以确定错误行为的原因。