Aqualogic ServiceBus tutorial, add namespace problem?

Hi,
I am playing around with Aqualogic ServiceBus and thought I would go
through tutorials just to see if there is something that I don't realize
from document (http://e-docs.bea.com/alsb/docs20/pdf/tutorial.pdf).
On page 5-13 there is step where you are supposed to insert new
namespace into message. On paper it seems very easy, just click + and
type in prefix and namespace and press ok. But in reality pressing ok
does absolutely nothing and because of this I can't insert namespace
definition like in tutorial and everything is downhill from there...
I am optimistic and assume that there is actually way to do what is
described in tutorial but server just doesn't give out any error
messages even when there is some strange step I have missed. :) Any ideas?
jari k

Jari Kujansuu wrote:
Hi,
I am playing around with Aqualogic ServiceBus and thought I would go
through tutorials just to see if there is something that I don't realize
from document (http://e-docs.bea.com/alsb/docs20/pdf/tutorial.pdf).
On page 5-13 there is step where you are supposed to insert new
namespace into message. On paper it seems very easy, just click + and
type in prefix and namespace and press ok. But in reality pressing ok
does absolutely nothing and because of this I can't insert namespace
definition like in tutorial and everything is downhill from there...To answer my own message, in case others face same problem ...and to
hear if others have same problem.
So I looked at other things and now when returned to Aqualogic. Tried
again and after it failed for some reason decided to test same in
Internet Exlopder, even everything else seems to work beatifully using
Mozilla Firefox. Well in IE when pressed OK new namespace was added as
it should.
Tried looking if I had some security feature turned on in Firefox but
couldn't really see what could cause such thing. Does this work with
Firefox for others or is this Aqualogic stuff only for Internet Exploder
users?
Jari Kujansuu
Tel: +358-403400607
[email protected]
Endero Oyj www.endero.com
Kiviaidankatu 2F, FI-00210 Helsinki
The intelligent art of integration

Similar Messages

  • Add Namespace in message mapping

    Hi gurus,
    we have following requirement to solve;
    on receiver side we have a segment without namespace. It is possible to add namespace at the graphical mapping?
    <root>
        <id>1111</id>
        <name>max mustermann</name>
        <unit>B1</unit>
    </root>
    expected structure
    <root xmlns="http://www.org/xml/v0300">
        <id>1111</id>
        <name>max mustermann</name>
        <unit>B1</unit>
    </root>
    solution for this problem will be much appreciated,
    Kind Regards
    PM

    Hi Peter,
                    You can use the following java mapping to meet your requirement
    for PI 7.1 and above (if you are working with lower versions please let us know, since java mapping code will be different for lower versions)
    import java.io.FileInputStream;
    import java.io.FileOutputStream;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Element;
    import org.w3c.dom.Node;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    public class copyNode extends AbstractTransformation {
          * @param args
         public void execute(InputStream in, OutputStream out)
                   throws StreamTransformationException {
              // TODO Auto-generated method stub
              try
                   DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
                   DocumentBuilder builderel=factory.newDocumentBuilder();
                   /*input document in form of XML*/
                   Document docIn=builderel.parse(in);
                   /*document after parsing*/
                   Document docOut=builderel.newDocument();
                   TransformerFactory tf=TransformerFactory.newInstance();
                   Transformer transform=tf.newTransformer();
                   Element rootin;
                   Node rootout;
                   Element r;
                   rootin=docIn.getDocumentElement();
                   rootout=docOut.importNode(rootin, true);
                   docOut.appendChild(rootout);
                   r=(Element)docOut.getElementsByTagName("root").item(0);
                   r.setAttribute("xmlns", "\"http://www.org/xml/v0300\"");
                   transform.transform(new DOMSource(docOut), new StreamResult(out));
              catch(Exception e)
         public void setParameter(Map arg0) {
              // TODO Auto-generated method stub
         public void transform(TransformationInput arg0, TransformationOutput arg1)
         throws StreamTransformationException {
    // TODO Auto-generated method stub
              this.execute(arg0.getInputPayload().getInputStream(), arg1.getOutputPayload().getOutputStream());
         public static void main(String[] args) {
              // TODO Auto-generated method stub
              try{
                   copyNode genFormat=new copyNode();
                   FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\namespaceAdd.xml");
                   FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\namespaceAdd1.xml");
                   genFormat.execute(in,out);
                   catch(Exception e)
                   e.printStackTrace();
    One more thing, you have not mentioned the scenario. If the scenario has a file adapter in sender side, and you are using File content conversion, then please put the namespace value in content conversion parameters -> Document namespace. Then you will receive the namespace value in source message.
    regards
    Anupam

  • Add namespace declaration into xml root element

    Hello experts,
    I have the following problem:
    I generate a xml message with the following structure (example):
    How can I realise this requirement?
    Thanks and best regards!
    Christopher Kühn

    Hi Christopher,
    Call the below code as a javamappinf in the operation mapping... So now your operation mapping will have two mappings one to convert source to target XML and second this java mapping which will add namespace to your target xml
    import java.io.BufferedReader;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.Reader;
    import com.sap.aii.mapping.api.AbstractTransformation;
    import  com.sap.aii.mapping.api.DynamicConfiguration;
    import com.sap.aii.mapping.api.DynamicConfigurationKey;
    import com.sap.aii.mapping.api.StreamTransformationException;
    import com.sap.aii.mapping.api.TransformationInput;
    import com.sap.aii.mapping.api.TransformationOutput;
    import com.sap.aii.mapping.api.InputHeader;
    public class JavaMapping extends AbstractTransformation {
         public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException {
         getTrace().addInfo("JAVA Mapping Called");
         //Input payload is obtained by using arg0.getInputPayload().getInputStream()
         String inData = convertStreamToString(arg0.getInputPayload().getInputStream());
         String outData = inData.replaceFirst("<root>", "<root xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xsi:noNamespace=\"http://test.de/test.xsd\">");
         try
         //8. The JAVA mapping output payload is returned using the TransformationOutput class
         // arg1.getOutputPayload().getOutputStream()
              arg1.getOutputPayload().getOutputStream().write(outData.getBytes("UTF-8"));
         catch(Exception exception1) { }
         public String convertStreamToString(InputStream in){
         StringBuffer sb = new StringBuffer();
         try
         InputStreamReader isr = new InputStreamReader(in);
         Reader reader =
         new BufferedReader(isr);
         int ch;
         while((ch = in.read()) > -1) {
              sb.append((char)ch);}
              reader.close();
         catch(Exception exception) { }
         return sb.toString();
    check stefans blog on the jar files that you need to make this mapping /people/stefan.grube/blog/2006/10/23/testing-and-debugging-java-mapping-in-developer-studio
    Regards
    Suraj
    Regards
    Suraj

  • DBMS_XMLDOM - add namespaces attributes and prefix

    Hi,
    try to add a prefix and a namespace to the root node of an XML structure. Have tried the following code but i failed to add both.
    XML-structure before:
    <PERSON>
    <NAME>something</NAME>
    </PERSON>
    XML-structure desired:
    <pk:PERSON xmlns:pk="http://www.test.com">
    <NAME>something</NAME>
    </pk:PERSON>
    Any help is greatly appreciated.
    THX
    --------------- BEGIN ---------------------------
    declare
    var XMLType;
    buf clob;
    l_xmldoc dbms_xmldom.DOMDocument;
    l_docelem dbms_xmldom.DOMElement;
    l_root dbms_xmldom.DOMNode;
    l_attr dbms_xmldom.DOMAttr;
    begin
    var := xmltype('<PERSON> <NAME>something</NAME> </PERSON>');
    -- Create DOMDocument handle:
    l_xmldoc := dbms_xmldom.newDOMDocument(var);
    l_docelem := DBMS_XMLDOM.getDocumentElement(l_xmldoc);
    -- set prefix
    l_root := dbms_xmldom.makenode(l_docelem);
    DBMS_XMLDOM.setPrefix(l_root, 'pk');
    l_docelem := DBMS_XMLDOM.makeElement(l_root);
    dbms_output.put_line('Prefix: '||dbms_xmldom.getPrefix(l_root));
    dbms_output.put_line('l_root: '||dbms_xmldom.getNodeName(l_root));
    dbms_output.put_line('-----');
    -- add namespace attribute
    l_attr := DBMS_XMLDOM.createAttribute(l_xmldoc, 'xmlns:pk');
    DBMS_XMLDOM.setValue(l_attr, 'http://www.test.com');
    l_attr := DBMS_XMLDOM.setAttributeNode(l_docelem, l_attr);
    -- after
    dbms_xmldom.writetobuffer(l_xmldoc, buf);
    dbms_output.put_line('OUT:');
    dbms_output.put_line(buf);
    end;
    --- OUTPUT ----- OUTPUT ----- OUTPUT --
    Prefix: pk
    l_root: pk:PERSON
    OUT:
    <PERSON xmlns:pk="http://www.test.com">
    <NAME>something</NAME>
    </PERSON>
    ------------------- END -----------------------

    Seems to me you're hitting bug 2904964. I have the same problem using these functions.

  • How to add namespaces before a tag name in XML??

    Dear friends:
    I have following code, and hope to add namespaces before the tagname such as Company, Location and even any attributes in this xml,
    Can you help throw some lights??
    Thanks in advance.
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import org.w3c.dom.Attr;
    import org.w3c.dom.Document;
    import com.sun.org.apache.xml.internal.serialize.OutputFormat;
    import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
    import org.w3c.dom.Element;
    public class DocWriteDOMStart {
        public static void main(String[] av) throws IOException {
            DocWriteDOMStart dw = new DocWriteDOMStart();
            Document doc = dw.makeDoc();
            ((org.apache.crimson.tree.XmlDocument)doc).write(System.out);
        /** Generate the XML document */
        protected Document makeDoc() {
            try {
                DocumentBuilderFactory fact = DocumentBuilderFactory.newInstance();
                DocumentBuilder parser = fact.newDocumentBuilder();
                Document doc = parser.newDocument();
                Element root = doc.createElement("Company");;
                doc.appendChild(root);
                Element loc = doc.createElement("Location");
                root.appendChild(loc);
                Element emp = doc.createElement("Employee");
                loc.appendChild(emp);
                emp.appendChild(doc.createTextNode("Daniel Bush"));
                Element emp2 = doc.createElement("Employee");
                loc.appendChild(emp2);
                emp2.appendChild(doc.createTextNode("Sandy Moore"));  
                Element dept = doc.createElement("Department");
                Element e = (Element)dept;
                e.setAttribute("Nationality", "USA");
                e.setAttributeNS("www.yahoo.com", "dept", "http://www.google.com");
                //e.setAttributeNodeNS(newAttr);
                loc.appendChild(e);
                e.appendChild(doc.createTextNode("IT Depart"));
                return doc;
            } catch (Exception ex) {
                System.err.println(ex.getClass());
                System.err.println(ex.getMessage());
                return null;
    }and I got
    <?xml version="1.0" encoding="UTF-8"?>
    <Company>
      <Location>
        <Employee>Daniel Bush</Employee>
        <Employee>Sandy Moore</Employee>
        <Department Nationality="USA" dept="http://www.google.com">IT Depart</Department>
      </Location>
    </Company>hope to add namespaces before the tagname such as Company, Location and even any attributes such as dept, nationality etc in this xml,
    I try but fail.

    You would have to write code that does that, then. Right now your code writes that part of your XML as elements that aren't in a namespace. I can tell you know there are different methods to write elements that are in a namespace because you used a different method to try to write an attribute that is in a namespace.

  • Add Namespace in XPATH - Declaration - [JS]-CS4

    Dear All,
    Here I have a big doubt regarding for XPATH - Add Namespace in JavaScript.
    I have to written in Vb.NET
    //---------------- Add Namespace in VB.NET --------------------//
    Dim xDom As New XmlDocument
    Dim xNs As New XmlNamespaceManager(xDom.NameTable)
    xNs.AddNamespace("ce", "http://www.elsevier.com/xml/common/dtd")
    xNs.AddNamespace("aid", "http://adobe.com/4.0")
    AuthorNds = xDom.SelectNodes("//ce:author", xNs)
    //--------End
    and using the xNs in anywhere, But I can't declare the namespace in Javascript+XPATH.
    this.name = "AddReturns";
    //XPath will match on every XML element in the XML structure.
    this.xpath = "//ce:author";
    // Define the apply function.
    this.apply = function(myElement, myRuleProcessor)
    Only is there in the XPATHs. So How to use and insert the namespace in the Javascript + XPATH operations.
    Please kindly give me a suggestion to declare the XPATH in javascript....
    Thanks & Regards
    T.R.Harihara SudhaN

    Thanks for the reply! However, I need the soap envelope to have some additional namespaces defined as:
    original request:
    <soapenv:Envelope xmlns:soapenv="...">
    need this to go to the business service:
    <soapenv:Envelope xmlns:soapenv="..." xmlns:xsi="..." xmlns:xsd="...">
    Is there a predefined $variable for the envelope?
    thanks!

  • How to add namespace prefixes to XMLType created from Object?

    Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    CORE 11.2.0.3.0 Production
    TNS for Linux: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    I'm working with SOAP request creation from Schema derived Types.
    Consider the registration of the following annotated schema (I wanted Oracle to create the types for me, but with my own names):
    exec dbms_xmlschema.deleteSchema(schemaURL => 'Parameters4.xsd');
    declare
    v_xsd xmltype := xmltype('<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
               xmlns:oraxdb="http://xmlns.oracle.com/xdb"
               xmlns = "http://www.cognera.com"
               targetNamespace = "http://www.cognera.com">
      <xs:element name="Parameters" oraxdb:SQLName="Parameters" oraxdb:SQLType="Parameters">
        <xs:complexType oraxdb:SQLType="Parameters">
          <xs:sequence>
            <xs:element name="Param1" type="xs:string" oraxdb:SQLName="Param1" oraxdb:SQLType="VARCHAR2" />
            <xs:element name="NestedItems" oraxdb:SQLName="NestedItems" oraxdb:SQLType="NestedItemsType">
              <xs:complexType oraxdb:SQLType="NestedItemsType">
                <xs:sequence>
                  <xs:element name="NestedItem" type="NestedItemType" oraxdb:SQLName="NestedItem" oraxdb:SQLType="NestedItemType"/>
                </xs:sequence>
              </xs:complexType>
            </xs:element>
          </xs:sequence>
        </xs:complexType>
      </xs:element>
      <xs:complexType name="NestedItemType" oraxdb:SQLType="NestedItemType">
        <xs:sequence>
          <xs:element name="nParam1" type="xs:string" oraxdb:SQLName="nParam1" oraxdb:SQLType="VARCHAR2"/>
          <xs:element name="nParam2" type="xs:string" oraxdb:SQLName="nParam2" oraxdb:SQLType="VARCHAR2"/>
          <xs:element name="nParam3" type="xs:string" oraxdb:SQLName="nParam3" oraxdb:SQLType="VARCHAR2"/>
        </xs:sequence>
      </xs:complexType>
    </xs:schema>
    begin
      dbms_xmlschema.registerSchema(schemaURL => 'Parameters4.xsd', --this name is local to each ERS schema.                                
                                          schemaDoc => v_xsd,
                                          local => TRUE,
                                          genTypes => TRUE, --only want the types
                                          genbean => FALSE,
                                          genTables => TRUE, --not sure if I need this
                                          force => TRUE,
                                          owner => user);
    end;
    Types created were:
    CREATE OR REPLACE TYPE "NestedItemType" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","nParam1" VARCHAR2(4000 CHAR),"nParam2" VARCHAR2(4000 CHAR),"nParam3" VARCHAR2(4000 CHAR))NOT FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "NestedItemsType" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","NestedItem" "NestedItemType")FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("SYS_XDBPD$" "XDB"."XDB$RAW_LIST_T","Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    I found that in order to build these types using constructors (to avoid PLS-00306: wrong number or types of arguments in call to 'NestedItemType'), that I needed to edit these types (drop the xdb magic):
    CREATE OR REPLACE TYPE "NestedItemType" AS OBJECT ("nParam1" VARCHAR2(4000 CHAR),"nParam2" VARCHAR2(4000 CHAR),"nParam3" VARCHAR2(4000 CHAR))FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "NestedItemsType" AS OBJECT ("NestedItem" "NestedItemType")FINAL INSTANTIABLE
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    I read on the forums of a hack to get a namespace added in the output:
    CREATE OR REPLACE TYPE "Parameters" AS OBJECT ("@xmlns" VARCHAR2(4000), -- namespace attribute HACK
                                                           "Param1" VARCHAR2(4000 CHAR),"NestedItems" "NestedItemsType")FINAL INSTANTIABLE
    Putting it all together, I have:
    DECLARE
      v_Parameters    "Parameters";
      v_xml           xmltype;
      v_print_output  clob;     
    begin
      v_Parameters :=  "Parameters"('www.cognera.com',
                                    'hello',
                                  "NestedItemsType"("NestedItemType"('one',
                                                                 'two',
                                                                 'three'
      v_xml := xmltype(xmlData => v_Parameters);
      select xmlserialize(document
                          xmlquery('declare namespace soap = "http://www.w3.org/2003/05/soap-envelope";                                                             
                                    declare namespace cognera = "http://www.cognera.com";
                                    <soap:Envelope>
                                       <soap:Header/>
                                       <soap:Body>
                                       </soap:Body>
                                     </soap:Envelope>
                                   ' passing v_xml returning content) as clob
                          indent size=2
                         ) into v_print_output from dual;
      dbms_output.put_line(v_print_output);
    end;
    This outputs:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <Parameters xmlns="www.cognera.com">
          <Param1>hello</Param1>
          <NestedItems>
            <NestedItem>
              <nParam1>one</nParam1>
              <nParam2>two</nParam2>
              <nParam3>three</nParam3>
            </NestedItem>
          </NestedItems>
        </Parameters>
      </soap:Body>
    </soap:Envelope>
    What I really want is:
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:c="www.cognera.com">
      <soap:Header/>
      <soap:Body>
        <c:Parameters>
          <c:Param1>hello</c:Param1>
          <c:NestedItems>
            <c:NestedItem>
              <c:nParam1>one</c:nParam1>
              <c:nParam2>two</c:nParam2>
              <c:nParam3>three</c:nParam3>
            </c:NestedItem>
          </c:NestedItems>
        </c:Parameters>
      </soap:Body>
    </soap:Envelope>
    How do I do this without having to programatically add the namespace using a custom XQuery function?

    See this similar thread, it should give you some better alternatives than the "@xmlns" hack :
    Add Namespaces via XQuery to an XML Instance
    For example :
    SQL> SELECT XMLSerialize(DOCUMENT
      2           XMLTransform(
      3             xmltype(
      4               "Parameters"('hello', "NestedItemsType"("NestedItemType"('one','two','three')))
      5             )
      6           , xmlparse(content
      7  '<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
      8    <xsl:output encoding="UTF-8" indent="yes" method="xml"/>
      9    <xsl:param name="ns"/>
    10    <xsl:template match="/">
    11      <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    12        <soap:Header/>
    13          <soap:Body>
    14               <xsl:apply-templates select="*"/>
    15             </soap:Body>
    16         </soap:Envelope>
    17    </xsl:template>
    18    <xsl:template match="*">
    19      <xsl:element name="{local-name()}" namespace="{$ns}">
    20        <xsl:apply-templates select="@*|node()"/>
    21      </xsl:element>
    22    </xsl:template>
    23  </xsl:stylesheet>')
    24           , q'{ns="'www.cognera.com'"}'
    25           )
    26           INDENT
    27         ) AS "XSLT Output"
    28  FROM dual ;
    XSLT Output
    <?xml version="1.0" encoding="UTF-8"?>
    <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
      <soap:Header/>
      <soap:Body>
        <Parameters xmlns="www.cognera.com">
          <Param1>hello</Param1>
          <NestedItems>
            <NestedItem>
              <nParam1>one</nParam1>
              <nParam2>two</nParam2>
              <nParam3>three</nParam3>
            </NestedItem>
          </NestedItems>
        </Parameters>
      </soap:Body>
    </soap:Envelope>
    You can store the stylesheet in the XDB repository or in a table and access it using a DBUriType.
    It then provides a concise way to both add the namespace and wrap the payload in the envelope.

  • Excel add in problem

    I have an excel add-in problem that seems to be local. When I try to retrieve, it does not show anything. The database is not bad at all because when I log on with my username in a different computer, I get the data upon retrieval. What could be the problem?

    When I try to retrieve, it does not show anythingIf really nothing shows up, the multiple EXCEL.EXE as in the previous answer may be a problem.
    If you have already set up the retreive sheet and you just do not get any data make sure you don't have the Gloabl option "Navigate without data" set.

  • [svn] 1313: Fix for the use namespace problems we've been having with ASC ( I hope).

    Revision: 1313
    Author: [email protected]
    Date: 2008-04-20 09:41:41 -0700 (Sun, 20 Apr 2008)
    Log Message:
    Fix for the use namespace problems we've been having with ASC (I hope). The problem was that the use directive was being defined after we had called finish package. The UseDirectiveNode has a pkgdef ptr, and does different things depending if that ptr is null or not. It should not be null when the UseDirective is inside the package - but since we were generating the UseDirectiveNode after we had called finishPackage the UseDirectiveNode didn't have it's pkgdef ptr set, and so things went awry as the package didn't get set up with all the correct open namespaces. I haven't tested this in authoring/flex but I am pretty sure that this will fix all the problems we're seeing.
    Modified Paths:
    flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/Parser.java

    Many thanks.
    With those symptoms, I'd try the following document:
    Apple software on Windows: May see performance issues and blank iTunes Store
    (If there's a SpeedBit LSP showing up in Autoruns, it's usually best to just uninstall your SpeedBit Video Accelerator.)

  • 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.

  • Namespace problem with added header

    I have a client request handler which needs to add an authentication header of the form:
    <Security>
       <UsernameToken>
          <Username>username</Username>
          <Password>password</Password>
       </UsernameToken>
    </Security>     The key code which does this in the request handler is:
    SOAPHeaderElement she = shd.addHeaderElement(senv.createName(SIGN_HEADER_NAME));
    she.setMustUnderstand(true);
    she.addNamespaceDeclaration("", SIGN_HEADER_URI);
    SOAPElement selToken = she.addChildElement(SIGN_HEADER_TOKEN);
    SOAPElement selUser = selToken.addChildElement(SIGN_HEADER_USERNAME);
    selUser.addTextNode(username);
    selUser = selToken.addChildElement(SIGN_HEADER_PASSWORD);
    selUser.addTextNode(password);But what I end up with is:
    <Security soapenv:mustUnderstand="1" xmlns:soapenv=...
           xmlns="http://demo">
       <UsernameToken  xmlns="">
          <Username>username</Username>
          <Password>password</Password>
       </UsernameToken>
    </Security>     The attributes on the Security element are correct, but the xmlns="" attribute on the UsernameToken element is the problem. The SOAP classes/methods are clearly namespace aware and are essentially saying with xmlns="" that it doesn't know the namespace of UsernameToken and the following elements.
    I tried dropping some wsdl for the security elements in the wsdl directory of the client, but it seems to need some programmatic hookup.
    I have defined the handler in the webservicesclient.xml as:
             <handler id="Handler_1128108948956">
                <description>Adds an authentication header with username & password</description>
                <handler-name>utils.SOAP_Auth_Handler</handler-name>
                <handler-class>utils.SOAP_Auth_Handler</handler-class>
                <soap-header id="SOAPHeader_1128460509232">
                   <namespaceURI>http://demo</namespaceURI>
                   <localpart>Security</localpart>
                </soap-header>
             </handler>How do I keep the soap methods from adding on the xmlns="" to the UsernameToken element?
    I'm running WebSphere App Developer 5.0.2.9.
    Thanks,
    -- Frank

    Can't you use the removeNamespaceDeclaration method?
    public boolean removeNamespaceDeclaration(String prefix)Removes the namespace declaration corresponding to the given prefix.
    Parameters:
    prefix - a String giving the prefix for which to search
    Returns:
    true if the namespace declaration was removed successfully; false if it was not
    Gabsaga

  • Xpath and Namespaces problems

    Hello there! I'm using XPath to parse a document, and so far It was working great! I'm having issues with namespaces though. When the DocumentBuilder is not namespace aware. It works ok. But, when it is namespaceaware. I need to prefix my xpath expressions. for instance "//foo:message". Altough I'm using a namespacecontext and passing it to the Xpath:
    public class FooNamespaceContext implements NamespaceContext {
         public String getNamespaceURI(String prefix) {
              if (prefix == null) throw new NullPointerException("Null prefix");
              else if ("foo".equals(prefix)) return "http://acme.com/foo/schemas";
              else if ("xml".equals(prefix)) return XMLConstants.XML_NS_URI;
              return null;
         public String getPrefix(String arg0) {
              return "foo";
         public Iterator getPrefixes(String arg0) {
              throw new UnsupportedOperationException("Opera��o desnecess�ria para XPath");
    }How can I just use "//message" with no xmlns prefix? Also, if the user changes de prefix on its xml It does not work.
    Could someone point me to a good tutorial or something (the ones I found at Xerces page are not working)
    Regards

    Thanks for your help
    "/ns1:NotificationConfig/ns1:Transport[ns1:TransportName='" + transportName + "'][1]/ns1:TransportClass/text()" Works fine if I add the prefix to the XML document I'm parsing. However I'll need to look into the the namespace binding you suggested for when I cannot guarantee that the prefix will be present.

  • Xpath Namespace problem

    Hi,
    I'm facing a problem while reading an xpath element which has namespace attached.
    The xml document is as follows
    <ns0:_root  xmlns:ns0="http://www.oracle.bt.bp.osm/GPRLN">
    <ns0:Port_and_Routing_Details_g>
    <ns0:Action_Code>
    <ns0:Code1>Add</ns0:Code1>
    <ns0:Code2>Delete</ns0:Code2>
    <ns0:Code3>Update</ns0:Code3>
    </ns0:Action_Code>
    </ns0:Port_and_Routing_Details_g>
    <ns0:Extended_Quantity>1</ns0:Extended_Quantity>
    <ns0:Status>Pending</ns0:Status>
    <ns0:Description/>
    </ns0:_root> In the above xml document i want to capture the text node of <ns0:Code3>Update</ns0:Code3> i.e. I want to get Update as a result.
    I'm using the following java program to to get the value by using xpath but not succeeded.
    public class XMLParsing {
         public static void main(String[] args)
             try {
                       DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
             domFactory.setNamespaceAware(true);
             DocumentBuilder builder = domFactory.newDocumentBuilder();
             Document doc = builder.parse("E:\\sample.xml");
             XPathFactory factory = XPathFactory.newInstance();
             XPath xpath = factory.newXPath();
              XPathExpression fax = xpath.compile("//ns0:Port_and_Routing_Details_g/ns0:Action_Code/ns0:Code3/text()");
                        Object result = fax.evaluate(doc, XPathConstants.NODESET);
              NodeList nodes = (NodeList) result;
              int len = nodes.getLength();
              System.out.println(len);
              for (int i=0; i<len;i++){
                   System.out.println(nodes.item(i).getNodeValue());
             catch (ParserConfigurationException e) {
              e.printStackTrace();
              catch(SAXException e){
                   e.printStackTrace();
              catch(IOException e) {
                   e.printStackTrace();
              catch(XPathExpressionException e){
                   e.printStackTrace();
      }Anybody please help me on this issue
    Thanks

    Hi,
    put bolded code in your program.
    It will resolve your problem
    public class XMLParsing {
         public static void main(String[] args)
         try {
    DocumentBuilderFactory domFactory = DocumentBuilderFactory.newInstance();
         domFactory.setNamespaceAware(true);
         DocumentBuilder builder = domFactory.newDocumentBuilder();
         Document doc = builder.parse("E:\\sample.xml");
    *NamespaceContext ctx = new NamespaceContext() {*
    *public String getNamespaceURI(String prefix) {*
    String uri;
    if (prefix.equals("ns0"))
    uri = "http://www.oracle.bt.bp.osm/GPRLN";
    else if (prefix.equals("ns2"))
    uri = "http://www.davber.com/sales-format";
    else
    uri = null;
    return uri;
    *public Iterator getPrefixes(String val) {*
    *     return null;*
    *// Dummy implemenation - not used!*
    *public String getPrefix(String uri) {*
    return null;
         XPathFactory factory = XPathFactory.newInstance();
         XPath xpath = factory.newXPath();
    xpath.setNamespaceContext(ctx);
         XPathExpression fax = xpath.compile("//ns0:Port_and_Routing_Details_g/ns0:Action_Code/ns0:Code3/text()");
    Object result = fax.evaluate(doc, XPathConstants.NODESET);
              NodeList nodes = (NodeList) result;
              int len = nodes.getLength();
              System.out.println(len);
              for (int i=0; i<len;i++){
                   System.out.println(nodes.item(i).getNodeValue());
         catch (ParserConfigurationException e) {
              e.printStackTrace();
              catch(SAXException e){
                   e.printStackTrace();
              catch(IOException e) {
                   e.printStackTrace();
              catch(XPathExpressionException e){
                   e.printStackTrace();
    }

  • Namespace Problem

    We are having an issue with our bpel processes when it calls an external web services through a partner link,
    There seems to be an issue with the namespaces, our webservice has a complex type request and response name structure,
    The request structure is as follows in the wsdl file the message name is as follows
    <wsdl:message name="HttpRequest">
    <wsdl:part name="request" type="request:HttpRequest"></wsdl:part>
    </wsdl:message>
    <wsdl:message name="HttpResponse">
    <wsdl:part name="http_response" type="request:HttpResponse"/>
    </wsdl:message>
    The issue comes up when we get a response to the webservice which is a complex type return, the return structure adds ns?:code where ? implies a incrememtal number i.e 1, 2 , 3 etc for the whole data of the complex structure.
    The complex Request structure is
    <xsd:complexType name="HttpRequest">
    <xsd:sequence>
    <xsd:element maxOccurs="1" minOccurs="1" name="url" type="xsd:string"/>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="data" type="request:Data"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="type" type="request:HttpType"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="auth" type="request:Auth"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="proxy" type="request:Proxy"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="http_version" type="request:HttpVersion"/>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="headers" type="request:Data"/>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="cookies" type="request:Data"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="HttpType">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="Get"/>
    <xsd:enumeration value="Post"/>
    </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="Auth">
    <xsd:sequence>
    <xsd:element maxOccurs="1" minOccurs="0" name="username" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="password" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Proxy">
    <xsd:sequence>
    <xsd:element maxOccurs="1" minOccurs="1" name="host" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="port" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="username" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="password" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:simpleType name="HttpVersion">
    <xsd:restriction base="xsd:string">
    <xsd:enumeration value="1.0"/>
    <xsd:enumeration value="1.1"/>
    </xsd:restriction>
    </xsd:simpleType>
    The complex Response structure is
    <xsd:complexType name="HttpResponse">
    <xsd:sequence>
    <xsd:element maxOccurs="1" minOccurs="0" name="code" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="body" type="xsd:string"/>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="headers" type="request:Data"/>
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="cookies" type="request:HttpCookie"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Data">
    <xsd:sequence>
    <xsd:element maxOccurs="1" minOccurs="1" name="name" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="1" name="value" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="HttpCookie">
    <xsd:sequence>
    <xsd:element maxOccurs="1" minOccurs="0" name="expires" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="domain" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="path" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="secure" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="name" type="xsd:string"/>
    <xsd:element maxOccurs="1" minOccurs="0" name="value" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    We have tried to set up TCP Tunneling but it doesnt work for somereason, also i have set validateXML to false,
    the return structure is as follow
    Assign_2 (faulted)
    [2005/09/19 10:57:58] Error in evaluate <from> expression at line "52". The result is empty for the XPath expression : "/http_response/body". less
    <http_response>
    <ns2:code xmlns:ns2="http://request.example.domain.com/1.0/Request.xsd">200</ns2:code>
    <ns3:body xmlns:ns3="http://request.example.domain.com/1.0/Request.xsd">OK</ns3:body>
    <ns4:headers xmlns:ns4="http://request.example.domain.com/1.0/Request.xsd">
    <ns4:name>Date</ns4:name>
    <ns4:value>Mon, 19 Sep 2005 00:14:09 GMT</ns4:value>
    </ns4:headers>
    <ns5:headers xmlns:ns5="http://request.example.domain.com/1.0/Request.xsd">
    <ns5:name>date</ns5:name>
    <ns5:value>Mon, 19 Sep 2005 00:14:09 GMT</ns5:value>
    </ns5:headers>
    <ns6:headers xmlns:ns6="http://request.example.domain.com/1.0/Request.xsd">
    <ns6:name>Server</ns6:name>
    <ns6:value>WebLogic WebLogic Server 7.0 SP2 Sun Jan 26 23:09:32 PST 2003 234192</ns6:value>
    </ns6:headers>
    <ns7:headers xmlns:ns7="http://request.example.domain.com/1.0/Request.xsd">
    <ns7:name>server</ns7:name>
    <ns7:value>WebLogic WebLogic Server 7.0 SP2 Sun Jan 26 23:09:32 PST 2003 234192</ns7:value>
    </ns7:headers>
    <ns8:headers xmlns:ns8="http://request.example.domain.com/1.0/Request.xsd">
    <ns8:name>Content-Length</ns8:name>
    <ns8:value>127</ns8:value>
    </ns8:headers>
    <ns9:headers xmlns:ns9="http://request.example.domain.com/1.0/Request.xsd">
    <ns9:name>content-length</ns9:name>
    <ns9:value>127</ns9:value>
    </ns9:headers>
    <ns10:headers xmlns:ns10="http://request.example.domain.com/1.0/Request.xsd">
    <ns10:name>Content-Type</ns10:name>
    <ns10:value>text/html</ns10:value>
    </ns10:headers>
    <ns11:headers xmlns:ns11="http://request.example.domain.com/1.0/Request.xsd">
    <ns11:name>content-type</ns11:name>
    <ns11:value>text/html</ns11:value>
    </ns11:headers>
    <ns12:headers xmlns:ns12="http://request.example.domain.com/1.0/Request.xsd">
    <ns12:name>Expires</ns12:name>
    <ns12:value>Thu, 01 Jan 1970 00:00:00 GMT</ns12:value>
    </ns12:headers>
    <ns13:headers xmlns:ns13="http://request.example.domain.com/1.0/Request.xsd">
    <ns13:name>expires</ns13:name>
    <ns13:value>Thu, 01 Jan 1970 00:00:00 GMT</ns13:value>
    </ns13:headers>
    <ns14:headers xmlns:ns14="http://request.example.domain.com/1.0/Request.xsd">
    <ns14:name>Connection</ns14:name>
    <ns14:value>Close</ns14:value>
    </ns14:headers>
    <ns15:headers xmlns:ns15="http://request.example.domain.com/1.0/Request.xsd">
    <ns15:name>connection</ns15:name>
    <ns15:value>Close</ns15:value>
    </ns15:headers>
    <ns16:cookies xmlns:ns16="http://request.example.domain.com/1.0/Request.xsd">
    <ns16:name>Date</ns16:name>
    <ns16:value>Mon, 19 Sep 2005 00:14:09 GMT</ns16:value>
    </ns16:cookies>
    <ns17:cookies xmlns:ns17="http://request.example.domain.com/1.0/Request.xsd">
    <ns17:name>date</ns17:name>
    <ns17:value>Mon, 19 Sep 2005 00:14:09 GMT</ns17:value>
    </ns17:cookies>
    <ns18:cookies xmlns:ns18="http://request.example.domain.com/1.0/Request.xsd">
    <ns18:name>Server</ns18:name>
    <ns18:value>WebLogic WebLogic Server 7.0 SP2 Sun Jan 26 23:09:32 PST 2003 234192</ns18:value>
    </ns18:cookies>
    <ns19:cookies xmlns:ns19="http://request.example.domain.com/1.0/Request.xsd">
    <ns19:name>server</ns19:name>
    <ns19:value>WebLogic WebLogic Server 7.0 SP2 Sun Jan 26 23:09:32 PST 2003 234192</ns19:value>
    </ns19:cookies>
    <ns20:cookies xmlns:ns20="http://request.example.domain.com/1.0/Request.xsd">
    <ns20:name>Content-Length</ns20:name>
    <ns20:value>127</ns20:value>
    </ns20:cookies>
    <ns21:cookies xmlns:ns21="http://request.example.domain.com/1.0/Request.xsd">
    <ns21:name>content-length</ns21:name>
    <ns21:value>127</ns21:value>
    </ns21:cookies>
    <ns22:cookies xmlns:ns22="http://request.example.domain.com/1.0/Request.xsd">
    <ns22:name>Content-Type</ns22:name>
    <ns22:value>text/html</ns22:value>
    </ns22:cookies>
    <ns23:cookies xmlns:ns23="http://request.example.domain.com/1.0/Request.xsd">
    <ns23:name>content-type</ns23:name>
    <ns23:value>text/html</ns23:value>
    </ns23:cookies>
    <ns24:cookies xmlns:ns24="http://request.example.domain.com/1.0/Request.xsd">
    <ns24:name>Expires</ns24:name>
    <ns24:value>Thu, 01 Jan 1970 00:00:00 GMT</ns24:value>
    </ns24:cookies>
    <ns25:cookies xmlns:ns25="http://request.example.domain.com/1.0/Request.xsd">
    <ns25:name>expires</ns25:name>
    <ns25:value>Thu, 01 Jan 1970 00:00:00 GMT</ns25:value>
    </ns25:cookies>
    <ns26:cookies xmlns:ns26="http://request.example.domain.com/1.0/Request.xsd">
    <ns26:name>Connection</ns26:name>
    <ns26:value>Close</ns26:value>
    </ns26:cookies>
    <ns27:cookies xmlns:ns27="http://request.example.domain.com/1.0/Request.xsd">
    <ns27:name>connection</ns27:name>
    <ns27:value>Close</ns27:value>
    </ns27:cookies>
    </http_response>
    [2005/09/19 10:57:58] "{http://schemas.xmlsoap.org/ws/2003/03/business-process/}selectionFailure" has been thrown. less
    <selectionFailure xmlns="http://schemas.xmlsoap.org/ws/2003/03/business-process/">
    <part name="summary">
    <summary>empty variable/expression result. xpath variable/expression expression "/http_response/body" is empty at line 52, when attempting reading/copying it. Please make sure the variable/expression result "/http_response/body" is not empty.</summary>
    </part>
    </selectionFailure>
    Regards
    Sandeep

    Well, I had this problem also, and it took me two days to find out what caused it, as the incoming message was obviously NOT empty. In our case the error occurred, because we used an assign at Part level, instead of element level.
    Suppose you have an XML like:
    <element name="a">
    <complexType>
    <sequence>
    <element name="b" type="xsd:string">
    <element name="c" type="xsd:string">
    </sequence>
    </complexType>
    </element>
    and you want to move it to another variable that has the same structure. We used the bpws:GetVariable('a') function to assign it to the receiving variable. When we replaced it with a Transform (using XSL), the problem disappeared.
    The problem also occurs when the definition of fields differ, for instance if the messages looks the same but one element on the sending side is defined 'int' and on the receiving end as 'decimal'. Hope this might point you in the right direction.

  • Namespace problem in consuming Webservices in Flash builder 4

    Hi,
    i'm facing a problem in calling a web service after consuming it with the standard wizard. after i consuming it, if i fill the value objects generated by the web service and call the function, it generates the following SOAP payload:
    <SOAP-ENV:Body> <ns1:editProject xmlns:ns1="http://webservices.eee.aaa.com/"> <EditProjectRequest> <projectId>3</projectId> <projectName>Project_344_modifiednow</projectName> <authorName>author-1</authorName> <createdDate>05/01/2010</createdDate> <noOfLicenses>5</noOfLicenses> <validityFromDate>05/04/2010</validityFromDate> <validityToDate>16/04/2010</validityToDate> <projectStatus>DONE</projectStatus> <isActive>1</isActive> <isProtected>0</isProtected> <eBooks> <eBookProjectRoot> <eBookId>1</eBookId> </eBookProjectRoot> </eBooks> </EditProjectRequest> </ns1:editProject> </SOAP-ENV:Body>
    but my webservice expects the payload with additional namespace as highlighted in the example below:
    <SOAP-ENV:Body>
    <ns1:editProject xmlns:ns1="http://webservices.eee.aaa.com/">
    <EditProjectRequest>
    <projectId>3</projectId>
    <projectName>Project_344_modifiednow</projectName>
    <authorName>author-1</authorName>
    <createdDate>05/01/2010</createdDate>
    <noOfLicenses>5</noOfLicenses>
    <validityFromDate>05/04/2010</validityFromDate>
    <validityToDate>16/04/2010</validityToDate>
    <projectStatus>DONE</projectStatus>
    <isActive>1</isActive>
    <isProtected>0</isProtected>
    <eBooks>
    <ns1:eBookProjectRoot>
    <eBookId>1</eBookId>
    </ns1:eBookProjectRoot>
    </eBooks>
    </EditProjectRequest>
    </ns1:editProject>
    </SOAP-ENV:Body>
    Please tell me how to add this namespace to this particular node. you will be a life saver ..

    If I have understood your query correctly, you need to change the QName of the eBookProjectRoot to QName("ns1","ebookProjectRoot").
    Hope this helps,
    Balakrishnan V

Maybe you are looking for