XML namespace Problem

Hi All,
I'm usign the following code:
Namespace javaworldNS = Namespace.getNamespace("http://www.javaworld.com");
Element myElement = new Element("article", javaworldNS);
myElement.addContent(new Element("title")
                   .setText("Easy Java/XML integration with JDOM"));
Document doc = new Document(myElement);and it is producing this when i write it the doc object onto a file:
<article xmlns="http://www.javaworld.com">
  <title xmlns="">Easy Java/XML integration with JDOM</title>
</article>Now if you see inside title element, an extra empty namespace comes automatically. What i want is the following:
<article xmlns="http://www.javaworld.com">
  <title>Easy Java/XML integration with JDOM</title>
</article>So how can i omit this namespace entry from the child element?
thanks in advance!

You have the question backwards. In the first example, the <title> element is NOT in the default namespace, because it explicitly says so. In the second example, the <title> element IS in the default namespace, because it inherits the namespace from its parent element.
An XML element always inherits its parent element's namespaces unless it explicitly says otherwise.
So if you want the second example as your output, you must declare the <title> element to be in the default namespace just as you declared the <article> element.

Similar Messages

  • XML Namespace problem in XMLType

    Hi,
    I am getting this error, if anyone has any information about it please let me know.
    extract() returns the following error when a reserverd xml namespace 'xml:lang' is used in the xml document. if the namespace is removed it dosent give error.
    If this is not an error, please let me know how to workaround it.
    Thanks,
    Divakar.
    ERROR at line 1:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00233: namespace prefixes starting with "xml" are reserved
    Error at line 71
    ORA-06512: at "XDB.DBMS_XMLDOM", line 3508
    ORA-06512: at "XDB.DBMS_XMLDOM", line 3551
    ORA-06512: at "OPS$DTANJORE.CDR_CDISC_TOPIC3", line 44
    ORA-06512: at line 1

    Hi Vijaykumar,
    Thanks for your reply.
    But it is standard proxy structure, Is it fine to modify this ?
    & it is proxy, so we have to regenerate it in SRM also.
    is it fine ?
    Study SAP

  • Default namespace problem loading XML

    I am loading multiple rss/xml file. For some of them I have to use namespace (atom feeds)
    so I write this lines
    var atom:Namespace = new Namespace("http://www.w3.org/2005/Atom");
    var rssXML:XML = new XML();
      default xml namespace = atom;
    I test this in a outside my program but when I integrate this into my main program, it seem like it 's in conflict with all other xml
    the problematic line is :    default xml namespace = atom
    How do I set a namespace only for one xml object ?????
    I try diferent way, but didn't get nowhere
    thanks

    You can declare namespace per XML (but do so before you create XML object):
    var namespace1:Namespace = new Namespace("http://www.w3.org/2005/Atom");
    default xml namespace = namespace1;
    var xml1:XML = <xml1 /> ;
    trace(xml1.namespace());
    var namespace2:Namespace = new Namespace();
    default xml namespace = namespace2;
    var xml2:XML = <xml2 /> ;
    trace(xml2.namespace());
    var namespace3:Namespace = new Namespace("http://www.example.com/schema");
    default xml namespace = namespace3;
    var xml3:XML = <xml3 /> ;
    trace(xml3.namespace());
    Trace
    http://www.w3.org/2005/Atom
    http://www.example.com/schema
    Kenneth Kawamoto
    http://www.materiaprima.co.uk/

  • Unstructured Xml Storage with Namespaces - Problem in DML Queries

    Hai All,
    I worked with xml namespace with registering schema in db and referred in my xml document.It worked fine.
    But i want to work in unstructured xml document with namespaces, to do all dml queries like, select,update,delete using Xpath to xmltype.
    I could insert the records,When i try to select some element from xmltype field using Xptah from db,it does not bring any thing like element value or any error.It just displaying as empty value.I am using oracle 10g R2.
    Please help me how to select the element value from xmltype using XPath or whatever it is.
    Please help me out from this to follow
    Advance Thanks,
    P.Savananan

    SQL> create user marco identified by marco account unlock;
    User created.
    SQL> grant dba, xdbadmin to marco;
    Grant succeeded.
    SQL> conn marco/[email protected]
    Connected.
    SQL> create table xml_tab ( details xmltype);
    Table created.
    SQL> insert into xml_tab values(XMLTYPE('<?xml version="1.0" ?>
      2  <customers xmlns="http://localhost/openuri.org" >
      3  <customer>
      4  <order xmlns="http://orcl.com" >
      5  <ordername>Computer</ordername>
      6  <cost>35785638</cost>
      7  </order>
      8  </customer>
      9  </customers>'));
    1 row created.
    SQL> commit;
    Commit complete.
    SQL> select extractValue(details,'/customers/customer/order/ordername') from xml_tab;
    EXTRACTVALUE(DETAILS,'/CUSTOMERS/CUSTOMER/ORDER/ORDERNAME')
    SQL> set long 10000
    SQL> select * from xml_tab;
    DETAILS
    <?xml version="1.0"?>
    <customers xmlns="http://localhost/openuri.org">
      <customer>
        <order xmlns="http://orcl.com">
          <ordername>Computer</ordername>
          <cost>35785638</cost>
        </order>
      </customer>
    </customers>
    SQL> select extract(details,'//order/ordername') XDATA
      2  from   xml_tab
      3  ;
    XDATA
    SQL> select extract(details,'//order/ordername','xmlns="http://orcl.com"') XDATA
      2  from   xml_tab
      3  ;
    XDATA
    <ordername xmlns="http://orcl.com">Computer</ordername>
    SQL> select extractValue(details,'//order/ordername','xmlns="http://orcl.com"') XDATA
      2  from   xml_tab
      3  ;
    XDATA
    Computer
    SQL> select extractValue(details,'/*/*/order/ordername','xmlns="http://orcl.com"') XDATA
      2  from   xml_tab
      3  ;
    XDATA
    Computer

  • Javax.servlet.ServletException: The name "" is not legal for JDOM/XML namespaces

    Dear all,
    First of all sorry, if this is not the right place for my question.
    I am facing some problem with the XFire Webservices. When i am trying to access the WSDL through the url. server is throwing the following exception :
    javax.servlet.ServletException: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings.
         org.codehaus.xfire.transport.http.XFireServletController.doService(XFireServletController.java:143)
         org.codehaus.xfire.transport.http.XFireServlet.doGet(XFireServlet.java:107)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
         javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
         org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
    root cause
    org.jdom.IllegalNameException: The name "" is not legal for JDOM/XML namespaces: Namespace URIs must be non-null and non-empty Strings.
         org.jdom.Namespace.getNamespace(Namespace.java:164)
         org.codehaus.xfire.util.NamespaceHelper.getUniquePrefix(NamespaceHelper.java:58)
         org.codehaus.xfire.aegis.type.basic.BeanType.writeSchema(BeanType.java:560)
         org.codehaus.xfire.wsdl.AbstractWSDL.addDependency(AbstractWSDL.java:224)
         org.codehaus.xfire.wsdl.AbstractWSDL.addDependency(AbstractWSDL.java:233)
         org.codehaus.xfire.wsdl11.builder.WSDLBuilder.createDocLitPart(WSDLBuilder.java:403)
         org.codehaus.xfire.wsdl11.builder.WSDLBuilder.createPart(WSDLBuilder.java:355)
         org.codehaus.xfire.wsdl11.builder.WSDLBuilder.writeParameters(WSDLBuilder.java:509)
    cont.......
    I am not able to figure out the root cause for this. The service.xml file looks like below:
    <?xml version="1.0" encoding="UTF-8"?>
    <!-- START Service.xml -->
    <beans xmlns="http://xfire.codehaus.org/config/1.0">
    <!-- Construct the castor service factory by Spring -->
    <bean id="castorTypeRegistry" class="org.codehaus.xfire.castor.CastorTypeMappingRegistry"/>
    <bean id="bindingProvider" class="org.codehaus.xfire.aegis.AegisBindingProvider">
    <constructor-arg ref="castorTypeRegistry"/>
    </bean>
    <bean id="castorServiceFactory" class="org.codehaus.xfire.service.binding.ObjectServiceFactory">
    <constructor-arg index="0" ref="xfire.transportManager"/>
    <constructor-arg index="1" ref="bindingProvider"/>
    </bean>
    <service>
    <name>ReleaseManager</name>
    <namespace>ReleaseManager</namespace>
    <serviceClass>com.pinkroccade.jfoundation.calculation.releases.ReleaseManager</serviceClass>
    <implementationClass>com.pinkroccade.jfoundation.calculation.releases.ReleaseManagerImpl</implementationClass>
    <schemas>
    <schema>META-INF/schema/release-impact-worksheet-3.2.0.xsd</schema>
    </schemas>
    <style>document</style>
    <serviceFactory>#castorServiceFactory</serviceFactory>
    </service>
    </beans>
    <!-- END Service.xml-->
    The issue which i am facing is it due to the problem with the service.xml (Which i dont think so..), Or is it any thing to do with the XSD file which i am using.
    Can any body give me some guide lines for this ????
    Thanks in advance.
    Thanks and Regards,
    Manjunath.

    Any one any thoughts..
    I need to find out the solution for this as soon as possible; Not able to proceed further...
    Thanks and Regards,
    Manjunath.

  • Namespace problem while updating a desktop app

    Hello,
    I've searched on a lot of forums but didn't find anything accurate on my problem.
    I have an old AIR 2.0 desktop app that updated itself.
    I want to update it to the last 3.4 framework. So I followed instructions for the intermediate application to update (between 2.0 and 2.5).
    I manage to update from 2.0 to a Air 2.5 intermediate application, while still having the 2.0 namespace in the app descriptor file.
    But it is impossible for me to update this 2.5 application (with 2.0 namespace) to a 2.5 namespace !!
    Here si my update descriptor file :
    <?xml version="1.0" encoding="UTF-8"?>
    <update xmlns="http://ns.adobe.com/air/framework/update/description/2.5">
               <versionNumber>0.3.2</versionNumber>
               <versionLabel>Version for 0.3.2</versionLabel>
         <url>http://www.mywebsite/app.air</url>
         <description><![CDATA[
    Final test
               ]]></description>
    </update>
    But I'm having the error 16831 : "Application namespace and update.xml namespace are not compatible".
    It seems that my application only wants to update to another one with the exact same namespace.
    How this can be ?
    Thanks !
    I must say that I publish to AIR 2.5 with Flash CS5 and flashpro extension for air (in beta version) as Flash CS6 always overwrite the app descriptor while publishing (so it is impossible to change the namespace to 2.0 for example)

    Ok, after having searched a lot, I managed to understand what was going on....
    To those interested, the update descriptor must stay in a 1.0 namespace until the end of the process.
    When all is updated (app namespace to 2.5), you can use the 2.5 update descriptor namespace....

  • Issue with XML namespace and Message structure

    Hi All,
    I am using Oracle SOA Suite 11.1.1.4. I have SOA web service application one-way messaging wherein I keep receiving messages from the third party. The issue I am facing is with the XML namespaces which conflicts with the third party's message structure. The details are as below.
    Our Web-service WSDL*
    <schema attributeFormDefault="unqualified" elementFormDefault="qualified"
    targetNamespace="http://amb.com/cad/RealTimeService"
    xmlns:cad="http://amb.com/cad/RealTimeService"
    xmlns:avl="http://schemas.com/asiapac/cad/datamodel/avl/1.0.0"
    xmlns:evn="http://schemas.com/asiapac/cad/datamodel/event/1.0.0"
    xmlns:uni="http://schemas.com/asiapac/cad/datamodel/unit/1.0.0"
    xmlns:dvt="http://schemas.com/asiapac/cad/datamodel/divert/1.0.0"
    xmlns:sui="http://schemas.com/asiapac/cad/datamodel/suppinfo/1.0.0"
    xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://schemas.com/cad/datamodel/avl/1.0.0"
    schemaLocation="AvlCadSchema.xsd"/>
    <import namespace="http://schemas.com/cad/datamodel/unit/1.0.0"
    schemaLocation="UnitCadSchema.xsd"/>
    <import namespace="http://schemas.com/cad/datamodel/event/1.0.0"
    schemaLocation="EventCadSchema.xsd"/>
    <import namespace="http://schemas.com/cad/datamodel/divert/1.0.0"
    schemaLocation="HewsCadSchema.xsd"/>
    <import namespace="http://schemas.com/cad/datamodel/suppinfo/1.0.0"
    schemaLocation="SupplementalInformationCadSchema.xsd"/>
    <element name="AvlAuxData" type="avl:AvlAuxData" nillable="true"/>
    <element name="AgencyEvent" type="evn:AgencyEvent"/>
    <element name="Diversion" type="dvt:HospitalDiversionMessage"/>
    <element name="SupplementalInformation" type="sui:SupplementalInformation"/>
    <element name="UnitDetail" type="uni:UnitDetail"/>
    </schema>
    Using SOAP UI tool a HospitalDiversionMessage Request for the above WSDL will look like*
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:real="http://amb.com/cad/RealTimeService" xmlns:ns="http://schemas.com/cad/datamodel/divert/1.0.0">
    <soapenv:Header/>
    <soapenv:Body>
    <*real*:Diversion>
    <ns:Action>?</ns:Action>
    <ns:Open>?</ns:Open>
    <!--Optional:-->
    <ns:Location>?</ns:Location>
    <ns:Type>?</ns:Type>
    <ns:SubType>?</ns:SubType>
    <!--Optional:-->
    <ns:ExpiryTimestamp>?</ns:ExpiryTimestamp>
    <!--Optional:-->
    <ns:Comment>?</ns:Comment>
    <!--Optional:-->
    <ns:ItemNumber>?</ns:ItemNumber>
    <!--Optional:-->
    <ns:Notifications>?</ns:Notifications>
    <ns:CreatedTerminal>?</ns:CreatedTerminal>
    <ns:CreatedTimestamp>?</ns:CreatedTimestamp>
    <!--Optional:-->
    <ns:ClosedBy>?</ns:ClosedBy>
    <!--Optional:-->
    <ns:ClosedComments>?</ns:ClosedComments>
    <!--Optional:-->
    <ns:ClosedTerminal>?</ns:ClosedTerminal>
    <!--Optional:-->
    <ns:ClosedTimestamp>?</ns:ClosedTimestamp>
    </real:Diversion>
    </soapenv:Body>
    </soapenv:Envelope>
    Now the third party sends a HospitalDiversionMessage in this format_
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="http://amb.com/cad/RealTimeService" xmlns:ns="http://schemas.com/cad/datamodel/divert/1.0.0">
    <soapenv:Header/>
    <soapenv:Body>
    <ns0:Diversion>
    <ns0:Action>?</ns0:Action>
    <ns0:Open>?</ns0:Open>
    <!--Optional:-->
    <ns0:Location>?</ns0:Location>
    <ns0:Type>?</ns0:Type>
    <ns0:SubType>?</ns0:SubType>
    <!--Optional:-->
    <ns0:ExpiryTimestamp>?</ns0:ExpiryTimestamp>
    <!--Optional:-->
    <ns0:Comment>?</ns0:Comment>
    <!--Optional:-->
    <ns0:ItemNumber>?</ns0:ItemNumber>
    <!--Optional:-->
    <ns0:Notifications>?</ns0:Notifications>
    <ns0:CreatedTerminal>?</ns0:CreatedTerminal>
    <ns0:CreatedTimestamp>?</ns0:CreatedTimestamp>
    <!--Optional:-->
    <ns0:ClosedBy>?</ns0:ClosedBy>
    <!--Optional:-->
    <ns0:ClosedComments>?</ns0:ClosedComments>
    <!--Optional:-->
    <ns0:ClosedTerminal>?</ns0:ClosedTerminal>
    <!--Optional:-->
    <ns0:ClosedTimestamp>?</ns0:ClosedTimestamp>
    </ns0:Diversion>
    </soapenv:Body>
    </soapenv:Envelope>
    Questions*
    1) I cannot figure out how the SOAPUI tool or SOA substitutes "real" as the namespace prefix for the WSDL based HospitalDiversionMessage and what I need to do at my end to match the message structure as per what the third party needs.
    2) I need ns0 namespace prefix to whole of Diversion xml element. Currently it is "real" at top Diversion element and "ns" for its children
    Please suggest, I can attach the other imported XSD if need be.
    Thanks
    Edited by: user5108636 on Jun 13, 2011 6:55 PM
    Edited by: user5108636 on Jun 13, 2011 6:57 PM
    Edited by: user5108636 on Jun 13, 2011 7:02 PM

    Questions
    1) I cannot figure out how the SOAPUI tool or SOA substitutes "real" as the namespace prefix for the WSDL based HospitalDiversionMessage and what I need to do at my end to match the message structure as per what the third party needs.The xml namespace suffixes like real and ns0 are just references used by the XML Parsers. For that matter the "real" can be xyz as well.
    You dont need to make any changes as long as the xml namespace suffixes refer to the same namespace.
    If you see the first soapUI xml and the third party xml have the same namespace references and hence it is not a problem:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:real="*http://amb.com/cad/RealTimeService*" xmlns:ns="http://schemas.com/cad/datamodel/divert/1.0.0">
    <soapenv:Header/>
    <soapenv:Body>
    <*real*:Diversion>
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns0="*http://amb.com/cad/RealTimeService*" xmlns:ns="http://schemas.com/cad/datamodel/divert/1.0.0">
    <soapenv:Header/>
    <soapenv:Body>
    <*ns0*:Diversion>
    2) I need ns0 namespace prefix to whole of Diversion xml element. Currently it is "real" at top Diversion element and "ns" for its childrenBased on this, logically both the xmls represent the same xml message. And hence you dont need to make any changes.
    Please refer to the basics of xml namespaces using the following links:
    http://en.wikipedia.org/wiki/XML_namespace
    http://zvon.org/comp/r/tut-Namespace.html#Pages~Introduction
    Let us know if you still need clarification.
    Hope this helps.
    Thanks,
    Patrick

  • XML namespace in xml converted pdf

    Hello everyone
    I have a problem when converting pdf's in xml. Everytime when I convert a PDF(either with Acrobat or with mailing the file as XML) in XML the date fields always in middle shows the xml namespace xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" . We are using these xml's to transfer data to an accounting software but the software recognizes the xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" as an error and because of that the data couldn't be uploaded. We created the PDF using a xsd scheme made in the accounting software. Is there a way to get rid of xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" showing in the date fields.
    I appreciate every possible help

    Hi,
    It sounds like you have the nillable="true" attribute in you XSD for the date field.
    If you XSD looks like;
    <xs:element name="Date1" type="xs:date" nillable="true"/>
    Then you will get the following when the field Date1 is bound to is left blank.
    <Date1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
    This is the correct behaviour, so I am either not understanding the problem or there is a bug in the accounting software you are using.
    Maybe you could try replacing the nullable="true" with a minOccurs="0".  This will mean the element will not appear in the XML at all.
    Regards
    Bruce

  • VerifyError #1025 - default xml namespace and getter function

    I have narrowed the problem down to a a few lines. I have
    created a simple example of the problem...
    // TestClass.as
    package {
    import flash.events.EventDispatcher;
    public class TestClass extends EventDispatcher {
    private var _testVar:String;
    public function TestClass() {
    var testXML:XML = <node1 xmlns="
    http://www.testurl.com/"><node2><node3>some
    words of wisdom</node3></node2></node1>;
    default xml namespace = testXML.namespace("");
    _testVar = testXML.node2.node3;
    public function get testVar():String {
    return _testVar;
    // Test.fla - frame 1
    import TestClass;
    var myTestClass:TestClass = new TestClass();
    var someVar:String = myTestClass.testVar;
    trace(someVar);
    I get the following error...
    verify TestClass/get testVar()
    stack:
    scope: [global Object$ flash.events::EventDispatcher$
    TestClass$]
    locals: TestClass
    0:getlocal0
    stack: TestClass
    scope: [global Object$ flash.events::EventDispatcher$
    TestClass$]
    locals: TestClass
    1:pushscope
    stack:
    scope: [global Object$ flash.events::EventDispatcher$
    TestClass$] TestClass
    locals: TestClass
    2:getlocal1
    VerifyError: Error #1025: An invalid register 1 was accessed.
    at TestClass/get testVar()
    at Test_fla::MainTimeline/Test_fla::frame1()
    However if I take out the default xml namespace line, and
    create a new namespace it will work.
    var testNS:Namespace = new Namespace(testXML.namespace(""));
    _testVar = testXML.testNS::node2.testNS::node3;
    Thoughts??? It's driving me crazy. Thanks in advance...
    levi

    The attribute should be in the element's namespace. If I run this snippet on the timeline, it outputs the correct values.
    var xml:XML =
    <xml>
    <animal type="sheep" xmlns="http://blabla">
      <name>josh</name>
      <age>2</age>
    </animal>
    <animal type="cow" xmlns="http://blabla">
      <name>jim</name>
      <age>2</age>
    </animal>
    </xml>
    var ns:Namespace = new Namespace("http://blabla");
    default xml namespace = ns;
    trace( xml.animal.@type ); // OUTPUT: sheepcow

  • Default xml namespace = v hangs app

    This is probably due to my relative inexperience with Flex (using FlashBuilder 4.5 and Flex SDK 3.6) but I've got an app that is acting strangely and I'd like to find out what's wrong.
    Briefly, I'm trying to parse some XML (returned from a REST service) and, within a private function, am creating a namespace (call it v). I then use the directive default xml namespace = v. However, upon trying to launch and debug the app it hangs at application startup. The default directive is in a private function (actually a function called only when my HTTP service completes) of a component. Regardless, if I comment out the default directive the application works normally.
    Again, this function isn't even CALLED unless I essentially click a button to access the service, so I have absolutely no idea why it appears to be affecting the loading of my app.
    I have used Google to search for "Flex default xml namespace hangs app" but have found only one reference (in passing, with no solution offered).
    Thanks for any pointers.

    I will try at some point but I can't cut down my current app to do it, it's just too large.
    However, I did debug the app and I saw what the problem is. My view component, located in (for example) com.xyz.myapp.view, loads several other components, all located in com.xyz.myapp.components. As a result, the Panel component in the View contains  (among other directives) xmlns:components="com.xyz.myapp.components.*". Both the namespace variable v and the default xml namespace directive are in a private function in one of the components the main view loads. When I ran the app under the debugger it terminated almost immediately with "Error 1065: variable com.xyz.mypp.components::v is not defined".
    That's all I can tell you for now.
    Thanks for the reply.

  • Xml namespace and xslt

    Hi,
    This is a pure xml question. Let me know if there are good forums better suited for this kind of problem.
    I receive an xml message with the following format:
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <staticMessage xmlns="Static/nme" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Static/nme ./StaticMessage.xsd">
    </staticMessage>I fail to apply transformation when using a stylesheet like:
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <xsl:template match="/">
         <xsl:value-of select="staticMessage/body/data"/>
    </xsl:template>
    </xsl:stylesheet>However if I remove the xmlns attribute in the incoming message (xmlns="Static/nme" ) the transformation works correctly.
    I do not have a great understanding of namespaces.
    Does anyone know if any special declaration needs to be made for the xsl file to work correctly?
    Tx,
    Mik.

    Noticed that declaring a prefix in xsl (xmlns:pre="Static/nme") allows to access nodes or values ( pre:staticData/pre:.../)
    But does a prefix need to reference the xml namespace or is it possible to define it as default?
    Tx,
    Mik.

  • XML Namespace in WebService Request/Response

    Hi all,
    I have a question regarding xml namespace usage in wsdl and the corresponding request/response messages.
    I have already browsed quite some articles about xml namespaces as well as some forum threads, but I am still not sure.
    I have the following part of a wsdl document (generated by Integration Directory), defining a targetnamespace.
    u2026
    <wsdl:types>
        <xsd:schema targetNamespace="http://www.dorma.com/sap/xi/finance"
                             xmlns="http://www.dorma.com/sap/xi/finance"
                             xmlns:xsd="http://www.w3.org/2001/XMLSchema">
            <xsd:element name="DebtorGetDetailResponse" type="Z_BAPI_DEBTOR_GETDETAIL_Response"></xsd:element>
            u2026
            <xsd:complexType name="Z_BAPI_DEBTOR_GETDETAIL_Response">
                <xsd:sequence>
                    <xsd:element name="DEBITOR_COMPANY_DETAIL" type="BAPI1007_5" minOccurs="0">
                    </xsd:element> u2026
                </xsd:sequence>
            </xsd:complexType>
            u2026
        </xsd:schema>
        u2026
    </wsdl:types>
    u2026
    In my understanding, all types defined in the schema section of a wsdl document will be in the targetnamespace, if defined.
    Therefore the element DEBITOR_COMPANY_DETAIL would be in the namesapce
    http://www.dorma.com/sap/xi/finance
    However, the ABAP proxy generates a response message like follows,
    where only the root element is in this namespace and the child elements are in the global namespace:
    <?xml version="1.0" encoding="utf-8"?>
    <ns1:DebtorGetDetailResponse xmlns:ns1="http://www.dorma.com/sap/xi/finance"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <DEBITOR_COMPANY_DETAIL>
            u2026
        </DEBITOR_COMPANY_DETAIL>
        u2026
    </ns1:DebtorGetDetailResponse>
    Do I have a wrong understand of the wsdl (xml schema) or is this an erroneous behavior?
    The problem is that some 3rd-party software web service module does not accept
    the response message as not complient with the respective wsdl document.
    Any input is appreciated.
    Thanks
    Hans
    Edited by: Hans-Jürgen Schwippert on Oct 1, 2008 12:02 PM

    I have the same problem. I am trying to connect to a webservice running on IBM websphere but it doesn't accept the xml in my request. It appears to be the same namespace issue.
    Did you ever find a solution for this?
    Is it a valid webservice call if you omit the namespace for an element or is this a bug in the Adaptive WS implementation?
    Web Dynpro web service model generated request:
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <SOAP-ENV:Header>
    <sapsess:Session xmlns:sapsess="http://www.sap.com/webas/630/soap/features/session/">
    <enableSession>true</enableSession>
    </sapsess:Session>
    </SOAP-ENV:Header>
    <SOAP-ENV:Body>
    look between these lines -
    <ns1:tamKontrolleraKontoLastAnrop xmlns:ns1="http://schemas.fora.se/modell/tam/1.0/TAM_Data">
    <AnvandarNamn>30039647</AnvandarNamn>
    </ns1:tamKontrolleraKontoLastAnrop>
    look between these lines -
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    As you can see the tag
    <AnvandarNamn>30039647</AnvandarNamn>
    is missing a namespace.
    It should be
    <ns1:AnvandarNamn>30039647</ns1:AnvandarNamn>
    Using a third part tool called Soapui i generate this request that works:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:tam="http://schemas.fora.se/modell/tam/1.0/TAM_Data">
       <soapenv:Header/>
       <soapenv:Body>
          <tam:tamKontrolleraKontoLastAnrop>
             <tam:AnvandarNamn>30039647</tam:AnvandarNamn>
          </tam:tamKontrolleraKontoLastAnrop>
       </soapenv:Body>
    </soapenv:Envelope>

  • Namespace problem in SRM scenario.

    Hi Experts,
    I am using the RFQ scenario on SRM (Proxy) to PI to RFC.
    The scenario is standard SRM Scenario.
    The problem is with namespace, coming from SRM Proxy is http://sap.com/xi/SRM/Sourcing/Global
    using same message Type on PI, but XML namespace here in PI is different for this message, it is http://sap.com/xi/SAPGlobal/Global
    As the namespaces are not matching, the message is in RED.
    How I can solve this ?
    Study SAP

    Hi Vijaykumar,
    Thanks for your reply.
    But it is standard proxy structure, Is it fine to modify this ?
    & it is proxy, so we have to regenerate it in SRM also.
    is it fine ?
    Study SAP

  • Dynamically Modifying Target XML Namespace

    Dear All,
    We have a requirement of dynamically modifying the namespace of the target XML   . The scenario is as follows:
    There are multiple recipients of a message, and two of the recipients are using the same target structure, but with a different XML namespace. We are catering to the different receivers using different interfaces, but because these two recipients are using the same Target message type, hence they can only point to any one namespace (the XML namespace mentioned in this target message type). For example, the required target messages look like:
    Message expected at recipient 1:
    <ns0:root xmlns:ns0="http://target1.com">
    <tagA/>
    <tagB/>
    <tagC/>
    </ns0:root>
    Message expected at recipient 2:
    <ns0:root xmlns:ns0="http://target2.com">
    <tagA/>
    <tagB/>
    <tagC/>
    </ns0:root>
    Obviously, we can only create one message type with name root, and that can point to only 1 namespace. However, we need 2 different namespaces, based on the input payload. For example, if a flag in the input has a value 1, we set the namespace as "http://target1.com"; if it has value 2, we set the namespace as "http://target2.com". We are thinking of dynamically deriving the namespace at the time of mapping, but can not figure out a way to do so. We are currently using Graphical Mapping for one of the recipients; do we have to employ XSLT/ABAP mapping to achieve this? Has anybody done a work around this kind of a problem?
    Awaiting Answers.
    Thanks and Sincere Regards,
    Sid

    Hi Peter,
    Thanks for replying. Unfortunately, we are using PI 7.01 and not PI 7.1. Any other ideas?
    Nice blog though!
    P.S: Obviously, we could use 2 different interfaces pointing to the same message type, essentially creating two different communication channels towards the 2 receivers, and modify the payload within these channels using some Adapter Modules. However, this solution looks rather like firing a cannon to kill a fly, and I surely hope PI does have some other capabilities to achieve this using a single interface and single comm channel, which I do not know of (digging through help.sap right now), or can not think of right now.
    Thanks and Regards,
    Sid

  • Please help with namespace problem

    Hello,
    I am trying to display a gif image an I have a namespace problem.
    Here is my xml document:
    <?xml version='1.0'?>
    <?xml-stylesheet type="text/xsl" href="authors.xsl"?>
    <authors>
    <author>
    <name>Mike Galos</name>
    <nationality>French</nationality>
    </author>
    <author>
    <name>Cynthia Randall</name>
    <nationality>Canadian</nationality>
    </author>
    </authors>
    Here is my xsl stylesheet:
    <?xml version='1.0'?>
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:template match="//author">
    <image     xmlns:xlink="http://www.w3.org/1999/xlink"
                   xlink:type="simple"
                   xlink:href="logo.gif"
                   xlink:show="embed"/>
    </xsl:template>
    </xsl:stylesheet>
    I want the browser to diplay the gif image but it is only showing the image icon and not the actual gif image.
    Can anyone please help??
    Thanks in advance,
    Balteo.

    do you use a special browser?
    if not, do you really expect a standard browser to understand this kind of non-HTML image tag?
    <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:show="embed" xlink:href="logo.gif" xlink:type="simple">check HTML 4.0 (http://www.devguru.com/Technologies/html/quickref/html_img.html)
    or XHTML(http://www.devguru.com/Technologies/xhtml/quickref/xhtml_img.html)
    for the correct tag syntax.

Maybe you are looking for

  • Problem with a MSI-6163 PRO

    Anyone got an idea what kinda problem i have? I have an MSI 6163 PRO motherboard (with latest BIOS update 3.5), a PIII 700 Cuppermine, 3x256 SDRam, i run Win XP Pro, have a 40 gb harddrive and have been running like this for at least 9 months, withou

  • How to configure local disk on OVM Server as storage space to create VMs

    Hello, We have installed OVM Server 3.1.1 on a machine that has 250 GB of Hard disk space [Single disk]. While installing used an option - Remove all partitions and create a new default partition layout. Around 4GB has been used and remaining 246 GB

  • Has anyone used the NAG libraries with LabVIEW?

    I try to get the "g08cgc" (chi-square calculation) running, but LabVIEW hangs up everytime I start the VI.. Some tipps ... ?

  • Quick Time won't work with my Digital Camera

    Quick Time 4 is part of my Camedia software for Olympus Digital Camera D490 we have 3 computers 1 Win98se laptop 2 Win XP 2003 edition 3 Win XP only 6 months old it used to work in no 2, and works in no. 1 & 3 . an icon "My Camera comes up" and you a

  • Sales order reles process

    hello guru's i need sales order relese process. how can i map in sap. if know any one please help me? regards dharma