我将尽量简短地解释这一点。
我需要在一个很久以前使用WSDL描述符实现的Axis请求中包含一个名为shipToStoreGLN的新字段。
它必须出现在path OrderRequest -> PedidosIn(OrdersIn) -> Cabecera (报头)中。
我试着添加这个字段,就像添加其他字段一样,但是它不能工作,它不会出现在最后的请求中。
更奇怪的是,还有一个名为shipToStore的字段,它将添加到类中,但它没有添加到类型描述中,而是出现在最终请求中。
有人能告诉我如何添加该字段吗?如果可能的话,请解释另一个字段出现的原因?
我将粘贴代码,这是请求的外观和现在的外观的存根。
多亏了所有人。
类OrderRequestPedidosInPedidoCabecera.java的相关代码(我无法复制完整的java源代码,因为它太长了):
//The getters and setters
public java.lang.String getShipToStoreGLN() {
return shipToStoreGLN;
}
public void setShipToStoreGLN(java.lang.String shipToStoreGLN) {
this.shipToStoreGLN = shipToStoreGLN;
}
//Applying it to the type descriptor
elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("shipToStoreGLN");
elemField.setXmlName(new javax.xml.namespace.QName("http://tempuri.org/GatewayService/", "shipToStoreGLN"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
elemField.setMinOccurs(0);
elemField.setNillable(false);
typeDesc.addFieldDesc(elemField);关于请求的外观的研究报告:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:gat="http://tempuri.org/GatewayService/">
<soapenv:Header/>
<soapenv:Body>
<gat:OrderRequest>
<gat:PedidosIn>
<gat:Identificacion>
<gat:IdUsuario>?</gat:IdUsuario>
<gat:Password>?</gat:Password>
</gat:Identificacion>
<gat:Pedido>
<gat:Cabecera>
<gat:NumeroPedido>?</gat:NumeroPedido>
<gat:shipToStore>?</gat:shipToStore>
<gat:shipToStoreGLN>?</gat:shipToStoreGLN>
<gat:FechaPedido>?</gat:FechaPedido>
<gat:Facturacion>
<gat:Nombre>?</gat:Nombre>
<gat:Apellidos>?</gat:Apellidos>
<gat:Direccion>?</gat:Direccion>
<gat:CodigoPostal>?</gat:CodigoPostal>
<gat:Poblacion>?</gat:Poblacion>
<gat:Provincia>?</gat:Provincia>
<gat:NIF>?</gat:NIF>
<gat:Telefono>?</gat:Telefono>
</gat:Facturacion>
<gat:Entrega>
<gat:Nombre>?</gat:Nombre>
<gat:Apellidos>?</gat:Apellidos>
<gat:Direccion>?</gat:Direccion>
<gat:CodigoPostal>?</gat:CodigoPostal>
<gat:Poblacion>?</gat:Poblacion>
<gat:Provincia>?</gat:Provincia>
<gat:NIF>?</gat:NIF>
<gat:Telefono>?</gat:Telefono>
</gat:Entrega>
<gat:Total>?</gat:Total>
<gat:Email>?</gat:Email>
<gat:CodigoTrackingTrans>?</gat:CodigoTrackingTrans>
<gat:NumeroExpedicion>?</gat:NumeroExpedicion>
<gat:CodigoRuta>?</gat:CodigoRuta>
<gat:NombreRuta>?</gat:NombreRuta>
<gat:CodigoAgenciaDestino>?</gat:CodigoAgenciaDestino>
<gat:NombreAgenciaDestino>?</gat:NombreAgenciaDestino>
</gat:Cabecera>
<gat:Lineas>
<!--Zero or more repetitions:-->
<gat:Linea>
<gat:IdPedidoLinea>?</gat:IdPedidoLinea>
<gat:Referencia>?</gat:Referencia>
<gat:ReferenciaMS>?</gat:ReferenciaMS>
<gat:Posicion>?</gat:Posicion>
<gat:Cantidad>?</gat:Cantidad>
<gat:Descripcion>?</gat:Descripcion>
<gat:PrecioUnitario>?</gat:PrecioUnitario>
<gat:Total>?</gat:Total>
</gat:Linea>
</gat:Lineas>
</gat:Pedido>
</gat:PedidosIn>
</gat:OrderRequest>
</soapenv:Body>
</soapenv:Envelope>请求现在是什么样的:
<soapenv:Body xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<OrderRequest xmlns="http://tempuri.org/GatewayService/">
<PedidosIn>
<Identificacion>
<IdUsuario>MMKTTEST</IdUsuario>
<Password>H23mLu3RieDr</Password>
</Identificacion>
<Pedido>
<Cabecera>
<NumeroPedido>000123657</NumeroPedido>
<FechaPedido>20140911 122523</FechaPedido>
<CodigoTiendaFacturacion>E290</CodigoTiendaFacturacion>
<CodigoTiendaEntrega>E290</CodigoTiendaEntrega>
<Facturacion>
<Nombre>Cristina</Nombre>
<Apellidos>Franco</Apellidos>
<Direccion>barcelona,gggg gggg</Direccion>
<CodigoPostal>08022</CodigoPostal>
<Poblacion>BARCELONA</Poblacion>
<Provincia>BARCELONA</Provincia>
<CodigoProvincia>08</CodigoProvincia>
<NIF>52173198K</NIF>
<Telefono>677714997</Telefono>
<pais>es</pais>
</Facturacion>
<Entrega>
<Nombre>MEDIA MARKT DIAGONAL MAR-BARCELONA VIDEO-TV-HIFI-E</Nombre>
<Apellidos>LEKTRO-COMPUTER-FOTO, S.A </Apellidos>
<Direccion>C.C DIAGONAL MAR AVDA DIAGONAL Nº3, planta B local 14000</Direccion>
<CodigoPostal>08019</CodigoPostal>
<Poblacion>BARCELONA</Poblacion>
<Provincia>BARCELONA</Provincia>
<NIF/>
<Telefono>934857200</Telefono>
<direccion1>C.C DIAGONAL MAR AVDA DIAGONAL Nº3, planta B local 14000</direccion1>
<direccion2/>
<direccion3/>
</Entrega>
<Total>219.0</Total>
<Email>crisfrancob@gmail.com</Email>
<CodigoTrackingTrans/>
<NumeroExpedicion/>
<CodigoRuta/>
<NombreRuta/>
<CodigoAgenciaDestino/>
<NombreAgenciaDestino/>
<shipToStore>1</shipToStore>
</Cabecera>
<Lineas>
<Linea>
<IdPedidoLinea>0</IdPedidoLinea>
<Referencia>B99B329</Referencia>
<ReferenciaMS>1148842</ReferenciaMS>
<ReferenciaUni/>
<Posicion>1</Posicion>
<Cantidad>1.0</Cantidad>
<Descripcion>GF EN210 SILENT/DI/1GD3/V2 CTLR 1GB DDR3 PCI-E DVI-I HDMI IN</Descripcion>
<PrecioUnitario>0.0</PrecioUnitario>
<Total>0.0</Total>
</Linea>
</Lineas>
</Pedido>
</PedidosIn>
</OrderRequest>
</soapenv:Body>发布于 2015-02-12 09:35:49
我在shipToStoreGLN字段上设置了一个空。现在,我知道您不能设置一个空并期望它出现。
https://stackoverflow.com/questions/28452414
复制相似问题