From users-return-53296-archive-asf-public=cust-asf.ponee.io@cxf.apache.org Sat Apr 18 00:08:55 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id D1780180647 for ; Sat, 18 Apr 2020 02:08:54 +0200 (CEST) Received: (qmail 48983 invoked by uid 500); 18 Apr 2020 00:08:53 -0000 Mailing-List: contact users-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@cxf.apache.org Delivered-To: mailing list users@cxf.apache.org Received: (qmail 48971 invoked by uid 99); 18 Apr 2020 00:08:53 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Apr 2020 00:08:53 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id C449BC0739 for ; Sat, 18 Apr 2020 00:08:52 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.819 X-Spam-Level: X-Spam-Status: No, score=-0.819 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, KAM_SHORT=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.821, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-ec2-va.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id h78Ie5KRpwYG for ; Sat, 18 Apr 2020 00:08:50 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.166.42; helo=mail-io1-f42.google.com; envelope-from=alessio.bolognino@gmail.com; receiver= Received: from mail-io1-f42.google.com (mail-io1-f42.google.com [209.85.166.42]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 71930BB947 for ; Sat, 18 Apr 2020 00:08:50 +0000 (UTC) Received: by mail-io1-f42.google.com with SMTP id f3so4333514ioj.1 for ; Fri, 17 Apr 2020 17:08:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=P0wUrzIS9rzbghPhLBe4jfg+lI5ePPWvEvS/sD/Z1JA=; b=eVveWwfPiEVNeFYs0fsAPz6viScOyIBUjiKFee2c3bEOmNnryomm0oPXm1FemjHd/j W9EpwywkMV1FOzXfiiWrj6rASn2NaNUyVwEXG34VqPKLercFw9L6QdcqxrUAtrR/hNYK wqoGbPKzBAJHF0jSPuwKhSC0eSY0CJLrp0rC3k0vGUqc9TYECX7PO/Kd9TCBJC1gm8Ox 9Jb5i/yw9ocojSikVeVV8O+ThQNhmYRXEmlnIEc21EmPHoku7DMVlrvwoDZLoyhhNN3d NV2kBCoB/g57BtxfZX0OnnLH1gluIwtuOW/pspQgKrL8zKvlO60W27MudrDbW1OzLpFV kZ0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=P0wUrzIS9rzbghPhLBe4jfg+lI5ePPWvEvS/sD/Z1JA=; b=rGRzR5QNsuo0rVdrfei4cvMIPj0n2eZVCNRjgSNfvSaFk/SFwXfJcEciJSRMrReXG7 DmlBIieOTGESd0KchrANi0Otq0zp8dbdo82cID3CDKb0/Qn53IWpZDgeTwXxMM7VpwV3 YPITbvi6u5t/jD+0fkEOaUnQ9g8m6Kz3rOJlCUxPmLQZidqyrx/xMIoDgndijsal4PU2 +Md4LWLd9cyZjtp+0JvCzKCrSZADX1K/qUnh+PDbnA7ZlRICFfa6Iw7CgD8k+IVGUQVs gn9vZScA5Qb0RHiKiwBPB9t7WoM5NnXDHbDl8g104KfQtXtTUZdjyVWuttXdyMNXrmMa Tbzw== X-Gm-Message-State: AGi0PuaCJudrfhhHheomdcLveE547AkAUxlhX4Ea0BrVakxYmYM3Mmys sO+BsPPulAG3Xje6rjK7LTZ8bDqifgo2fhbW9LYzqiQWtJw= X-Google-Smtp-Source: APiQypLKX7lqyZp3bdBBeH9kcY4ngfHTV+2fJyxCgopo8LzYfT0bsq3/oDcPgGtK2bjZ6ycomEEHYdjPPRDiKiSrY4I= X-Received: by 2002:a6b:8dd7:: with SMTP id p206mr5583880iod.205.1587168529817; Fri, 17 Apr 2020 17:08:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alessio Bolognino Date: Sat, 18 Apr 2020 02:08:13 +0200 Message-ID: Subject: Re: xsi:type of root element not being added to CXF request To: users@cxf.apache.org Content-Type: multipart/alternative; boundary="0000000000006b248c05a385785b" --0000000000006b248c05a385785b Content-Type: text/plain; charset="UTF-8" I just found out that adding the annotation @SchemaValidation(type = SchemaValidationType.OUT) to the service interface solves this issue, the only difference between the requests sent with that annotation and those without it is that those with `SchemaValidationType.OUT` have the `xsi:type` added to the root element. This honestly does not make much sense to me, why would enable the validation modify the request begin sent? Il giorno mer 15 apr 2020 alle ore 15:40 Alessio Bolognino < alessio.bolognino@gmail.com> ha scritto: > Hi, I've imported a wsdl using wsdl2java with JAXB as databinding, the > generated Service interface is like this: > > @WebService(targetNamespace = "http://www.sii.example.it/SWG1", name > = "SWG1") > @XmlSeeAlso({it.au.switchgas.swg1.messaggio.ObjectFactory.class, > > it.au.switchgas.swg1.strutturegenerali.ObjectFactory.class, > it.au.switchgas.strutturegas.ObjectFactory.class, > it.au.switchgas.swg1.flussi.ObjectFactory.class}) > @SOAPBinding(style = SOAPBinding.Style.RPC) > public interface SWG1 { > @WebMethod(operationName = "SWG1.0050", action = "SWG1.0050") > @WebResult(name = "MessaggioSII", targetNamespace = " > http://www.sii.example.it/SWG1", partName = "MessaggioSII") > public it.au.switchgas.swg1.messaggio.ResponseMessageType swg10050( > @WebParam(partName = "MessaggioSII", name = "MessaggioSII") > it.au.switchgas.swg1.messaggio.SWG1MessageType messaggioSII > ); > } > > SWG1MessageType is a subclass of MessageType and it's defined like this: > > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name = "SWG1MessageType") > public class SWG1MessageType extends MessageType { } > > the provider of the service is currently rejecting my messages complaining > about > the MessaggioSII missing the xsi:type definition, inspecting the request I > indeed noticed > the lack of xsi:type for the MessaggioSII element: > > > > > > xmlns:ns2=" > http://www.example.it/schemas/SII_AU/StruttureGenerali/v1.9" > xmlns:ns3=" > http://www.example.it/schemas/SII_AU/Flussi_SWG1/v1" > xmlns:ns4=" > http://www.example.it/schemas/SII_AU/StruttureGAS/v1.7" > xmlns:ns5=" > http://www.example.it/schemas/2010/SII_AU/MessaggioSII"> > > xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance" > xsi:type="ns5:RichiestaSwitchingRichiestaSIIType"> > > > xmlns:xsi=" > http://www.w3.org/2001/XMLSchema-instance" > xsi:type="ns5:RichiestaSwitchingDatiSIIType"> > > > > > > > > Is this behaviour expected? > Is there a way to add the xsi:type to the MessaggioSII element? > > The only workaround I've found so far is to add a type attribute myself > but this > is not optimal either since I have to "guess" the namespace prefix (ns6 in > the example) > > @XmlAccessorType(XmlAccessType.FIELD) > @XmlType(name = "SWG1MessageType") > public class SWG1MessageType extends MessageType > { > @XmlAttribute(name = "type", namespace = > XMLConstants.W3C_XML_SCHEMA_INSTANCE_NS_URI) > private String xsiType = "ns6:SWG1MessageType"; > } > > > All this is doable with xmlbeans but I'm trying to move to JAXB. > > > -- > Alessio Bolognino > -- Alessio Bolognino --0000000000006b248c05a385785b--