axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel GUITON <Emmanuel.GUI...@intrinsec.com>
Subject RE: Trouble with namespaces in a SOAP message generated with Axis2
Date Mon, 12 Nov 2012 09:32:47 GMT
Well, I finally found the problem.
In fact, I did not include all the relevant parts of the WSDL : the name of the SOAP operation
(defined in “wsdl-namespace”) was the same as the name of the element (defined in “xsd2-namespace”)
from which was built the content of the SOAP body.
So the whole story was about confusion, the message was correct.

Regards,

-          Emmanuel




Emmanuel GUITON

Ingénieur Développement
Fixe : +33 1  70 92 84 16 • Standard : +33 1 41 91 77 77

215, Avenue Georges Clemenceau • 92024 Nanterre

[cid:image93f429.gif@fe90b241.30fd482e]<http://www.intrinsec.com/>


[cid:image994fa4.jpg@ce642de8.c85d4f2e]<http://www.intrinsec.com/>
 Cliquez ici pour obtenir la dernière étude Markess sur le Cloud<http://www.markess.fr/demandedocument.php?refdoc=798>
De : Emmanuel GUITON [mailto:Emmanuel.GUITON@intrinsec.com]
Envoyé : mercredi 7 novembre 2012 19:15
À : java-user@axis.apache.org
Objet : Trouble with namespaces in a SOAP message generated with Axis2

Hello,

I am generating SOAP messages using Axis2 and a WSDL which you can find hereafter.
I logged the messages that are sent and I noticed a behavior that I cannot decide if it is
legitimate or not (due to my lack of experience on SOAP I presume).
The first element in the content of the SOAP body is prefixed with a namespace which is defined
in the WSDL while the definition of the element is described in a separate XSD file (that
I import into the WSDL). I.e., in the sample SOAP message hereafter, I expected to see ns2
instead of ns3 as a prefix for element msg1.
Moreover, if I change the element prefix with ns2, I can validate the content of the message
with eclipse while I cannot with the message as sent by Axis2.

Can someone explain this behavior ? What could be the problem if there is any ?

Thanks,

-          Emmanuel



The SOAP message :
<?xml version="1.0" encoding="utf-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
                <soapenv:Body>
                               <ns3:msg1 xmlns:ns3="wsdl-namespace" xmlns="xsd2-namespace"
xmlns:ns2="xsd1-namespace<http://libra.intrinsec.com/bel_protocol/1.0/>">
                                               <ns2:metadata>
                                                               <ns2:id>322221</ns2:id>
                                               </ns2:metadata>
                               </ns3:msg1>
                </soapenv:Body>
</soapenv:Envelope>

The (relevant part of the) WSDL :
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<wsdl:definitions
                xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
                xmlns:tns="wsdl-namespace"
                xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
                xmlns:xsd1="xsd1-namespace"
                xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
                xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
                name="name"
                targetNamespace="wsdl-namespace" >

                <!-- types, provide data type definitions used to describe the messages
exchanged -->
                <wsdl:types>
                               <xsd:schema targetNamespace="wsdl-namespace" xmlns:xsd1="xsd1-namespace"
xmlns:jxb=http://java.sun.com/xml/ns/jaxb jxb:version="1.0" >
                                               <xsd:import namespace="xsd1-namespace" schemaLocation="xsd1.xsd"
/>
                               </xsd:schema>
                </wsdl:types>

                <!-- message, represents an abstract definition of the data being transmitted.
A message consists of logical parts, each of which is associated with a definition within
some type system. -->
                <!-- Requests -->
                <wsdl:message name="msg1Request">
                               <wsdl:part element="xsd1:msg1" name="content" />
                </wsdl:message>
                …

The relevant part of the XSD where messages are defined :
<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns=http://www.w3.org/2001/XMLSchema
xmlns:tns="xsd1-namespace"
                xmlns:xsd2="xsd2-namespace"
                xmlns:jxb=http://java.sun.com/xml/ns/jaxb
targetNamespace="xsd1-namespace"
                elementFormDefault="qualified" jxb:version="1.0">

                <import namespace="xsd2-namespace" schemaLocation="xsd2.xsd" />

                <element name="msg1">
                               <complexType>
                                               <sequence>
                                                               <element name="metadata"
type="tns:MetaDataType" />
                                               </sequence>
                               </complexType>
                </element>
                …



Emmanuel GUITON

Ingénieur Développement
Fixe : +33 1  70 92 84 16 • Standard : +33 1 41 91 77 77

215, Avenue Georges Clemenceau • 92024 Nanterre


[cid:image001.gif@01CDC0C1.0E8EC0B0]<http://www.intrinsec.com/>

[cid:image002.jpg@01CDC0C1.0E8EC0B0]<http://www.intrinsec.com/>
 Cliquez ici pour obtenir la dernière étude Markess sur le Cloud<http://www.markess.fr/demandedocument.php?refdoc=798>



Mime
View raw message