Hello, I can't modify the service that requires specific namespace. It's not my project. It was developped with the Gsoap implementation. My job , is to make a J2EE client and build a JAVA library for the DPWS specifcation.
I worked last afternoon on this problem. I modify my wsdl without success. So I will give you the wsdl produced by the Gsoap implementation which I have to work. <wsdl:definitions xmlns:tns="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://schemas.xmlsoap.org/ws/2004/09/mex"> <wsdl:types> <xs:schema targetNamespace="http://schemas.xmlsoap.org/ws/2004/09/mex"> <xs:include schemaLocation="metadataexchange.xsd"/> </xs:schema> </wsdl:types> <wsdl:message name="GetMetadataMsg"> <wsdl:part name="body" element="tns:GetMetadata"/> </wsdl:message> <wsdl:message name="GetMetadataResponseMsg"> <wsdl:part name="body" element="tns:Metadata"/> </wsdl:message> <wsdl:message name="GetMsg"/> <wsdl:message name="GetResponseMsg"> <wsdl:part name="body" type="tns:AnyXmlType"/> </wsdl:message> <wsdl:portType name="MetadataExchange"> <wsdl:operation name="GetMetadata"> <wsdl:input message="tns:GetMetadataMsg" wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Request"/> <wsdl:output message="tns:GetMetadataResponseMsg" wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/GetMetadata/Response"/> </wsdl:operation> <wsdl:operation name="Get"> <wsdl:input message="tns:GetMsg" wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/Get/Request"/> <wsdl:output message="tns:GetResponseMsg" wsa:Action="http://schemas.xmlsoap.org/ws/2004/09/mex/Get/Response"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="MetadataExchangeBinding" type="tns:MetadataExchange"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="GetMetadata"> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="Get"> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="MetadataService"> <wsdl:documentation xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">SIRENA Metadata service</wsdl:documentation> <wsdl:port name="MetadataExchangePort" binding="tns:MetadataExchangeBinding"> <soap:address location="http://localhost:8085/"/> </wsdl:port> </wsdl:service> </wsdl:definitions> Here the XML schema : <xs:schema targetNamespace='http://schemas.xmlsoap.org/ws/2004/09/mex' xmlns:tns='http://schemas.xmlsoap.org/ws/2004/09/mex' xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/08/addressing' xmlns:xs='http://www.w3.org/2001/XMLSchema' elementFormDefault='qualified' blockDefault='#all' > <xs:import namespace='http://schemas.xmlsoap.org/ws/2004/08/addressing' schemaLocation='http://schemas.xmlsoap.org/ws/2004/08/addressing/' /> <!-- Get Metadata request --> <xs:element name='GetMetadata' > <xs:complexType> <xs:sequence> <xs:element ref='tns:Dialect' minOccurs='0' /> <xs:element ref='tns:Identifier' minOccurs='0' /> </xs:sequence> <xs:anyAttribute namespace='##other' processContents='lax' /> </xs:complexType> </xs:element> <xs:element name='Dialect' type='xs:anyURI' /> <xs:element name='Identifier' type='xs:anyURI' /> <!-- Get Metadata response --> <xs:element name='Metadata' > <xs:complexType> <xs:sequence> <xs:element ref='tns:MetadataSection' minOccurs='0' maxOccurs='unbounded' /> </xs:sequence> <xs:anyAttribute namespace='##other' processContents='lax' /> </xs:complexType> </xs:element> <xs:element name='MetadataSection' > <xs:complexType> <xs:choice> <xs:any namespace='##other' processContents='lax' minOccurs='0' maxOccurs='unbounded' /> <xs:element ref='tns:MetadataReference' /> <xs:element ref='tns:Location' /> </xs:choice> <xs:attribute name='Dialect' type='xs:anyURI' use='required' /> <xs:attribute name='Identifier' type='xs:anyURI' /> <xs:anyAttribute namespace='##other' processContents='lax' /> </xs:complexType> </xs:element> <xs:element name='MetadataReference' type='wsa:EndpointReferenceType' /> <xs:element name='Location' type='xs:anyURI' /> <!-- count(/s:Envelope/s:Body/*) = 0 for Get request --> <!-- Get Response returns xs:any --> <xs:complexType name='AnyXmlType' > <xs:sequence> <xs:any namespace='##any' processContents='lax' /> </xs:sequence> <xs:anyAttribute namespace='##any' processContents='lax' /> </xs:complexType> </xs:schema> Thanks in advance. Regards Raphael Jacquemin 2005/8/12, Anne Thomas Manes <[EMAIL PROTECTED]>: > I completely concur with Simon -- if a server requires a specific > string for a namespace prefix, it's broken. But I think we have a > different problem here. > > There is actually a problem with the generated message. > The <GetMetadata> element is unqualified: > <soapenv:Body> > <GetMetadata xmlns=""> > ... > > That's not valid SOAP (the child element of the <soap:Body> must be > namespace qualified), and I'm certain that it's not conformant to the > WS-MEX specification. > > I suspect you have an error in your WSDL. Can you post it please? > (perhaps you've specified style="rpc", but you neglected to specify a > namespace attribute in the <soap:body> definition? > > Anne > > > On 8/11/05, Simon Fell <[EMAIL PROTECTED]> wrote: > > You need to fix the bug in the service that requires specific namespace > > prefixes. Most soap toolkits won't give you the flexibility to specific > > specific namespace prefixes (because they don't matter). > > > > Cheers > > Simon > > > > -----Original Message----- > > From: Raphael Jacquemin [mailto:[EMAIL PROTECTED] > > Sent: Thursday, August 11, 2005 6:10 AM > > To: [email protected] > > Subject: Namespace and prefix issues > > > > Hello, > > > > I use Axis for creating Web Services. > > > > I' ve some troubles with my namespace. > > I use a the tool wsdl2java for generating my java class. > > > > Here is the beginning of my wsdl file, where are defined the different > > namespace : > > > > <wsdl:definitions > > targetNamespace='http://schemas.xmlsoap.org/ws/2004/09/mex' > > xmlns:wsm='http://schemas.xmlsoap.org/ws/2004/09/mex' > > xmlns:wsa='http://schemas.xmlsoap.org/ws/2004/08/addressing' > > xmlns:wsdl='http://schemas.xmlsoap.org/wsdl/' > > xmlns:xs='http://www.w3.org/2001/XMLSchema' > > xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"> > > .... > > ________________________________________________________________ > > > > My troubles are with my the prefix "wsm". I have to use this specific > > prefix.But with my generate java code, I don't find this prefix in my > > SOAP messages. > > First I will show you the required SOAP message and then the SOAP > > message obtain with my code. I'm sure I use the good wsdl file > > > > > > Here is a well formed SOAP message : > > > > <?xml version="1.0" encoding="UTF-8"?> > > <SOAP-ENV:Envelope > > xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" > > xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" > > xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" > > xmlns:wdp="http://schemas.xmlsoap.org/ws/2004/08/devprof" > > xmlns:wsm="http://schemas.xmlsoap.org/ws/2004/09/mex" > > xmlns:wsd="http://schemas.xmlsoap.org/ws/2004/02/discovery"> > > > > <SOAP-ENV:Header> > > <wsa:To>uuid:00001f90-0000-1000-8000-000bcd4ab3de</wsa:To> > > <wsa:Action>http://schemas.xmlsoap.org/ws/2004/09/mex/MetadataExchange/G > > etMetadataRequest</wsa:Action> > > <wsa:MessageId>uuid:65cb6464-d758-11d9-b16f-000bcd4ab3de</wsa:MessageId> > > <wsa:ReplyTo><wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressi > > ng/role/anonymous</wsa:Address></wsa:ReplyTo> > > </SOAP-ENV:Header> > > <SOAP-ENV:Body id="_0"> > > <wsm:GetMetadata> > > <wsm:Dialect>http://schemas.xmlsoap.org/ws/2004/08/devprof/Relationship< > > /wsm:Dialect> > > </wsm:GetMetadata> > > </SOAP-ENV:Body> > > </SOAP-ENV:Envelope> > > > > > > Here, is my obtained SOAP Message : > > > > <?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" > > xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"> > > <soapenv:Header> > > <wsa:MessageID > > soapenv:mustUnderstand="0">uuid:7ed58220-0a64-11da-aa4d-bc6f8a64de0c</ws > > a:MessageID> > > <wsa:To soapenv:mustUnderstand="0">http://localhost:8085/</wsa:To> > > <wsa:Action > > soapenv:mustUnderstand="0">http://schemas.xmlsoap.org/ws/2004/09/mex/Met > > adataExchange/GetMetadataRequest</wsa:Action> > > <wsa:From soapenv:mustUnderstand="0"> > > <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anony > > mous</wsa:Address> > > </wsa:From> > > <wsa:ReplyTo soapenv:mustUnderstand="0"> > > <wsa:Address>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anony > > mous</wsa:Address> > > </wsa:ReplyTo> > > </soapenv:Header> > > <soapenv:Body> > > <GetMetadata xmlns=""> > > <ns1:Dialect > > xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/09/mex">http://schemas.xml > > soap.org/ws/2004/08/devprof/ThisModel</ns1:Dialect> > > </GetMetadata> > > </soapenv:Body> > > </soapenv:Envelope> > > > > > > > > So, As you can see in my SOAP message the "wsm" prefix is replaced by > > the ns1. > > I know that normally a translation is made and only the URL : > > "http://schemas.xmlsoap.org/ws/2004/09/mex" is important. But I need an > > exact matching with wsm for my application : > > <wsm:GetMetadata> > > <wsm:Dialect>http://schemas.xmlsoap.org/ws/2004/08/devprof/Relationship< > > /wsm:Dialect> > > </wsm:GetMetadata> > > > > What 's possible in order to force the "wsm" prefix. > > Do I modify the Wsdl2java tools or modify the wsdl file ? > > > > I can send my complete wsdl file if you need. > > > > Thanks in advance. > > > > Regards > > Raphael Jacquemin > > > > > > >
