Namespaces in TransformerHandler?

Are SAX namespace events correctly handled by javax.transformer.sax.TransformerHandler? Given the following class:
import javax.xml.transform.sax.TransformerHandler;
import javax.xml.transform.sax.SAXTransformerFactory;
import javax.xml.transform.stream.StreamResult;
import org.xml.sax.helpers.AttributesImpl;
public class NameSpaceTest {
    public static void main(String[] args) throws Exception {
        SAXTransformerFactory factory = ( SAXTransformerFactory )SAXTransformerFactory.newInstance();
        TransformerHandler handler = factory.newTransformerHandler();
        handler.setResult( new StreamResult( System.out ));
        handler.startDocument();
        handler.startPrefixMapping( "", "http://one.namespace.com" );
        handler.startPrefixMapping( "two", "http://two.namespace.com" );
        handler.startElement( "http://one.namespace.com", null, "foo", new AttributesImpl() );
        handler.startElement( "http://two.namespace.com", "bar", "two:bar", new AttributesImpl() );
        handler.endElement( "http://two.namespace.com", "bar", "two:bar" );
        handler.endElement( "http://one.namespace.com", null, "foo" );
        handler.endPrefixMapping( "two" );
        handler.endPrefixMapping( "" );
        handler.endDocument();
}One would expect the output to be
  <foo xmlns="http://one.namespace.com" xmnls:two="http://two.namespace.com">
    <two:bar/>
  </foo>But, alas, the following is output:
  <foo>
    <two:bar/>
  </foo>The above, alas, is well-formed but it isn't valid.

I tried this in Java 1.3 with Saxon as my transformer, and it threw a NullPointerException. When I modified your code to replace null by "foo" like this:handler.startElement( "http://one.namespace.com", null, "foo", new AttributesImpl() );and ditto for endElement, it worked the way you expected it to work, with the correct namespace declarations output. Didn't try it in 1.4 with whatever transformer they have in there.

Similar Messages

  • Setting Namespace for Xalan

    I'm using JAXP 1.2
    I have a custom sax parser (implements XMLReader) that reads csv files then sends SAX events to a stylesheet for translation. My problem is that Xalan requires a namespace-aware SAX parser. The SAXParserFactory has a method (setNamespaceAware()) which allows you to change this to "true", since the default is "false". Since I'm not using the SAXParserFactory to create my reader, I'm not sure how to set this using my custom parser. I have implemented the setFeature and getFeature by storing the values in a HashMap. See code below. I then execute the setFeature for my parser before I use the translator to set namespace to true.
    csvReader.setFeature("http://xml.org/sax/features/namespace-prefixes",true);
    csvReader.setFeature("http://xml.org/sax/features/namespace",true);
    I'm not sure how to get Xalan to recognize these Features without creating a parser from the Factory. Any ideas?
    /***************** CODE SAMPLE *****************/
    private Map featureMap = new HashMap();
    public boolean getFeature(String name)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    Boolean featureValue = (Boolean) this.featureMap.get(name);
    return (featureValue == null) ? false
    : featureValue.booleanValue();
    public void setFeature(String name, boolean value)
    throws SAXNotRecognizedException, SAXNotSupportedException {
    this.featureMap.put(name, new Boolean(value));
    }

    Here's some code I have in production:SAXParserFactory spf = SAXParserFactory.newInstance();
    XMLReader reader = spf.newSAXParser().getXMLReader();
    reader.setContentHandler(handler);
    reader.setProperty("http://xml.org/sax/properties/lexical-handler", handler);
    reader.setFeature("http://xml.org/sax/features/namespaces", true);
    reader.setFeature("http://xml.org/sax/features/namespace-prefixes", false);And here's the method that produces the "handler" object:private synchronized TransformerHandler getHandler(String xslFile) throws TransformerConfigurationException {
      SAXTransformerFactory factory = (SAXTransformerFactory)TransformerFactory.newInstance();
      Templates t = (Templates)templates.get(xslFile);
      if (t == null) {
        t = factory.newTemplates(new StreamSource(new File(getServletContext().getRealPath(xslFile))));
        templates.put(xslFile, t);
      return factory.newTransformerHandler(t);
    }This works for me. The difference is that I am using Saxon instead of Xalan to do the transformation, and possibly that is a significant difference.

  • What happened to attribute namespace declaration

    Hi,
    The code below:
    public class XMLWriter {
         public static void writeXML() throws TransformerFactoryConfigurationError,
                   TransformerConfigurationException, SAXException {
              SAXTransformerFactory tf = (SAXTransformerFactory) SAXTransformerFactory
                        .newInstance();
              tf.setAttribute("indent-number", Integer.valueOf(4));
              TransformerHandler hd = tf.newTransformerHandler();          
              Transformer t = hd.getTransformer();
              t.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
              t.setOutputProperty(OutputKeys.METHOD, "xml");
              t.setOutputProperty(OutputKeys.INDENT, "yes");
              hd.setResult(new StreamResult(new OutputStreamWriter(System.out)));
              AttributesImpl atts = new AttributesImpl();
              atts.addAttribute("http://attribs.com/attImpl", "attribOne", "someNamespace:attribOne", "string",
                        "someValue");          
              hd.startDocument();
              hd.startElement("http://example.com", "tag", "a:tag", atts);
              hd.endElement("http://example.com/a", "tag", "a:tag");
              hd.endDocument();
         public static void main(String[] args) {
              try {
                   writeXML();
              } catch (Exception e) {
                   e.printStackTrace();
    }produces the following output (using JRE 1.6.0_01):
    <?xml version="1.0" encoding="UTF-8"?>
    <a:tag xmlns:a="http://example.com" someNamespace:attribOne="someValue"/>but where's the namespace declaration for someNamespace? What to do to make sure that the namespace declaration for an attribute is included in the output.
    Regards,

    Thank you, that works just fine,
    it's a shame though that TransformerHandler is capable of generating namespace declatarion for Element but not it's attributes.
    Regards,

  • Output custom string to SAX TransformerHandler

    Hi
    How can I output a custom String to a SAX TransformerHandler? I don't think my string is valid XML but I want to add it anyway.
    The String I want to add is: "<?import namespace="t" implementation="#default#time2">"
    Can I do it by writing using the characters method? E.g. something close to:
    myTransformerHandler.characters("<?import namespace=\"t\" implementation=\"#default#time2\">".toCharArray(),
                                      0,
                                         "<import namespace=\"t\" implementation=\"#default#time2\">".length());     This doesn't work because the < are replaced with &lt; etc.
    Thanks
    /Kristofer

    Maybe this question was too easy to deserve an answer or perhaps it was not answered because I was asking the wrong question. Anyways.. Elements with questionmarks are really "XML processing instructions" and the line above can be added with the line:
    myTransformerHandler.processingInstruction("import", "namespace=\"t\" implementation=\"#default#time2\"");

  • The name "Folder" does not exist in the namespace

     I am trying to learn Wpf and doing some of the examples on the Microsoft site. https://msdn.microsoft.com/en-us/library/vstudio/bb546972(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1
    I am using Visual studio 2013. As I work through the example I am getting the following error. 
    Error 1
    The name "Folder" does not exist in the namespace "clr-namespace:FolderExplorer".
    c:\users\hbrown\documents\visual studio 2013\Projects\FolderExplorer\FolderExplorer\MainWindow.xaml
    11 17
    FolderExplorer
    Error 2
    The name "Folder" does not exist in the namespace "clr-namespace:FolderExplorer".
    c:\users\hbrown\documents\visual studio 2013\Projects\FolderExplorer\FolderExplorer\MainWindow.xaml
    16 7
    FolderExplorer
    Here is the code:
    <Window x:Class="MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            xmlns:my="clr-namespace:FolderExplorer"
        Title="Folder Explorer" Height="350" Width="525">
        <Window.Resources>
            <ObjectDataProvider x:Key="RootFolderDataProvider" >
                <ObjectDataProvider.ObjectInstance>
                    <my:Folder FullPath="C:\"/>
                </ObjectDataProvider.ObjectInstance>
            </ObjectDataProvider>
            <HierarchicalDataTemplate 
       DataType    = "{x:Type my:Folder}"
                ItemsSource = "{Binding Path=SubFolders}">
                <TextBlock Text="{Binding Path=Name}" />
            </HierarchicalDataTemplate>
        </Window.Resources>
    I have a class file named Folder.vb with this code. 
    Public Class Folder
        Private _folder As DirectoryInfo
        Private _subFolders As ObservableCollection(Of Folder)
        Private _files As ObservableCollection(Of FileInfo)
        Public Sub New()
            Me.FullPath = "c:\"
        End Sub 'New
        Public ReadOnly Property Name() As String
            Get
                Return Me._folder.Name
            End Get
        End Property
        Public Property FullPath() As String
            Get
                Return Me._folder.FullName
            End Get
            Set(value As String)
                If Directory.Exists(value) Then
                    Me._folder = New DirectoryInfo(value)
                Else
                    Throw New ArgumentException("must exist", "fullPath")
                End If
            End Set
        End Property
        ReadOnly Property Files() As ObservableCollection(Of FileInfo)
            Get
                If Me._files Is Nothing Then
                    Me._files = New ObservableCollection(Of FileInfo)
                    Dim fi As FileInfo() = Me._folder.GetFiles()
                    Dim i As Integer
                    For i = 0 To fi.Length - 1
                        Me._files.Add(fi(i))
                    Next i
                End If
                Return Me._files
            End Get
        End Property
        ReadOnly Property SubFolders() As ObservableCollection(Of Folder)
            Get
                If Me._subFolders Is Nothing Then
                    Try
                        Me._subFolders = New ObservableCollection(Of Folder)
                        Dim di As DirectoryInfo() = Me._folder.GetDirectories()
                        Dim i As Integer
                        For i = 0 To di.Length - 1
                            Dim newFolder As New Folder()
                            newFolder.FullPath = di(i).FullName
                            Me._subFolders.Add(newFolder)
                        Next i
                    Catch ex As Exception
                        System.Diagnostics.Trace.WriteLine(ex.Message)
                    End Try
                End If
                Return Me._subFolders
            End Get
        End Property
    End Class
    Can someone explain what is happening. 
    Thanks Hal

    Did you try to build the application (Project->Build in Visual Studio) ? If the error doesn't go away then and you have no other compilation errors (if you do you need to fix these first), you should replace "FolderExplorer" with the namespace
    in which the Folder class resides. If you haven't explicitly declared a namespace, you will find the name of the default namespace under Project->Properties->Root namespace. Copy the value from this text box to your XAML:
    xmlns:my="clr-namespace:FolderExplorer"
    The default namespace is usually the same as the name of the application by default so if your application is called "FolderExplorer" you should be able to build it.
    If you cannot make it work then please upload a reproducable sample of your issue to OneDrive and post the link to it here for further help.
    Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question.

  • How to Get Portlet Namespace in a JSP attribute

    Hi All,
    The id of any component in a JSF application (with JSR168 portlets) takes the form
    'view'+'<portlet:namespace/>'+':'+'formname:componentidname';
    I need this id to be used for certain validations.
    Currently I am using it as below :-
    <h:intputText required="#{ ! empty param['viewns_7_CGAH47L000NAF0I04I42ND10P7_:form:login']}"/>
    Presently I have hardcoded the portlet namespace 'ns_7_CGAH47L000NAF0I04I42ND10P7_' by looking into the html source of the rendered page.
    Is there any way by which i can automatically get this portlet namespace within the param tag in the jsp.
    I know for a fact that within javascript tags, it can be used as <portlet:namespace/> as shown below :-
    <script type="text/javascript">
    function doSomething()
    buttonId= 'view' + '<portlet:namespace/>'+':'+'formName:buttonId';
    document.getElementById(buttonId).disabled = true;
    </script>
    Kindly treat this on high priority.
    Thanks and Regards,
    Darshan Shroff

    Perhaps so.
    I need to use it within param as below
    <h:inputText value="#{bean.userid}"
    required="#{!empty param['viewns_7_CGAH47L00GLRE0I0BCOUKS00I5_:form:login']}" />
    Here 'viewns_7_CGAH47L00GLRE0I0BCOUKS00I5_:form:login' is actually
    'view' + '<portlet:namespace/>'+':'+'formName:buttonId';
    I am just trying to check the presence of the client ID in the request paramameter map inorder to attain action dependent requiredness.
    Kindly tell me how i could access it within param.
    Thanks & Regards,
    Darshan Shroff

  • Adding Namespace in Sender File Adapter Scenario.

    Hi All
    I have a scenario where  XI has to Pick Up XML a file and process it. The structure of the file is as follows
    <?xml version="1.0" encoding="UTF-8" ?>
    <Header>
         <Seg1>
         </Seg1>
    </Header>
    This file does not contain any any namespace tag. I guess XI would not be able to pick up this file if there is no namespace in the XML file . The file expected by XI would be something like this.
    <?xml version="1.0" encoding="UTF-8" ?>
    <ns0:MessageTypeName xmlns:ns0="...namespace...">
    <Header>
         <Seg1>
         </Seg1>
    </Header>
    </ns0:MessageTypeName>
    Is there a way this can be handled at the File Sender adapter side . I am aware about  adding adapter module. Is there any other way to add the missing two namespace tags at the top and bottom of the file .
    any help would be appreciated.
    regards
    Nilesh .
    Edited by: Nilesh Taunk on Apr 7, 2008 2:11 PM

    Hi Nilesh,
    Yes it is possible in File sender adapter to give the namespace. In FCC you can give inside Document Specification.
    Under Document Name, enter the name of the XML document.
    The document name is inserted in the message as the main XML tag. This is mandatory for the mapping.
    Under Document Namespace, enter the namespace of the document.
    The namespace is added to the name of the document. This is mandatory for the mapping
    I hope this will help you.
    Regards
    Aashish Sinha

  • 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

  • How to take back up of my XI scenraios ( namespaces and Objects )

    Hi
    I have done some scenarios on XI sytem which has been crashed. Present it is not working . J2ee Engine is not starting.
    Now we have installed new XI system. I want to take backup of my old scenarios and i need to import it into new XI system. How to take backup  from old XI system which is not working now and import it into new one.
    Could you please help me.....
    Regards
    - Ravi Shankar B

    Hi,
    You could not able to recover the data from crashed system i.e old XI system.
    For that now you have to develop all as new one in the current new XI system.
    But whatever development that you will be doing that you could create backup.
    I.e follow below steps..
    1. After development and testing select the software component and right click on it --> Export or Tools -->Export Design Objects.
    2. select transport as file system, for CMS again it will go on Java Engine that will be not as backup and give the name of file.
    2. Select the namespaces or individual object to be taken as backup.
    3. Process it and finish the wizard.
    4. This will lead you to download it to local PC that you could keep it as backup
    For Importing goto
    Tools---> Import design object.
    Similarly you can export and import Integration directory objects also
    thanks
    Swarup

  • Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default

    in use:
    vRO 5.1
    eclipse 3.7.2
    vRo plug-sdk 5.1
    steps:
    1.create a plug-in project from samples(choose solar system)
    2.find the dar package and upload it by vRo configuration
    3.vRo configuration said upload successfully,but the solar system configuration is not properly configued..
    problem:
    Problem accessing /config_general/null/Default.action   Reason:There is no Action mapped for namespace/ config_general and action name default
    How to solve it??
    Thanks so much!!

    There was problem from crm side...its working now..

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

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

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

  • SOAP web service: null parameter if namespace not declared in envelope

    Hi guys,
    We are exposing a SOAP web service on WebLogic Portal 10.0. The service has one method which takes a single parameter. The service works correctly if the namespace is declared in the envelope element, but it is unable to map the request correctly if the namespace is declared on each request element and so the single parameter is null.
    This works:
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:inv="http://company.com/inventory">
       <soapenv:Header/>
       <soapenv:Body>
          <inv:CheckProductReservation>
             <username>6144</username>
             <udac>GP1</udac>
             <directoryYpgCode>00903</directoryYpgCode>
             <headingCode>0000001005</headingCode>
             <validityStartDate>2009-09-01</validityStartDate>
             <validityEndDate>2010-08-31</validityEndDate>
             <reservationCode>1234</reservationCode>
          </inv:CheckProductReservation>
       </soapenv:Body>
    </soapenv:Envelope>This fails:
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <SOAP-ENV:Body>
          <CheckProductReservation xmlns="http://company.com/inventory">
             <username xmlns="http://company.com/inventory">6144</username>
             <udac xmlns="http://company.com/inventory">GP1</udac>
             <directorycompanyCode xmlns="http://company.com/inventory">00903</directorycompanyCode>
             <headingCode xmlns="http://company.com/inventory">0000001005</headingCode>
             <validityStartDate xmlns="http://company.com/inventory">2009-09-01</validityStartDate>
             <validityEndDate xmlns="http://company.com/inventory">2010-08-31</validityEndDate>
             <reservationCode xmlns="http://company.com/inventory">1234</reservationCode>
          </CheckProductReservation>
       </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>These two requests seem equivalent and syntactically correct. Interestingly enough, soapUI seems to think that the 2nd request is not valid.
    Any ideas why the 2nd request is not working?
    Thanks!

    The WSDL doesn't define the elementNameQualified attribute anywhere. The WSDL looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions xmlns:im="http://company.com/inventory" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
         xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="InventoryService"
         targetNamespace="http://company.com/inventory">
         <wsdl:types>
              <xsd:schema targetNamespace="http://company.com/inventory">
                   <xsd:element name="CheckProductReservation">
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element name="username" type="xsd:string" maxOccurs="1" minOccurs="1" />
                                  <xsd:element name="udac" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
                                  <xsd:element name="directorycompanyCode" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
                                  <xsd:element name="headingCode" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
                                  <xsd:element name="validityStartDate" type="xsd:date" maxOccurs="1" minOccurs="1"></xsd:element>
                                  <xsd:element name="validityEndDate" type="xsd:date" maxOccurs="1" minOccurs="1"></xsd:element>
                                  <xsd:element name="reservationCode" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
                             </xsd:sequence>
                        </xsd:complexType>
                   </xsd:element>
                   <xsd:element name="CheckProductReservationResponse">
                        <xsd:complexType>
                             <xsd:sequence>
                                  <xsd:element name="resultCode" type="im:checkProductReservationResultCode" maxOccurs="1"
                                       minOccurs="1">
                                  </xsd:element>
                                  <xsd:element name="message" type="xsd:string" maxOccurs="1" minOccurs="1"></xsd:element>
                             </xsd:sequence>
                        </xsd:complexType>
                   </xsd:element>
                   <xsd:simpleType name="checkProductReservationResultCode">
                        <xsd:restriction base="xsd:int">
                             <xsd:enumeration value="0" />
                             <xsd:enumeration value="1" />
                             <xsd:enumeration value="2" />
                             <xsd:enumeration value="3" />
                             <xsd:enumeration value="99" />
                        </xsd:restriction>
                   </xsd:simpleType>
              </xsd:schema>
         </wsdl:types>
         <wsdl:message name="CheckProductReservationRequest">
              <wsdl:part name="parameters" element="im:CheckProductReservation"></wsdl:part>
         </wsdl:message>
         <wsdl:message name="CheckProductReservationResponse">
              <wsdl:part name="parameters" element="im:CheckProductReservationResponse"></wsdl:part>
         </wsdl:message>
         <wsdl:portType name="InventoryService">
              <wsdl:operation name="CheckProductReservation">
                   <wsdl:input message="im:CheckProductReservationRequest"></wsdl:input>
                   <wsdl:output message="im:CheckProductReservationResponse"></wsdl:output>
              </wsdl:operation>
         </wsdl:portType>
         <wsdl:binding name="InventoryServiceSOAP" type="im:InventoryService">
              <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
              <wsdl:operation name="CheckProductReservation">
                   <soap:operation soapAction="http://company.com/inventory/VerifyProductReservationCode" />
                   <wsdl:input>
                        <soap:body use="literal" />
                   </wsdl:input>
                   <wsdl:output>
                        <soap:body use="literal" />
                   </wsdl:output>
              </wsdl:operation>
         </wsdl:binding>
         <wsdl:service name="InventoryService">
              <wsdl:port binding="im:InventoryServiceSOAP" name="InventoryServiceSOAP">
                   <soap:address location="http://www.company.com/" />
              </wsdl:port>
         </wsdl:service>
    </wsdl:definitions>What does that tell us?

  • Read selected values from a multi choice field programatically using Microsoft.SharePoint.Client namespace.

    All examples I found refer to classes under Microsoft.SharePoint namespace. However, I have the SharePoint CSOM that only gives me the Microsoft.Sharepoint.Client namespace.
    I need to read the selected values of a multichoice field, but not sure how to do it with classes in the namespace above.
    everthing works, exept the TSQL_x0020_Reference_x0020_Numbe field.
    my code looks like this:
    Webweb = cont.Web;
                cont.Load(web);
                cont.ExecuteQuery();
    Listsstest = web.Lists.GetByTitle("T-SQL
    Code Review Tracking");
    //CamlQuery query = CamlQuery.CreateAllItemsQuery();
    CamlQueryquery =
    newCamlQuery();
                query.ViewXml =
    @"<View>
                               <ViewFields>
                                    <FieldRef Name='Category'/>
                                    <FieldRef Name='Review_x0020_Type'/>
                                    <FieldRef Name='Review_x0020_Start_x0020_Date'/>
                                    <FieldRef Name='Title'/>
                                    <FieldRef Name='Location'/>
                                    <FieldRef Name='Project'/>
                                    <FieldRef Name='Author0'/>
                                    <FieldRef Name='AssignedTo'/>
                                    <FieldRef Name='TSQL_x0020_Reference_x0020_Numbe'/>
                                </ViewFields>
                             </View>"
     ListItemCollectionitems
    = sstest.GetItems(query);
                cont.Load(items);
                cont.ExecuteQuery();
    foreach(ListItemitem
    initems)
                    Output0Buffer.AddRow();
                    Output0Buffer.ReviewStatus = item.FieldValues[
    "Category"] !=
    null? item.FieldValues["Category"].ToString()
    : String.Empty;
                    Output0Buffer.ReviewType = item.FieldValues[
    "Review_x0020_Type"] !=
    null? item.FieldValues["Review_x0020_Type"].ToString()
    : String.Empty;
                    Output0Buffer.ReviewDate =
    DateTime.Parse(item.FieldValues["Review_x0020_Start_x0020_Date"].ToString());
                    Output0Buffer.Module = item.FieldValues[
    "Title"] !=
    null? item.FieldValues["Title"].ToString()
    : String.Empty;
                    Output0Buffer.BranchLocationURL = item.FieldValues[
    "Location"] !=
    null? item.FieldValues["Location"].ToString()
    : String.Empty;
                    Output0Buffer.ProjectName = item.FieldValues[
    "Project"] !=
    null? item.FieldValues["Project"].ToString()
    : String.Empty;
                    Output0Buffer.Author = item.FieldValues[
    "Author0"] !=
    null? item.FieldValues["Author0"].ToString()
    : String.Empty;
    FieldLookupValueflvAssignedTo =
    newFieldUserValue();
                    flvAssignedTo = item.FieldValues[
    "AssignedTo"]
    asFieldLookupValue;
    if(flvAssignedTo !=
    null)
                        Output0Buffer.AssignedTo = flvAssignedTo.LookupValue;
    varv = item.FieldValues["TSQL_x0020_Reference_x0020_Numbe"];
    if(v !=
    null)
                        Output0Buffer.Reason2 = v.ToString();
                 Output0Buffer.SetEndOfRowset();           

    Hi,
    According to your description, my understanding is that you want to read the selected choice field value using Client Object Model.
    In my environment, I create a list with a mutichoice fileld named "choice" and then I used the code snippet below to get the selected value in choice field.
    ClientContext clientContext = new ClientContext("http://sp2013sps/sites/test1");
    Microsoft.SharePoint.Client.List spList = clientContext.Web.Lists.GetByTitle("list1");
    clientContext.Load(spList);
    clientContext.ExecuteQuery();
    if (spList != null && spList.ItemCount > 0)
    Microsoft.SharePoint.Client.CamlQuery camlQuery = new CamlQuery();
    camlQuery.ViewXml =
    @"<View>
    <ViewFields><FieldRef Name='choice' /></ViewFields>
    </View>";
    ListItemCollection listItems = spList.GetItems(camlQuery);
    clientContext.Load(listItems);
    clientContext.ExecuteQuery();
    string value = listItems[0]["choice"].ToString();
    Console.WriteLine(value);
    Console.ReadKey();
    Thanks
    Best Regards
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Does new 1402 Activity object in Cloud for Customer have wrong data type namespaces?

    I see that the individual "activity" objects (e.g., ActivityTask, AppointmentActivity, etc) are being deprecated as of 1405 and moving to a new Activity object with a TypeCode. That makes a lot of sense.
    In reviewing this new Activity object, I've noticed that many of the node elements utilize Data Types in the http://sap.com/xi/Common/DataTypes namespace instead of the http://sap.com/xi/AP/Common/GDT. For example, the root node element UUID has a data type UUID in the http://sap.com/xi/Common/DataTypes namespace, unlike all the other objects in the Public Solution Model.
    There are many more elements in this new Activity object that are mismatched like this to other common usage in other objects. Is this a new trend or a mistake?

    Hello Gregory, Alessandro,
    just for clarification:
    SAP wanted to eliminate the superflous supplementary components from the data types used in the Business Objects.
    Take the GDT Identifier as an example. It has the following supplementary components:
    SCHEME_ID
    SCHEME_VERSION_ID
    SCHEME_AGENCY_ID
    SCHEME_AGENCY_SCHEME_ID
    SCHEME_AGENCY_SCHEME_AGENCY_ID
    CONTENT
    You very seldom need the SCHEME_ID or the SCHEME_AGENCY_ID (if the ID is a GTIN or DUNS number then you need them). I never came over a situation to use the SCHEME_AGENCY_SCHEME_AGENCY_ID.
    So the data types from the "new" namespace omit those components. But SAP noticed the effort to adapt all the coding.
    Therefore it was decided that only new objects will use the data types from the new namepace.
    In the case of the ActivityTask, AppointmentActivity, etc. this wil requires - as Alessandro mentioned - some adoption effort.
    HTH,
          Horst

  • Report:"encountered the symbol of namespace....."

    My Envirement:
    CentOS 4.7||Oracle11g||pro*c
    My file of nn.pc:
    [oracle@oracle11g work2]$ more nn.pc
    #include<iostream>
    using namespace std;
    #include "sqlca.h"
    EXEC SQL BEGIN DECLARE SECTION;
    char *uid="scott/scott@wilson";
    EXEC SQL END DECLARE SECTION;
    int main()
    EXEC SQL CONNECT :uid;
    count<<sqlca.sqlerrm.sqlerrmc<<endl;
    if(sqlca.sqlcode == 0)
    cout<<"yes"<<endl;
    else
    cout<<"no"<<endl;
    [oracle@oracle11g work2]$
    my file of pcscfg.cfg:
    [oracle@oracle11g admin]$ more $ORACLE_HOME/precomp/admin/pcscfg.cfg
    sys_include=(/u01/oracle/precomp/public,/usr/include,/usr/lib/gcc/i386-redhat-linux/4.1.1/include,/usr/lib/gcc/i386-redhat-li
    nux/3.4.5/include,/usr/lib/gcc-lib/i386-redhat-linux/3.2.3/include,/usr/lib/gcc/i586-suse-linux/4.1.0/include)
    ltype=short
    code=cpp
    cpp_suffix=cc
    parse=none
    SQLCHECK=SEMANTICS
    [oracle@oracle11g admin]$
    my file of /etc/profile:
    [oracle@oracle11g work2]$ more /etc/profile
    # /etc/profile
    # System wide environment and startup programs, for login setup
    # Functions and aliases go in /etc/bashrc
    pathmunge () {
    if ! echo $PATH | /bin/egrep -q "(^|:)$1($|:)" ; then
    if [ "$2" = "after" ] ; then
    PATH=$PATH:$1
    else
    PATH=$1:$PATH
    fi
    fi
    # Path manipulation
    if [ `id -u` = 0 ]; then
    pathmunge /sbin
    pathmunge /usr/sbin
    pathmunge /usr/local/sbin
    fi
    pathmunge /usr/X11R6/bin after
    # No core files by default
    ulimit -S -c 0 > /dev/null 2>&1
    USER="`id -un`"
    LOGNAME=$USER
    MAIL="/var/spool/mail/$USER"
    HOSTNAME=`/bin/hostname`
    HISTSIZE=1000
    if [ -z "$INPUTRC" -a ! -f "$HOME/.inputrc" ]; then
    INPUTRC=/etc/inputrc
    fi
    export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE INPUTRC
    for i in /etc/profile.d/*.sh ; do
    if [ -r "$i" ]; then
    . $i
    fi
    done
    unset i
    unset pathmunge
    if [ $USER = "oracle" ]; then
    if [ $SHELL = "/bin/ksh" ]; then
    ulimit -p 16384
    ulimit -n 65536
    else
    ulimit -u 16384 -n 65536
    fi
    fi
    LD_LIBRARY_PATH=$ORACLE_HOME/lib:/usr/lib:/usr/local/lib;
    export LD_LIBRARY_PATH
    [oracle@oracle11g work2]$
    the error report:
    [oracle@oracle11g work2]$ source /etc/profile
    [oracle@oracle11g work2]$ proc nn.pc
    Pro*C/C++: Release 11.1.0.6.0 - Production on Sun Jun 21 20:15:44 2009
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    System default option values taken from: /u01/oracle/precomp/admin/pcscfg.cfg
    Error at line 1, column 10 in file nn.pc
    #include<iostream>
    .........1
    PCC-S-02015, unable to open include file
    Syntax error at line 2, column 8, file nn.pc:
    Error at line 2, column 8 in file nn.pc
    using namespace std;
    .......1
    PCC-S-02201, Encountered the symbol "namespace" when expecting one of the follow
    ing:
    ; , = ( [
    Syntax error at line 11, column 2, file nn.pc:
    Error at line 11, column 2 in file nn.pc
    .1
    PCC-S-02201, Encountered the symbol "{" when expecting one of the following:
    ; , = ( [
    The symbol ";" was substituted for "{" to continue.
    Syntax error at line 0, column 0, file nn.pc:
    Error at line 0, column 0 in file nn.pc
    PCC-S-02201, Encountered the symbol "<eof>" when expecting one of the following:
    ; { } ( * & + - ~ ! ^ ++ -- ... auto, break, case, char,
    const, continue, default, do, double, enum, extern, float,
    for, goto, if, int, long, ulong_varchar, OCIBFileLocator
    OCIBlobLocator, OCIClobLocator, OCIDateTime,
    OCIExtProcContext, OCIInterval, OCIRowid, OCIDate, OCINumber,
    OCIRaw, OCIString, register, return, short, signed, sizeof,
    sql_context, sql_cursor, static, struct, switch, typedef,
    union, unsigned, utext, uvarchar, varchar, void, volatile,
    while, an identifier, a typedef name, a precompiled header,
    a quoted string, a numeric constant, exec oracle,
    exec oracle begin, exec, exec sql, exec sql begin,
    exec sql type, exec sql var, exec sql include,
    Error at line 0, column 0 in file nn.pc
    PCC-F-02102, Fatal error while doing C preprocessing
    [oracle@oracle11g work2]$
    =======================
    what does this mean? I searched google, but there's no corresponding solution.
    Edited by: user3032370 on 2009-6-22 上午2:03

    Hi,
    I am facing simialr issue on racle 11G
    PCC-S-02201, Encountered the symbol "namespace" when expecting one of the follow
    ing:
    } auto, char, const, double, enum, extern, float, int, long,
    ulong_varchar, OCIBFileLocator OCIBlobLocator,
    OCIClobLocator, OCIDateTime, OCIExtProcContext, OCIInterval,
    OCIRowid, OCIDate, OCINumber, OCIRaw, OCIString, register,
    short, signed, sql_context, sql_cursor, static, struct,
    typedef, union, unsigned, utext, uvarchar, varchar, void,
    volatile, a typedef name, a precompiled header, exec oracle,
    exec oracle begin, exec, exec sql, exec sql begin,
    exec sql type, exec sql var, exec sql include,
    The symbol "exec," was substituted for "namespace" to continue.
    Syntax error at line 28, column 7, file ./gen/acd_lib_ppc.i:
    Error at line 28, column 7 in file ./gen/acd_lib_ppc.i
    using std :: ptrdiff_t ;
    ......1
    PCC-S-02201, Encountered the symbol "std" when expecting one of the following:
    ; , = ( [
    Error at line 0, column 0 in file ./gen/acd_lib_ppc.i
    Did you find any solution to this please?
    proc details:
    [fnetdba@gwl09072appd194 code]$ proc
    Pro*C/C++: Release 11.1.0.7.0 - Production on Mon Feb 20 11:25:12 2012
    Copyright (c) 1982, 2007, Oracle. All rights reserved.

Maybe you are looking for

  • "Lost Connection with Jabber. The server has unexpectedly disconnected"

    Hello, One of the colleague in my company has this problem with her iChat. I checked on the server and this block of messages showed up. "bouncing a packet to [email protected] from user@server: Socket Error to Client" Anyone knows what's going on, a

  • Data refresh in background for an Excel workbook published on a SharePoint 2013 site

    Hi, I've created a site to publish some Excel workbooks on a SharePoint 2013 farm with Excel Services. I'd like to run in background the data refresh against the cube connected to Excel, so when the end user will open the workbook he already will see

  • From a mac to a pc with iphone

    Okay strange question here. Is it possible to take an iphone that was used with a mac and use it with a PC? What will be lost? Is there a way to keep all the contacts, pictures, music and everything? Or ... Is there a way to export all the stuff and

  • Printing wedding invitations using PDFs purchased from Etsy.

    I am trying to print wedding invitations using PDFs purchased from Etsy.  What program should I be using, and how can I get four of the the RSVP cards to print on one sheet of paper?  Thanks!Pr

  • Font issue in motion 4

    I've downloaded a new font. The font is working fine in FCP and in PS, but in Motion, several of the letter show as dashes or partial letters. Why would this be? I put them in library/fonts Thanks