在通过SOAP将其传递给Call webservice之后更改Request XML

时间:2022-04-03 21:30:31

below request xml can be formed by service client stub code which is working fine in dev box. The application server is websphere-8.5.5.

下面的请求xml可以由服务客户端存根代码形成,它在开发框中工作正常。应用程序服务器是websphere-8.5.5。

<?xml version="1.0" encoding="UTF-8"?><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"><soapenv:Body><getPlanLookUpBySSN xmlns="http://example.com"><argLookupBySSNInput xmlns=""><applicationId>IVR</applicationId><client>PC</client><ivrInd>Y</ivrInd><scrollIndicator></scrollIndicator><scrollKey></scrollKey><ssn>12345</ssn><type>Dental</type><userId>IVR</userId><asOfDate></asOfDate></argLookupBySSNInput></getPlanLookUpBySSN></soapenv:Body></soapenv:Envelope>

Same client stub code will be deployed in UAT. The server(WebSphere) and service URL are same as in dev. but the element position are sorted in alphabetical order in UAT box. Hence the web service won't accept the request xml, instead it throws an error.

将在UAT中部署相同的客户端存根代码。服务器(WebSphere)和服务URL与dev中的相同。但是元素位置在UAT框中按字母顺序排序。因此,Web服务将不接受请求xml,而是抛出错误。

<?xml version="1.0" encoding="UTF-8"?><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"><soapenv:Body><getPlanLookUpBySSN xmlns="http://example.com"><argLookupBySSNInput xmlns=""><applicationId>IVR</applicationId><asOfDate></asOfDate><client>PC</client><ivrInd>Y</ivrInd><scrollIndicator></scrollIndicator><scrollKey></scrollKey><ssn>12345</ssn><type>Dental</type><userId>IVR</userId></argLookupBySSNInput></getPlanLookUpBySSN></soapenv:Body></soapenv:Envelope>  

In above xml <asOfDate> element postion is changed. Please help us to resolve this issue.

在上面的xml 元素中,postion已更改。请帮助我们解决此问题。

1 个解决方案

#1


0  

You may need to modify the WSDL and make the schema getPlanLookUpBySSN element as of fixed sequence like below and regenerate you client. Something like below. tag make the tags sequence rigid.

您可能需要修改WSDL并将模式getPlanLookUpBySSN元素设置为固定序列,如下所示,并重新生成客户端。像下面的东西。 tag使标签序列严格。

<xs:element name="getPlanLookUpBySSN">
          <xs:complexType>
                 <xs:sequence>
                        <xs:element name="argLookupBySSNInput">
                               <xs:complexType>
                                      <xs:sequence>
                                             <xs:element name="applicationId" type="xs:string"></xs:element>
                                             <xs:element name="asOfDate"></xs:element>
                                             <xs:element name="client" type="xs:string"></xs:element>
                                             <xs:element name="ivrInd" type="xs:string"></xs:element>
                                             <xs:element name="scrollIndicator"></xs:element>
                                             <xs:element name="scrollKey"></xs:element>
                                             <xs:element name="ssn" type="xs:int"></xs:element>
                                             <xs:element name="type" type="xs:string"></xs:element>
                                             <xs:element name="userId" type="xs:string"></xs:element>
                                         </xs:sequence>
                                      <xs:attribute name="xmlns" type="xs:string"></xs:attribute>
                                  </xs:complexType>
                           </xs:element>
                    </xs:sequence>
                 <xs:attribute name="xmlns" type="xs:string"></xs:attribute>
             </xs:complexType>
      </xs:element>

#1


0  

You may need to modify the WSDL and make the schema getPlanLookUpBySSN element as of fixed sequence like below and regenerate you client. Something like below. tag make the tags sequence rigid.

您可能需要修改WSDL并将模式getPlanLookUpBySSN元素设置为固定序列,如下所示,并重新生成客户端。像下面的东西。 tag使标签序列严格。

<xs:element name="getPlanLookUpBySSN">
          <xs:complexType>
                 <xs:sequence>
                        <xs:element name="argLookupBySSNInput">
                               <xs:complexType>
                                      <xs:sequence>
                                             <xs:element name="applicationId" type="xs:string"></xs:element>
                                             <xs:element name="asOfDate"></xs:element>
                                             <xs:element name="client" type="xs:string"></xs:element>
                                             <xs:element name="ivrInd" type="xs:string"></xs:element>
                                             <xs:element name="scrollIndicator"></xs:element>
                                             <xs:element name="scrollKey"></xs:element>
                                             <xs:element name="ssn" type="xs:int"></xs:element>
                                             <xs:element name="type" type="xs:string"></xs:element>
                                             <xs:element name="userId" type="xs:string"></xs:element>
                                         </xs:sequence>
                                      <xs:attribute name="xmlns" type="xs:string"></xs:attribute>
                                  </xs:complexType>
                           </xs:element>
                    </xs:sequence>
                 <xs:attribute name="xmlns" type="xs:string"></xs:attribute>
             </xs:complexType>
      </xs:element>