SAAJ and namespace

Hi,
I am having a problem in running SAAJ client for Axis running on Tomcat. My SAAJ code is as follows;
SOAPConnectionFactory soapConnectionFactory = SOAPConnectionFactory.newInstance();
SOAPConnection connection = soapConnectionFactory.createConnection();
MessageFactory factory = MessageFactory.newInstance();
SOAPMessage message = factory.createMessage();
SOAPHeader header = message.getSOAPHeader();
SOAPBody body = message.getSOAPBody();
header.detachNode();
QName bodyName = new QName("http://localhost/axis2/services/SoapService",
"mymethod", "m");
SOAPBodyElement bodyElement = body.addBodyElement(bodyName);
QName name = new QName("vinput");
SOAPElement symbol = bodyElement.addChildElement(name);
symbol.addTextNode("12667");
URL endpoint = new URL("http://localhost/axis2/services/SoapService/mymethod");
SOAPMessage sresponse = connection.call(message, endpoint);
connection.close(); However I am getting runtime errors like this;
SEVERE: Exception occurred while trying to invoke service method mymethod
org.apache.axis2.AxisFault: namespace mismatch require http://localhost/xsd found http://localhost/axis2/services/SoapService
        at org.apache.axis2.rpc.receivers.RPCMessageReceiver.invokeBusinessLogic(RPCMessageReceiver.java:103)
        at org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(AbstractInOutSyncMessageReceiver.java:39)
        at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:144)
        at org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest( My WEB-INF/services.xml is like this;
<service name="SoapService" scope="application">
  <description>RME Soap Service</description>
<messageReceivers>
  <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only" class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
  <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out" class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
  </messageReceivers>
  <schema schemaNamespace="http://localhost/axis2/services/SoapService?xsd" />
  <parameter name="ServiceClass">SoapService</parameter>
  </service> Could you tell me how this thing work? Especially how to specify namespace in different parts! This works fine if I use browser URLs!
Thanks in advance.

I solved this problem. It was related to namespace!

Similar Messages

  • Soap sender adpater issue missing sender interface and namespace in the msg

    Hi Expert,
    I got a problem when try to using soap sender adapter.
    Here is the sceanrio:
    Http web service client call ---PI soap sender adapter -some routing data-business system inbound.
    Sytem information:
    SAP_ABA     700     0019     SAPKA70019     Cross-Application Component
    SAP_BASIS     700     0019     SAPKB70019     SAP Basis Component
    PI_BASIS     2005_1_700     0019     SAPKIPYJ7J     PI_BASIS 2005_1_700
    ST-PI     2008_1_700     0001     SAPKITLRD1     SAP Solution Tools Plug-In
    SAP_BW     700     0021     SAPKW70021     SAP NetWeaver BI 7.0
    ST-A/PI     01L_BCO700     0000          -     Servicetools for other App./Netweaver 04
    Here is my problem. I use soapui trigger a test msg to PI system. But in the sxmb_moni, only sender service is there.
    The sender interface and sender namespace is missing. And the msg has error called: :INTERFACE_REGISTRATION_ERROR.
    Which means I do not have a inbound interface to process the msg.
    But I suppose to redirect the msg to business system.
    Here is the configuration:
    reciever determination: soap sender service, soap outbound interface, soap interface namespace --> reciever business sytem.
    Interface ditermination: soap sender service, soap interface --> receiver interface, receiver namespace.
    Sender agreement: soap service, soap itnerface --- soap communication channel
    receiver agreement, soap service---> receiver sevice, receiver interface, reciever namespace  and reciever cummunication channel
    define of soap sender adapter:
    soap sernder, with use encoded header and use query string checked and qos as exactly once.
    Anyone has any idea here? Many thanks! And most strange thing is yesterday it works and today it failed.
    Please kindly help here.
    Thanks a lot,
    Leon

    Hi guys,
    thanks for the input.
    Hi Sven,
    I have input default interface and namespace.
    Hi sivasakthi,
    Regarding mistype, it may happen, I will do it again right away.
    And the URL is generated by the wsdl toolkit in the directory.
    I marked use encoded header and query string in the communication channel.
    I will generate the wsdl again and test it again.
    Regarding URL(endpoint of web service):
    http://hostname:50000/XISOAPAdapter/MessageServlet?channel=:AGSSAL_SOAP:AGSSAL_SOAP_CC&version=3.0&Sender.Service=AGSSAL_SOAP&Interface=urn:a1s_saplivelinkcontent.service.sap.com^MI_O_AS_DELIVERNOTIFY_SOAP
    Again thanks for you guys help.
    Best regards,
    Leon

  • Deleting Message Type name and namespace tag from XML payload

    Hi Gurus,
    Need help. My payload looks like this
    <?xml version="1.0" encoding="utf-8" ?>
    - <ns1:MT_O_sss xmlns:ns1="http://sap.com/xi/tm">
    - <Job>
       <Field name="xxxx" value="" />
      <Field name="xxx" value="" />
      <Field name="xxx" value="" />
       </Job>
      </ns1:MT_O_sss>
    But The soap webservice is expecting it in
    <?xml version="1.0" encoding="utf-8" ?>
    - <Job>
       <Field name="xxxx" value="" />
      <Field name="xxx" value="" />
      <Field name="xxx" value="" />
       </Job>
    I have to remove the message type name and namespace tag.
    So how can I achieve this. I am sending this payload using a Receiver Soap Adapter. Please help. I am kind of stuck.

    hi,
    you have to simply add one module in your communication channel
    that is XMLAnonymizerBean
    you can refer below for help:
    Remove namespace prefix or change XML encoding with the XMLAnonymizerBean
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/bf37423cf7ab04e10000000a1550b0/frameset.htm
    hope it helps.
    regards,
    ujjwal kumar

  • Need information about interfaces and namespaces in actionscript 3.0

    Hi,
    I need information about actionscript interfaces and
    namespaces, I'm preparing for ACE for Flash CS3 and I need to learn
    about this subjects and I can not find resources or simple examples
    that make these subjects understandable.
    Anybody can help me!
    Thanks a lot.

    Interfaces (cont.)
    Perhaps the most useful feature of interfaces is that you not
    only can define the data type but also method signature of the
    class that implements this interface. In other words, interface can
    define and enforce what methods class MUST implement. This is very
    useful when classes are branching in packages and team of
    developers works on a large application among others.
    The general syntax for an Interface with method signatures is
    written the following way:
    package{
    public interface InterfaceName {
    // here we specify the methods that will heave to be
    implemented
    function method1 (var1:dataType,
    var2:datType,…):returnType;
    function method2 (var1:dataType,
    var2:datType,…):returnType;
    To the previous example:
    package{
    public interface IQualified {
    function method1 ():void;
    function method2 ():int;
    Let’s write a class that implements it.
    If I just write:
    package{
    public class ClassOne extends DisplayObject implements
    IQualified {
    public function ClassOne(){}
    I will get a compilation error that states that I did not
    implement required by the interface methods.
    Now let’s implement only one method:
    package{
    public class ClassOne extends DisplayObject implements
    IQualified {
    private function method1():void{
    return;
    public function ClassOne(){}
    I will get the error again because I implemented only one out
    of two required methods.
    Now let’s implement all of them:
    package{
    public class ClassOne extends DisplayObject implements
    IQualified {
    private function method1():void{
    return;
    private function method2():int{
    return 4;
    public function ClassOne(){}
    Now everything works OK.
    Now let’s screw with return datatypes. I attempt to
    return String instead of void in method1 in ClassOne:
    private function method1():String{
    return “blah”;
    I am getting an error again – Interface requires that
    the method1 returns void.
    Now let’s attempt to pass something into the method1:
    private function method1(obj:MovieClip):void{
    return;
    Oops! An error again. Interface specified that the function
    doesn’t accept any parameters.
    Now rewrite the interface:
    package{
    public interface IQualified {
    function method1 (obj:MovieClip):void;
    function method2 ():int;
    Now compiler stops complaining.
    But, if we revert the class back to:
    private function method1():void{
    return;
    compiler starts complaining again because we don’t pass
    any parameters into the function.
    The point is that interface is sort of a set of rules. In a
    simple language, if it is stated:
    public class ClassOne implements IQualified
    it says: “I, class ClassOne, pledge to abide by all the
    rules that IQualified has established and I will not function
    correctly if I fail to do so in any way. (IMPORTANT) I can do more,
    of course, but NOT LESS.”
    Of course the class that implements an interface can have
    more that number of methods the corresponding interface requires
    – but never less.
    MORE means that in addition to any number of functions it can
    implement as many interfaces as it is desired.
    For instance, I have three interfaces:
    package{
    public interface InterfaceOne {
    function method1 ():void;
    function method2 ():int;
    package{
    public interface InterfaceTwo {
    function method3 ():void;
    package{
    public interface InterfaceThree{
    function method4 ():void;
    If our class promises to implement all three interface it
    must have all four classes in it’s signature:
    package{
    public class ClassOne extends DisplayObject implements
    InterfaceOne, InterfaceTwi, InterfaceThree{
    private function method1():void{return;}
    private function method2():int{return 4;}
    private function method3():void{return;}
    private function method4():void{return;}
    public function ClassOne(){}
    Hope it helps.

  • Private dictionaries and Namespaces

    Private dictionaries and Namespaces
    We ran into an issue with some email templates in converting from RC2006 to RC2008.3 where Namespace values from Private service dictionaries were not populating correctly in RC2008.
    In the upgrade process from RC2006, any private dictionaries are converted to actual dictionaries. They are created in the Dictionary Group UPGD: PRIVATE DICTIONARIES and the dictionary name is based on the service name: PRIV_ServiceA.
    What I found as we were testing is that the Namespace parameters in Email templates (and, presumably, conditional statements and other places) no longer worked.
    The reason is that the Namespace Parameter for a private dictionary did not use a dictionary name, e.g. #SERVICE.DATA.Field1#. In order for the RC2008 version to work, we had to add dictionary references:  #SERVICE.DATA.PRIV_ServiceA.Field1#.

    Hey M.VAL,
    Thanks for the question. If your dictionary is not available after updating your device, you may need to redownload it:
    iOS: Dictionary isn't available after updating to the latest version of iOS
    http://support.apple.com/kb/TS5238
    Thanks,
    Matt M.

  • The system and namespace change option

    Hi Experts,
    I want to integrate a certain SAP Source System within RSA1. After submitting the correct settings for Background User and RFC connection the process leads me to the Source System where I logon with an User which has authorizations in SM59. From there on (the RFC Connection backwards is already defined) I got asked whether I want to user/check/cancel this existing RFC Connection. I click on use, wait for a while and then the error (please see below) appears.
    When proceeding with the steps mentioned in the error message (transaction SE03, Administration node, ...) I cannot find any IDOC Object ZSSA009. I think maybe it's related to some software component or somenthing like that which should be set as "modifiable" but I don't know which....
    Any Ideas on this?
    Many thanks in advance.
    Best regards
    Tobias
    Error Message:
    Message no. TO128
    Diagnosis
    The system and namespace change option set for this SAP System does not allow any changes to be made to object IDOC ZSSA009.
    System Response
    Editing is terminated, the object can only be displayed.
    Procedure
    If you want to edit the object IDOC ZSSA009 in this SAP System, have your system administator set the SAP System to "modifiable" for this object.
    This can affect the modifiability of the namespace &1 or the namespaces that correspond to the pattern &1, as well as the global setting of the system change option.
    The system change option is set using the Transport Organizer tools (Transaction SE03). Expand the Administration node and execute the program Set system change option. The options are described there.

    HI,
    Attached link may help you in configuring the source system.
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/908836c3-7f97-2b10-4cb8-e6790361c152
    Thanks,
    Arun

  • Get Message ID and namespace from ABAP Mapping

    Hi XI Expert,
    Please advise how to get the message ID and namespace from ABAP Mapping.
    Thank You and best Regards
    Fernand

    Hi,
    To access the message ID, use the method GET_MESSAGE_ID of the controller object:
           1.      Fetch a protocol instance for the protocol IF_WSPROTOCOL_MESSAGE_ID.
           2.      To have the system return the message ID after the sender has sent a request message or the receiver has received a request message, use the method GET_MESSAGE_ID of this instance. This returns the ID by using the parameter MESSAGE_ID of type SXMSGUID.
    Also you could do the same by this way also:
    IF_WSPROTOCOL_XI_HEADER
    has attributes messageid and interface namespace.
    using this  you can read the XI message header

  • Add a root node and namespace declaration

    According to the requirement,I have a large appended .txt file.
    This .txt file is created by appending various xml files (without the namespace and root node).
    I need to add a root node and namespace declaration to the large appended .txt file so that it can be read as .xml.
    Please provide the pointers for the same.
    Thanks & Regards,
    Rashi

    My appended file looks like following.
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>56</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>123</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>B</Item>
                <ItemPrice>8</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    Now according to the requirement, I need to add namespace and root node and make it like follows:
    <ns0:output xmlns:ns0="http://xxx">
       <input>
       <Store>
          <StoreHeader>
             <StoreNbr>56</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    <input>
       <Store>
          <StoreHeader>
             <StoreNbr>123</StoreNbr>
             <StoreType>Retail</StoreType>
             <StoreSite>2004</StoreSite>
          </StoreHeader>
          <Transactions>
             <Transaction>
                <Item>A</Item>
                <ItemPrice>4</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>B</Item>
                <ItemPrice>8</ItemPrice>
             </Transaction>
             <Transaction>
                <Item>C</Item>
                <ItemPrice>56</ItemPrice>
             </Transaction>
          </Transactions>
       </Store>
    </input>
    </ns0:output>

  • Portal Event name and namespace (ECM)

    Hi Experts
    I want to register for the Portal Event that gets triggered when an employee is selected.
    In the Compensation Information page, there is an employee search iview. I need to know what Portal Event name and namespace is triggered when an employee is selected.
    Does somebody already know what the name and namespace is?
    thanks in advance
    Anton Kruse

    Found the solution here: Parameter Passing from WDJ iview to WDABAP Iview
    call function 'HR_ASR_WDA_GET_EMPLOYEE'
       exporting
          id = 'MSS01'   "ABAP Memory ID To get the PERNR Selected.
       importing
          pernr = gv_pernr.

  • DOM parser and namespaces

    Hello -
    I have an interesting situation...
    I have a webservice and I want my client to be able to send a org.w3c.dom.Document object as the body of the SOAP request.
    This is easily done w/ the SAAJ API for web services.
    I also want to validate the Document before I send it over the wire.
    Code:
    DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
    factory.setNamespaceAware(true);
    factory.setValidating(true);
    DocumentBuilder builder = factory.newDocumentBuilder();
    Document document = builder.parse(xmlFileToUpload);
    I have verified that WebLogic 8.1 is using the Apache Xerces parser.
    The XML file that the client will be uploading looks something like this:
    <uploadJobData xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://C:\ComputingJobsUpload.xsd">
         <computingJobs>
              <job> .... </job>
    </computingJobs>
    </uploadJobData>
    My schema looks like this:
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">
         <xs:element name="uploadJobData">
              <xs:complexType>
                   <xs:all>
                        <xs:element name="computingJobs" type="ArrayOfComputingJobs"/>
    <xs:element name="name" type="xs:string"/>
                   </xs:all>
              </xs:complexType>
         </xs:element>
         <xs:complexType name="ArrayOfComputingJobs">
              <xs:sequence>
                   <xs:element name="job" type="ComputingJob" maxOccurs="unbounded"/>
              </xs:sequence>
         </xs:complexType>
    <xs:complexType name="ComputingJob">
              <xs:all>
                   <xs:element name="queuedTime" type="xs:dateTime"/>
                   <xs:element name="beginTime" type="xs:dateTime"/>
                   <xs:element name="endTime" type="xs:dateTime"/>
                   <xs:element name="numCpusUsed" type="xs:short"/>
                   <xs:element name="numNodesUsed" type="xs:short"/>
                   <xs:element name="chargeFactor" type="xs:decimal"/>
              </xs:all>
         </xs:complexType>
    </xs:schema>
    The problem is, when the code turns on validation, I get an error that states:
    org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'uploadJobData'.
    Why is this?
    Also - and an even bigger issue -
    When I turn off validation, everything works fine. I can handle this, except that the newly added Document in my SOAPBody now has an XML namespace attribute (xmlns) for every element! My namespace is fairly large, so its making the content length of my SOAP request almost twice as big!
    After parsing the XML file in the DocumentBuilder, the XML looks something like this:
    <ns1:uploadJobData xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file://C:\ComputingJobsUpload.xsd" xmlns:ns1="http://server.jobupload.services.mics.apps.mis.jlab.org">     
    <computingJobs xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org">
    <job xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org">...</job>
    </computingJobs>
    <name xmlns="http://server.jobupload.services.mics.apps.mis.jlab.org">JLab</name>
    </ns1:uploadJobData>
    As you can see, the parser places the namespace attribute for every element.
    Is there any way to turn this off?
    Thanx in advance.
    --Bobby                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Next release is planed to be out next week. We will annouced here when they are ready for download.

  • J2SE adapter PI 7.1 issue with XML to flat conversion and namespace length

    Dear reader,
    We are facing an issue with J2SE Adapter PI7.1 for a number of flows.
    The flow requirements:
    [1] Namespace length for interfaces is up to 100 characters
    [2] The XML message must be converted to Flat on the adapter channel
    Our PI system is at patch level 7 and we implement J2SE adapter on patch level 7 as well.
    We found that the J2SE adapter on patch level 7 does not support long namespaces [1] (as it should since this is an PI 7.1 j2SE adapter) but no issues where found with the XML to flat conversion [2].
    Experimenting with J2SE adapter on patch level 6 we found the long namespaces [1] are supported however an issue is found with the XML to flat conversion [2] as stated in SAP note 1335527.
    An SAP Customer Message is raised on this issue however your input is highly appricated!
    With Kind Regards,
    Harald Kastelijn
    Edited by: Harald Kastelijn on Mar 6, 2010 9:17 AM
    Edited by: Harald Kastelijn on Mar 6, 2010 9:19 AM

    We found that the J2SE adapter on patch level 7 does not support long namespaces [1] (as it should since this is an PI 7.1
    j2SE adapter) but no issues where found with the XML to flat conversion [2]
    I think the restriction of namespace length still remains in design time (IR).....the same however has been extended in configuration and runtime...this SAP note has some information: https://service.sap.com/sap/support/notes/870809

  • XPATH-expressions and namespaces

    I have a xml-file for testing my xpath expression, like this:
    <a>
       <b>
          <c>aaa</c>
             <d>
                <e>111</e>
             </d>
       </b>
       <b>
          <c>bbb</c>
             <d>
                <e>222</e>
             </d>
       </b>
       <b>
          <c>ccc</c>
             <d>
                <e>333</e>
             </d>
       </b>What I want is to get the value of element 'e', based on a check on what the value of element 'c' is. I alway know the value of element 'c'.
    I solve this by using this xpath-expression in my xsl-file:
    <xsl:variable name="xpathTest" select="//e[../preceding-sibling::c = 'bbb']" />This expression should return '222', and it works!!!
    But, when I use the another xml-file with a similar structure, with namespaces, like this:
    <body xsi:type="fkpsoap:FKPSOAPOperationResponse">
       <FKPSOAPOperationResponse>
          <fkpsoap_1:fkrdk178_output_data>
             <fkpsoap_1:fkrdk178_list_cust_information>
                <fkpsoap_1:fkrdk178_list_customerinfo>
                   <fkpsoap_1:fkrdk178_list_variable_code> aaa </fkpsoap_1:fkrdk178_list_variable_code>
                   <fkpsoap_1:fkrdk178_list_value_name>
                      <fkpsoap_1:fkrdk178_list_value_text> 111 </fkpsoap_1:fkrdk178_list_value_text>
                </fkpsoap_1:fkrdk178_list_customerinfo>
                <fkpsoap_1:fkrdk178_list_customerinfo>
                   <fkpsoap_1:fkrdk178_list_variable_code> bbb </fkpsoap_1:fkrdk178_list_variable_code>
                   <fkpsoap_1:fkrdk178_list_value_name>
                      <fkpsoap_1:fkrdk178_list_value_text> 222 </fkpsoap_1:fkrdk178_list_value_text>
                </fkpsoap_1:fkrdk178_list_customerinfo>
                <fkpsoap_1:fkrdk178_list_customerinfo>
                   <fkpsoap_1:fkrdk178_list_variable_code> ccc </fkpsoap_1:fkrdk178_list_variable_code>
                   <fkpsoap_1:fkrdk178_list_value_name>
                      <fkpsoap_1:fkrdk178_list_value_text> 333 </fkpsoap_1:fkrdk178_list_value_text>
                </fkpsoap_1:fkrdk178_list_customerinfo>
             </fkpsoap_1:fkrdk178_list_cust_information>
          </fkpsoap_1:fkrdk178_output_data>
       </FKPSOAPOperationResponse>
    </body>Then the xpath-expression does not work!
    I can easily extract the value of the element similar to the element 'e' in my test-file, but then I will always get the value from the first occurance of 'e', which is '111'.
    Can anyone help me with this?

    Most APIs which let you create XPath objects allow you to create a namespace context and attach it to the XPath object. Your API most likely does too, whatever it is. Then you would just use the prefixes which the namespace context describes in your XPath expression.
    (This namespace context generally maps prefixes to namespace URIs. Remember that the namespace URI is really what the XPath is looking for and the prefix is just a short cut for you to use.)

  • JSP documents and namespaces

    I have an issue involving JSP documents (i.e. JSP pages that are
              well-formed XML documents). I am using namespaces on children elements
              of the <jsp:root> element, because my JSP page generates XML with
              namespaces. The simple fragment below illustrates this:
              <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
              version="1.2">
              <d:document xmlns:d="http://example.org/xml/document">
              <d:head>
              <d:title>Example</d:title>
              </d:head>
              <d:body>
              Some Text.
              </d:body>
              </d:document>
              </jsp:root>
              This example works with Tomcat 4 and Tomcat 5, but fails with WL
              8.1. I get an error like this:
              /example/my.jsp(20): no corresponding open tag for tag extension
              close: //[ ; Line: 20]
              probably occurred due to an error in /example/my.jsp line 20:
              </d:document>
              This seems to be a bug in the WebLogic JSP implementation. It should
              be possible to generate XML documents containing namespaces. The JSP
              1.2 spec is actually silent on this, but it says (JSP.5.2.2):
              "the root is where namespace attributes of taglibs will be inserted.
              All tag libraries used within the JSP document are represented in the
              root element through additional xmlns attributes."
              This to me implies that namespace declarations occurring elsewhere in
              the document are not interpreted as tag libs and therefore should be
              handled like regular tags.
              Any help is appreciated.
              -Erik
              

              "Erik Bruchez" <[email protected]> wrote in message
              news:[email protected]...
              > Thanks Nagesh,
              >
              > In passing, looking at the latest JSP 2.0 spec, I found out that there
              > may be an additional issue in the future, as the 2.0 spec allows for
              > tag libraries namespace declarations everywhere in the document. How
              > are you going to be able to generate XML documents with namespaces if
              > every namespace is necessarily bound to a tag library? The spec does
              > not seem to address this at all. I have emailed my feedback to the
              > JSR, but it would be interesting to have the opinion of WebLogic
              > developers on this.
              >
              > -Erik
              As far as i can remember, this doesn't restrict the namespaces in themselves
              i.e not attached to any taglibs. Given a namespace which is not resolved as
              a taglib, it will be considered a standard namespace no? .. Am i missing
              something. Also which section and which PFD version of the spec are you
              looking at? It would be great if you can give a little more detail about the
              issue so it can be fixed in the spec if possible..
              I would also be interested in knowing how you are using the Jsp documents
              (in xml format) in general. (since I'm trying to get an insight into the
              various ways in which jsp Docs are being used by customers)
              Nagesh
              >
              > Nagesh Susarla <[email protected]> wrote in message
              news:<[email protected]>...
              > > Hi Erik,
              > >
              > > Indeed this does look like a bug in the wls jsp container. Attributes
              > > with ':' in them are not being lexed correctly. I've opened CR111972 to
              > > track this issue, so please contact [email protected] for necessary
              patches.
              > >
              > > thanks
              > > Nagesh
              > >
              > > Erik Bruchez wrote:
              > > > I have an issue involving JSP documents (i.e. JSP pages that are
              > > > well-formed XML documents). I am using namespaces on children elements
              > > > of the <jsp:root> element, because my JSP page generates XML with
              > > > namespaces. The simple fragment below illustrates this:
              > > >
              > > > <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page"
              > > > version="1.2">
              > > > <d:document xmlns:d="http://example.org/xml/document">
              > > > <d:head>
              > > > <d:title>Example</d:title>
              > > > </d:head>
              > > > <d:body>
              > > > Some Text.
              > > > </d:body>
              > > > </d:document>
              > > > </jsp:root>
              > > >
              > > > This example works with Tomcat 4 and Tomcat 5, but fails with WL
              > > > 8.1. I get an error like this:
              > > >
              > > > /example/my.jsp(20): no corresponding open tag for tag extension
              > > > close: //[ ; Line: 20]
              > > > probably occurred due to an error in /example/my.jsp line 20:
              > > > </d:document>
              > > >
              > > > This seems to be a bug in the WebLogic JSP implementation. It should
              > > > be possible to generate XML documents containing namespaces. The JSP
              > > > 1.2 spec is actually silent on this, but it says (JSP.5.2.2):
              > > >
              > > > "the root is where namespace attributes of taglibs will be inserted.
              > > > All tag libraries used within the JSP document are represented in the
              > > > root element through additional xmlns attributes."
              > > >
              > > > This to me implies that namespace declarations occurring elsewhere in
              > > > the document are not interpreted as tag libs and therefore should be
              > > > handled like regular tags.
              > > >
              > > > Any help is appreciated.
              > > >
              > > > -Erik
              

  • XSLT Mapping and Namespace Issues

    I have been reading through similar threads on this topic, but have not found the right combination for my problem.  I am doing an XSLT map and it works fine in Stylus Studio.  When I take it to PI, I get a "Prefix 'ns0' is not mapped to a namespace" error.  I have a namespace that is within the XSD files I received from my partner (http://www.ups.com/XMLSchema/EBR/Billing/v1).  I also have the namespace I made in PI for the source (http://graybar.com/upsbilling/) and a different namespace in PI for the destination (http://graybar.com/cold/invoice/).
    <u><b>XSLT:</b></u>
    <?xml version='1.0' encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.ups.com/XMLSchema/EBR/Billing/v1" xmlns:ns1="http://graybar.com/cold/invoice/">
    <xsl:template match="/">
    <ns1:ColdInvoiceData>
      <Header>
      <RecordID>HDR</RecordID>
      <InvoiceDate>
      <xsl:value-of select="ns0:UPS_EBR_BILL/ns0:InvoiceDetails/ns0:Invoice/ns0:InvoiceDateCCYYMMDD"/>
      </InvoiceDate>
    <u><b>Source XML</b></u>
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <UPS_EBR_BILL xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.ups.com/XMLSchema/EBR/Billing/v1" xsi:schemaLocation="http://www.ups.com/XMLSchema/EBR/Billing/v1 Billing_XML_Schema.xsd">
    <XMLBillFileVersion>1.0.1</XMLBillFileVersion>
    <Recipient>
    When I change the XSLT namespace from http://www.ups.com/XMLSchema/EBR/Billing/v1 to http://graybar.com/upsbilling/, the TransfromerException in PI goes away, but none of my referenced mappings work either (just my text hardcodes).
    Can someone tell me why this works in Stylus Studio, but not in PI?  Do I have too many namespaces?
    Message was edited by:
            Keith Wendel (to uncomment xsl:stylesheet line)

    > <ns1:ColdInvoiceData xmlns:ns1="http://graybar.com/cold/invoice/">
    This change did not affect anything.  Still works in Stylus Studio though.
    Did you mean to show any changes at the <xsl:value-of select> line?  I did not notice anything there.
    Can anyone explain what "not mapped to a namespace" means?  I have the declaration of ns0 at the top, so I don't see what else needs to be mapped.  Do I have to have my PI namespace where I store the partner's XSDs set as "http://www.ups.com/XMLSchema..." (partner's namespace)?

  • Problems with XMLType and namespace

    Dear subscribers:
    I have been using XMLType successfully with simple XMLs - without namespaces. Now I must handle messages with "xmlns" and it seems XMLType is failing.
    I tested the following XML, extracted from w3c.org examples:
    <?xml version="1.0"?>
    <bk:book xmlns:bk=''urn:loc.gov:books''
    xmlns:isbn=''urn:ISBN:0-395-36341-6''>
    <bk:title>Cheaper by the Dozen</bk:title>
    <isbn:number>1568491379</isbn:number>
    </bk:book>
    The result of “xmlt.getRootElement()” is “book”.
    However, the use of “xmlt.extract( 'book' )” returns an empty object:
    xmlt1 := xmlt.extract( 'book' );
    dbms_output.put_line( 'StringVal: ' || xmlt1.getStringVal() );
    ORA-30625: method dispatch on NULL SELF argument is disallowed
    The following usages also raise errors:
    xmlt1 := xmlt.extract( 'bk:book' );
    ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00601: Invalid token in: 'bk:book' ORA-06512: at "SYS.XMLTYPE", line 111
    xmlt1 := xmlt.extract( 'bk::book' );
    ORA-31011: XML parsing failed ORA-19202: Error occurred in XML processing LPX-00601: Invalid token in: 'bk::book' ORA-06512: at "SYS.XMLTYPE", line 111
    xmlt1 := xmlt.extract( 'book', 'bk' );
    ORA-31013: Invalid XPATH expression ORA-06512: at "SYS.XMLTYPE", line 119
    I am using Oracle version 10.2.0.1.0. Had someone also faced this problem?
    The code I used to test is at the end of this message.
    Thanks in advance
    ====================================
    DECLARE
    xml varchar2(32000);
    xmlt XMLType;
    xmlt1 XMLType;
    root varchar2(3000);
    BEGIN
    --Example from w3c.org
    xml := '<?xml version="1.0"?>
    <bk:book xmlns:bk=''urn:loc.gov:books''
    xmlns:isbn=''urn:ISBN:0-395-36341-6''>
    <bk:title>Cheaper by the Dozen</bk:title>
    <isbn:number>1568491379</isbn:number>
    </bk:book>';
    xmlt := XMLType( xml );
    root := xmlt.getRootElement();
    dbms_output.put_line( 'StringVal: ' || xmlt.getStringVal() ); -- The XML is ok…
    dbms_output.put_line( 'Namespace: ' || xmlt.getNameSpace() ); -- Returns NULL
    dbms_output.put_line( 'Root element: ' || root ); -- Returns ‘book’
    dbms_output.put_line( 'Exists: ' || xmlt.existsNode('book') ); -- Returns ZERO
    xmlt1 := xmlt.extract( 'bk:book' ); Raises error (see above)
    xmlt1 := xmlt.extract( 'bk::book' ); Raises error (see above)
    xmlt1 := xmlt.extract( 'book', 'bk' ); Raises error (see above)
    --xmlt1 := xmlt.extract( 'book' );
    dbms_output.put_line( 'StringVal: ' || xmlt1.getStringVal() ); Raises error
    END;
    /

    If you put your XML into a namespace then you also need to extract from that namespace.... e.g.
    No namespace...
    SQL> select t.xml.extract('myroot')
    2 from (select XMLTYPE('<myroot><mychild>test</mychild></myroot>') as xml from dual) t
    3 ;
    T.XML.EXTRACT('MYROOT')
    <myroot>
    <mychild>test</mychild>
    </myroot>Put XML in namespace and now the extract returns nothing...
    SQL> ed
    Wrote file afiedt.buf
    1 select t.xml.extract('myroot')
    2* from (select XMLTYPE('<myroot xmlns="fred"><mychild>test</mychild></myroot>') as xml from dual) t
    3 /
    T.XML.EXTRACT('MYROOT')
    --------------------------------------------------------------------------------------------------------Extract, specifying the namespace to extract from and now returns the result...
    SQL> ed
    Wrote file afiedt.buf
    1 select t.xml.extract('myroot', 'xmlns="fred"')
    2* from (select XMLTYPE('<myroot xmlns="fred"><mychild>test</mychild></myroot>') as xml from dual) t
    SQL> /
    T.XML.EXTRACT('MYROOT','XMLNS="FRED"')
    <myroot xmlns="fred">
    <mychild>test</mychild>
    </myroot>
    SQL>;)

Maybe you are looking for