首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >不同环境下的不同响应

不同环境下的不同响应
EN

Stack Overflow用户
提问于 2015-04-23 14:18:24
回答 1查看 94关注 0票数 1

我有两个环境--本地环境和UAT环境,它们是部署在WAS 7上的SOAP服务。本地env中的响应。是正确的,因为它只发送错误,但是uat发送请求+错误中发送的内容,这是不可取的。

局部

请求

代码语言:javascript
复制
<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>

响应

代码语言:javascript
复制
<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

请求

代码语言:javascript
复制
<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>

响应

代码语言:javascript
复制
<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>

我们唯一能看到的区别就是当地的环境局。在soap信封中返回3个名称空间xsd、xsi和soapenc,而UAT只返回v1命名空间。

WSDL是:

代码语言:javascript
复制
<?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:

代码语言:javascript
复制
<?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>

为什么回答之间有区别?

EN

回答 1

Stack Overflow用户

发布于 2015-04-25 00:38:09

环境有什么不同?检查WAS服务包级别、JVM服务包级别、特性包版本、WAS配置等。这两种环境是否具有相同的网络访问权限?

你的日志文件有什么不同吗?也许您可以增加日志记录级别或打开WAS跟踪以确定错误行为的原因。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/29826207

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档