Search Results

Search found 3183 results on 128 pages for 'xmlns'.

Page 10/128 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • How to upload video on YouTube with Ruby

    - by viatropos
    I am trying to upload a youtube video using the GData gem (I have seen the youtube_g gem but would like to make it work with pure GData if possible), but I keep getting this error: GData::Client::BadRequestError in 'MyProject::Google::YouTube should upload the actual video to youtube (once it does, mock this test out)' request error 400: No file found in upload request. I am using this code: def metadata data = <<-EOF <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <media:group> <media:title type="plain">Bad Wedding Toast</media:title> <media:description type="plain"> I gave a bad toast at my friend's wedding. </media:description> <media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People</media:category> <media:keywords>toast, wedding</media:keywords> </media:group> </entry> EOF end @yt = GData::Client::YouTube.new @yt.clientlogin("name", "pass") @yt.developer_key = "myKey" url = "http://uploads.gdata.youtube.com/feeds/api/users/name/uploads" mime_type = "multipart/related" file_path = "sample_upload.mp4" @yt.post_file(url, file_path, mime_type, metadata) What is the recommended/standard way for uploading videos to youtube with ruby, what is your method? Update After applying the changes to wrapped_entry, the string it produces looks like this: --END_OF_PART_59003 Content-Type: application/atom+xml; charset=UTF-8 <?xml version="1.0"?> <entry xmlns="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007"> <media:group> <media:title type="plain">Bad Wedding Toast</media:title> <media:description type="plain"> I gave a bad toast at my friend's wedding. </media:description> <media:category scheme="http://gdata.youtube.com/schemas/2007/categories.cat">People</media:category> <media:keywords>toast, wedding</media:keywords> </media:group> </entry> --END_OF_PART_59003 Content-Type: multipart/related Content-Transfer-Encoding: binary ... and inspecting the request and response looks like this: Request: <GData::HTTP::Request:0x1b8bb44 @method=:post @url="http://uploads.gdata.youtube.com/feeds/api/users/lancejpollard/uploads" @body=#<GData::HTTP::MimeBody:0x1b8c738 @parts=[#<GData::HTTP::MimeBodyString:0x1b8c058 @bytes_read=0 @string="--END_OF_PART_30909\r\nContent-Type: application/atom+xml; charset=UTF-8\r\n\r\n <?xml version=\"1.0\"?>\n<entry xmlns=\"http://www.w3.org/2005/Atom\"\n xmlns:media=\"http://search.yahoo.com/mrss/\"\n xmlns:yt=\"http://gdata.youtube.com/schemas/2007\">\n <media:group>\n <media:title type=\"plain\">Bad Wedding Toast</media:title>\n <media:description type=\"plain\">\n I gave a bad toast at my friend's wedding.\n </media:description>\n <media:category scheme=\"http://gdata.youtube.com/schemas/2007/categories.cat\">People</media:category>\n <media:keywords>toast wedding</media:keywords>\n </media:group>\n</entry> \n\r\n--END_OF_PART_30909\r\nContent-Type: multipart/related\r\nContent-Transfer-Encoding: binary\r\n\r\n"> #<File:/Users/Lance/Documents/Development/git/thing/spec/fixtures/sample_upload.mp4> #<GData::HTTP::MimeBodyString:0x1b8c044 @bytes_read=0 @string="\r\n--END_OF_PART_30909--"] @current_part=0 @boundary="END_OF_PART_30909" @headers={"Slug"="sample_upload.mp4" "User-Agent"="GoogleDataRubyUtil-AnonymousApp" "GData-Version"="2" "X-GData-Key"="key=AI39si7jkhs_ECjF4unOQz8gpWGSKXgq0KJpm8wywkvBSw4s8oJd5p5vkpvURHBNh-hiYJtoKwQqSfot7KoCkeCE32rNcZqMxA" "Content-Type"="multipart/related; boundary=\"END_OF_PART_30909\"" "MIME-Version"="1.0"} Response: #<GData::HTTP::Response:0x1b897e0 @body="No file found in upload request." @headers={"cache-control"=>"no-cache no-store must-revalidate" "connection"=>"close" "expires"=>"Fri 01 Jan 1990 00:00:00 GMT" "content-type"=>"text/plain; charset=utf-8" "date"=>"Fri 11 Dec 2009 02:10:25 GMT" "server"=>"Upload Server Built on Nov 30 2009 13:21:18 (1259616078)" "x-xss-protection"=>"0" "content-length"=>"32" "pragma"=>"no-cache"} @status_code=400> Still not working, I'll have to check it out more with those changes.

    Read the article

  • How to enforce a namespace in wsdl for inner elements

    - by wsxedc
    I am looking at an example WSDL <definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://mypackage/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://mypackage/" name="HelloService"> <types> <xsd:schema> <xsd:import namespace="http://mypackage/" schemaLocation="http://localhost:8081/HelloWebService/HelloService?xsd=1"> </xsd:import> </xsd:schema> </types> <message name="sayHello"> <part name="parameters" element="tns:sayHello"></part> </message> <message name="sayHelloResponse"> <part name="parameters" element="tns:sayHelloResponse"></part> </message> <portType name="Hello"> <operation name="sayHello"> <input message="tns:sayHello"></input> <output message="tns:sayHelloResponse"></output> </operation> </portType> <binding name="HelloPortBinding" type="tns:Hello"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"></soap:binding> <operation name="sayHello"> <soap:operation soapAction=""></soap:operation> <input> <soap:body use="literal"></soap:body> </input> <output> <soap:body use="literal"></soap:body> </output> </operation> </binding> <service name="HelloService"> <port name="HelloPort" binding="tns:HelloPortBinding"> <soap:address location="http://localhost:8081/HelloWebService/HelloService"> </soap:address> </port> </service> and the referenced xsd is <?xml version="1.0" encoding="utf-8"?> <xs:schema xmlns:tns="http://mypackage/" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://mypackage/"> <xs:element name="sayHello" type="tns:sayHello"></xs:element> <xs:element name="sayHelloResponse" type="tns:sayHelloResponse"> </xs:element> <xs:complexType name="sayHello"> <xs:sequence> <xs:element name="arg0" type="xs:string" minOccurs="0"> </xs:element> </xs:sequence> </xs:complexType> <xs:complexType name="sayHelloResponse"> <xs:sequence> <xs:element name="return" type="xs:string" minOccurs="0"> </xs:element> </xs:sequence> </xs:complexType> </xs:schema> When I use SoapUI to generate a request message, it looks like this <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:myp="http://mypackage/"> <soapenv:Header/> <soapenv:Body> <myp:sayHello> <arg0>?</arg0> </myp:sayHello> </soapenv:Body> </soapenv:Envelope> My question is, why doesn't arg0 need a namespace like ?? I am just using this as an example as the element that are children of soapenv always have a namespace prefix, however, the children of these children do not have any prefix. This is the case with soapUI and message sent by Axis2 generated stubs. My questions are: 1. Why aren't there any namespace for arg0? 2. Is there a way to enforce myp prefix on arg0 from WSDL? If so, how? If not, why can't it be done?

    Read the article

  • Problem in generation of custom classes at web service client

    - by user443324
    I have a web service which receives an custom object and returns another custom object. It can be deployed successfully on GlassFish or JBoss. @WebMethod(operationName = "providerRQ") @WebResult(name = "BookingInfoResponse" , targetNamespace = "http://tlonewayresprovidrs.jaxbutil.rakes.nhst.com/") public com.nhst.rakes.jaxbutil.tlonewayresprovidrs.BookingInfoResponse providerRQ(@WebParam(name = "BookingInfoRequest" , targetNamespace = "http://tlonewayresprovidrq.jaxbutil.rakes.nhst.com/") com.nhst.rakes.jaxbutil.tlonewayresprovidrq.BookingInfoRequest BookingInfoRequest) { com.nhst.rakes.jaxbutil.tlonewayresprovidrs.BookingInfoResponse BookingInfoResponse = new com.nhst.rakes.jaxbutil.tlonewayresprovidrs.BookingInfoResponse(); return BookingInfoResponse; } But when I create a client for this web service, two instances of BookingInfoRequest and BookingInfoResponse generated even I need only one instance. This time an error is returned that says multiple classes with same name are can not be possible....... Here is wsdl..... <?xml version='1.0' encoding='UTF-8'?><!-- Published by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.1-hudson-28-. --><!-- Generated by JAX-WS RI at http://jax-ws.dev.java.net. RI's version is JAX-WS RI 2.2.1-hudson-28-. --><definitions xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:wsp1_2="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://demo/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://demo/" name="DemoJAXBParamService"> <wsp:Policy wsu:Id="DemoJAXBParamPortBindingPolicy"> <ns1:OptimizedMimeSerialization xmlns:ns1="http://schemas.xmlsoap.org/ws/2004/09/policy/optimizedmimeserialization" /> </wsp:Policy> <types> <xsd:schema> <xsd:import namespace="http://tlonewayresprovidrs.jaxbutil.rakes.nhst.com/" schemaLocation="http://localhost:31133/DemoJAXBParamService/DemoJAXBParamService?xsd=1" /> </xsd:schema> <xsd:schema> <xsd:import namespace="http://tlonewayresprovidrs.jaxbutil.rakes.nhst.com" schemaLocation="http://localhost:31133/DemoJAXBParamService/DemoJAXBParamService?xsd=2" /> </xsd:schema> <xsd:schema> <xsd:import namespace="http://tlonewayresprovidrq.jaxbutil.rakes.nhst.com/" schemaLocation="http://localhost:31133/DemoJAXBParamService/DemoJAXBParamService?xsd=3" /> </xsd:schema> <xsd:schema> <xsd:import namespace="http://tlonewayresprovidrq.jaxbutil.rakes.nhst.com" schemaLocation="http://localhost:31133/DemoJAXBParamService/DemoJAXBParamService?xsd=4" /> </xsd:schema> <xsd:schema> <xsd:import namespace="http://demo/" schemaLocation="http://localhost:31133/DemoJAXBParamService/DemoJAXBParamService?xsd=5" /> </xsd:schema> </types> <message name="providerRQ"> <part name="parameters" element="tns:providerRQ" /> </message> <message name="providerRQResponse"> <part name="parameters" element="tns:providerRQResponse" /> </message> <portType name="DemoJAXBParam"> <operation name="providerRQ"> <input wsam:Action="http://demo/DemoJAXBParam/providerRQRequest" message="tns:providerRQ" /> <output wsam:Action="http://demo/DemoJAXBParam/providerRQResponse" message="tns:providerRQResponse" /> </operation> </portType> <binding name="DemoJAXBParamPortBinding" type="tns:DemoJAXBParam"> <wsp:PolicyReference URI="#DemoJAXBParamPortBindingPolicy" /> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> <operation name="providerRQ"> <soap:operation soapAction="" /> <input> <soap:body use="literal" /> </input> <output> <soap:body use="literal" /> </output> </operation> </binding> <service name="DemoJAXBParamService"> <port name="DemoJAXBParamPort" binding="tns:DemoJAXBParamPortBinding"> <soap:address location="http://localhost:31133/DemoJAXBParamService/DemoJAXBParamService" /> </port> </service> </definitions> So, I want to know that how to generate only one instance(I don't know why two instances are generated at client side?). Please help me to move in right direction.

    Read the article

  • Need help debugging a very basic PHP SOAP Hello world app

    - by WarDoGG
    I have been breaking my head at this, reading almost every article and tutorial there is on the web, but nothing doing.. i still cannot get my first web service application to work. I would really appreciate it if anyone could debug this code for me and provide me with a good explanation as to what is wrong and why. This will help indeed ! Thanks ! I have pasted below the entire codes that i am using making it easier to debug. I'm using the PHP5 SOAP extension. Here is my WSDL: <?xml version="1.0" encoding="utf-8"?> <wsdl:definitions name="testWebservice" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="http://tempuri.org/" xmlns:s1="http://microsoft.com/wsdl/types/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types> <s:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/"> <s:import namespace="http://microsoft.com/wsdl/types/" /> <s:element name="getUser"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="username" type="s:string" /> <s:element minOccurs="0" maxOccurs="1" name="password" type="s:string" /> </s:sequence> </s:complexType> </s:element> <s:element name="getUserResponse"> <s:complexType> <s:sequence> <s:element minOccurs="0" maxOccurs="1" name="getUserResult" type="tns:userInfo" /> </s:sequence> </s:complexType> </s:element> <s:complexType name="userInfo"> <s:sequence> <s:element minOccurs="1" maxOccurs="1" name="ID" type="s:int" /> <s:element minOccurs="1" maxOccurs="1" name="authkey" type="s:int" /> </s:sequence> </s:complexType> </s:schema> </wsdl:types> <wsdl:message name="getUserSoapIn"> <wsdl:part name="parameters" element="tns:getUser" /> </wsdl:message> <wsdl:message name="getUserSoapOut"> <wsdl:part name="parameters" element="tns:getUserResponse" /> </wsdl:message> <wsdl:portType name="testWebservice"> <wsdl:operation name="getUser"> <wsdl:input message="tns:getUserSoapIn" /> <wsdl:output message="tns:getUserSoapOut" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="testWebserviceBinding" type="tns:testWebservice"> <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" /> <wsdl:operation name="getUser"> <soap:operation soapAction="http://tempuri.org/getUser" /> <wsdl:input> <soap:body use="literal" /> </wsdl:input> <wsdl:output> <soap:body use="literal" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="testWebserviceService"> <wsdl:port name="testWebservicePort" binding="tns:testWebserviceBinding"> <soap:address location="http://127.0.0.1/nusoap/storytruck/index.php" /> </wsdl:port> </wsdl:service> </wsdl:definitions> and here is the PHP Code i use to setup the server: <?php function getUser($user,$pass) { return array('ID'=>1); } ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache $server = new SoapServer("http://127.0.0.1/mywsdl.wsdl"); $server->addFunction('getUser'); $server->handle(); ?> and the code for the client: <?php $client = new SoapClient("http://127.0.0.1/index.php?wsdl", array('exceptions' => 0)); try { $result = $client->getUser("username","pass"); print_r($result); } catch (SoapFault $result) { print_r($result); } ?> Here is the ERROR output i am getting on the browser : SoapFault Object ( [message:protected] => Error cannot find parameter [string:Exception:private] => [code:protected] => 0 [file:protected] => C:\xampp\htdocs\client.php [line:protected] => 6 [trace:Exception:private] => Array ( [0] => Array ( [function] => __call [class] => SoapClient [type] => -> [args] => Array ( [0] => getUser [1] => Array ( [0] => username [1] => pass ) ) ) [1] => Array ( [file] => C:\xampp\htdocs\client.php [line] => 6 [function] => getUser [class] => SoapClient [type] => -> [args] => Array ( [0] => username [1] => pass ) ) ) [previous:Exception:private] => [faultstring] => Error cannot find parameter [faultcode] => SOAP-ENV:Client )

    Read the article

  • XSLT: How to exclude empty elements from my result?

    - by Fedor Steeman
    I have a rather complicated xslt sheet transforming one xml format to another using templates. However, in the resulting xml, I need to have all the empty elements excluded. How is that done? This is how the base xslt looks like: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:far="http://www.itella.com/fargo/fargogate/" xmlns:a="http://tempuri.org/XMLSchema.xsd" xmlns:p="http://tempuri.org/XMLSchema.xsd"> <xsl:import href="TransportCDMtoFDM_V0.6.xsl"/> <xsl:import href="ConsignmentCDMtoFDM_V0.6.xsl"/> <xsl:template match="/"> <InboundFargoMessage> <EdiSender> <xsl:value-of select="TransportInformationMessage/SenderId"/> </EdiSender> <EdiReceiver> <xsl:value-of select="TransportInformationMessage/RecipientId"/> </EdiReceiver> <EdiSource> <xsl:value-of select="TransportInformationMessage/Waybill/Parties/Consignor/Id"/> </EdiSource> <EdiDestination>FARGO</EdiDestination> <Transportations> <xsl:for-each select="TransportInformationMessage/TransportUnits/TransportUnit"> <xsl:call-template name="transport"/> </xsl:for-each> <xsl:for-each select="TransportInformationMessage/Waybill/TransportUnits/TransportUnit"> <xsl:call-template name="transport"/> </xsl:for-each> <xsl:for-each select="TransportInformationMessage/Waybill"> <EdiImportTransportationDTO> <Consignments> <xsl:for-each select="Shipments/Shipment"> <xsl:call-template name="consignment"/> </xsl:for-each> </Consignments> <EdiTerminalDepartureTime> <xsl:value-of select="DatesAndTimes/EstimatedDepartureDateTime"/> <xsl:value-of select="DatesAndTimes/DepartureDateTime"/> </EdiTerminalDepartureTime> <EdiAgentTerminalArrivalDate> <xsl:value-of select="DatesAndTimes/EstimatedArrivalDateTime"/> <xsl:value-of select="DatesAndTimes/ArrivalDateTime"/> </EdiAgentTerminalArrivalDate> <EdiActivevehicle> <xsl:value-of select="Vehicle/TransportShiftNumber"/> </EdiActivevehicle> <EdiConveyerZipCodeTown><xsl:text> </xsl:text></EdiConveyerZipCodeTown> </EdiImportTransportationDTO> </xsl:for-each> </Transportations> </InboundFargoMessage> </xsl:template> </xsl:stylesheet> What needs to be added, so that empty elements are left out? For example, a snippet from the resulting xml: <?xml version="1.0" encoding="UTF-8"?> <InboundFargoMessage xmlns:p="http://tempuri.org/XMLSchema.xsd" xmlns:far="http://www.itella.com/fargo/fargogate/" xmlns:a="http://tempuri.org/XMLSchema.xsd"> <EdiSender>XXXX</EdiSender> <EdiReceiver>YYYY</EdiReceiver> <EdiSource>TR/BAL/IST</EdiSource> <EdiDestination>FARGO</EdiDestination> <Transportations> <EdiImportTransportationDTO> <Consignments> <EdiImportConsignmentDTO> <ConsignmentLines> <EdiImportConsignmentLineDTO> <DangerousGoodsItems> <EdiImportDangerGoodsItemDTO> <EdiKolliTypeOuter/> <EdiKolliTypeInner/> <EdiTechnicalDescription/> <EdiUNno/> <EdiClass/> <EdiDangerFactor/> <EdiEmergencyTemperature/> </EdiImportDangerGoodsItemDTO> </DangerousGoodsItems> <BarCodes> <EdiImportConsignmentLineBarcodeDTO/> </BarCodes> <EdiNumberOfPieces>00000002</EdiNumberOfPieces> <EdiGrossWeight>0.000</EdiGrossWeight> <EdiHeight/> <EdiWidth/> <EdiLength/> <EdiGoodsDescription/> <EdiMarkingAndNumber/> <EdiKolliType>road</EdiKolliType> <EdiCbm/> <EdiLdm/> </EdiImportConsignmentLineDTO> That really needs to be: <?xml version="1.0" encoding="UTF-8"?> <InboundFargoMessage xmlns:p="http://tempuri.org/XMLSchema.xsd" xmlns:far="http://www.itella.com/fargo/fargogate/" xmlns:a="http://tempuri.org/XMLSchema.xsd"> <EdiSender>XXXX</EdiSender> <EdiReceiver>YYYY</EdiReceiver> <EdiSource>TR/BAL/IST</EdiSource> <EdiDestination>FARGO</EdiDestination> <Transportations> <EdiImportTransportationDTO> <Consignments> <EdiImportConsignmentDTO> <ConsignmentLines> <EdiImportConsignmentLineDTO> <DangerousGoodsItems/> <BarCodes/> <EdiNumberOfPieces>00000002</EdiNumberOfPieces> <EdiGrossWeight>0.000</EdiGrossWeight> <EdiKolliType>road</EdiKolliType> </EdiImportConsignmentLineDTO> In other words: Empty elements should be left out.

    Read the article

  • Namespaces and deserialization issue

    - by CaffGeek
    UPDATE: You can run the code at the end of this to recreate and see the error I am having and hopefully solve it! UPDATE2: It's not the removal of the xmlns="" that's the issue... as you can remove it from the initial xml string. The problem is with the [XmlType(TypeName = "Systems")] somehow causing it to be added... UPDATE3: Turns out the problem is in here, I need to set the TypeName based on what is in the existing, XmlTypeAttribute if it already exists on the class.... xmlAttributes.XmlType = new XmlTypeAttribute { Namespace = "" }; I get the following XML as a string from a webservice <Systems xmlns=""> <System id="1"> <sys_name>ALL</sys_name> </System> <System id="2"> <sys_name>asdfasdf</sys_name> </System> <System id="3"> <sys_name>fasdfasf</sys_name> </System> <System id="4"> <sys_name>asdfasdfasdf</sys_name> </System> </Systems> I then execute this, to convert it to an object result = XElement.Parse(xmlResult.OuterXml).Deserialize<AwayRequestSystems>(); Strangely though, in the Deserialize method, while the RemoveAllNamespaces works and returns the xml without the namespace I get the error <Systems xmlns=''> was not expected. in the catch when return (T) serializer.Deserialize(reader); executes! Why is it doing this? The xmlns is GONE!!! EXECUTABLE CODE! (Just put it in a test project) using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Xml; using System.Xml.Linq; using Microsoft.VisualStudio.TestTools.UnitTesting; using System.Xml.Serialization; namespace DeserializationTest { [TestClass] public class UnitTest1 { public TestContext TestContext { get; set; } [TestMethod] public void RemoveXmlnsFromSystems() { var xml = XElement.Parse(@"<Systems xmlns=""""> <System id=""1""> <sys_name>ALL</sys_name> </System> <System id=""2""> <sys_name>ePO</sys_name> </System> <System id=""3""> <sys_name>iEFT</sys_name> </System> <System id=""4""> <sys_name>Away Requests</sys_name> </System> <System id=""5""> <sys_name>RP3</sys_name> </System> </Systems>"); var systems = xml.Deserialize<AwayRequestSystems>(); Assert.IsInstanceOfType(systems, typeof(AwayRequestSystems)); var xmlnsFree = xml.RemoveAllNamespaces(); var str = xmlnsFree.ToString(); Debug.WriteLine(str); Assert.AreNotEqual("Error", xmlnsFree.Name.ToString(), "Serialization Error"); Assert.IsFalse(str.Contains("xmlns"), "Xmlns still exists"); } } [XmlType(TypeName = "Systems")] public class AwayRequestSystems : List<AwayRequestSystem> { } [XmlType(TypeName = "System")] public class AwayRequestSystem { [XmlAttribute("id")] public int ID { get; set; } [XmlElement("sys_name")] public string Name { get; set; } } public static class XmlSerializerFactory { private static Dictionary<Type, XmlSerializer> _serializers = new Dictionary<Type, XmlSerializer>(); public static void ResetCache() { _serializers = new Dictionary<Type, XmlSerializer>(); } public static XmlSerializer GetSerializerFor(Type typeOfT) { if (!_serializers.ContainsKey(typeOfT)) { var xmlAttributes = new XmlAttributes(); var xmlAttributeOverrides = new XmlAttributeOverrides(); Debug.WriteLine(string.Format("XmlSerializerFactory.GetSerializerFor(typeof({0}));", typeOfT)); xmlAttributes.XmlType = new XmlTypeAttribute { Namespace = "" }; xmlAttributes.Xmlns = false; var types = new List<Type> { typeOfT, typeOfT.BaseType }; foreach (var property in typeOfT.GetProperties()) { types.Add(property.PropertyType); } types.RemoveAll(t => t.ToString().StartsWith("System.")); foreach (var type in types) { if (xmlAttributeOverrides[type] == null) xmlAttributeOverrides.Add(type, xmlAttributes); } var newSerializer = new XmlSerializer(typeOfT, xmlAttributeOverrides); //var newSerializer = new XmlSerializer(typeOfT, xmlAttributeOverrides, types.ToArray(), new XmlRootAttribute(), string.Empty); //var newSerializer = new XmlSerializer(typeOfT, string.Empty); _serializers.Add(typeOfT, newSerializer); } return _serializers[typeOfT]; } } public static class XElementExtensions { public static XElement RemoveAllNamespaces(this XElement source) { if (source.HasAttributes) source.Attributes().Where(a => a.Name.LocalName.Equals("xmlns")).Remove(); return source.HasElements ? new XElement(source.Name.LocalName, source.Attributes()/*.Where(a => !a.Name.LocalName.Equals("xmlns"))*/, source.Elements().Select(el => RemoveAllNamespaces(el)) ) : new XElement(source.Name.LocalName) { Value = source.Value }; } } public static class SerializationExtensions { public static XElement Serialize(this object source) { try { var serializer = XmlSerializerFactory.GetSerializerFor(source.GetType()); var xdoc = new XDocument(); using (var writer = xdoc.CreateWriter()) { serializer.Serialize(writer, source, new XmlSerializerNamespaces(new[] { new XmlQualifiedName("", "") })); } var result = (xdoc.Document != null) ? xdoc.Document.Root : new XElement("Error", "Document Missing"); return result.RemoveAllNamespaces(); } catch (Exception x) { return new XElement("Error", x.ToString()); } } public static T Deserialize<T>(this XElement source) where T : class { //try //{ var serializer = XmlSerializerFactory.GetSerializerFor(typeof(T)); var cleanxml = source.RemoveAllNamespaces(); var reader = cleanxml.CreateReader(); return (T)serializer.Deserialize(reader); //} //catch (Exception x) //{ // return null; //} } } }

    Read the article

  • Adding Volcanos and Options - Earthquake Locator, part 2

    - by Bobby Diaz
    Since volcanos are often associated with earthquakes, and vice versa, I decided to show recent volcanic activity on the Earthquake Locator map.  I am pulling the data from a website created for a joint project between the Smithsonian's Global Volcanism Program and the US Geological Survey's Volcano Hazards Program, found here.  They provide a Weekly Volcanic Activity Report as an RSS feed.   I started implementing this new functionality by creating a new Volcano entity in the domain model and adding the following to the EarthquakeService class (I also factored out the common reading/parsing helper methods to a separate FeedReader class that can be used by multiple domain service classes):           private static readonly string VolcanoFeedUrl =             ConfigurationManager.AppSettings["VolcanoFeedUrl"];           /// <summary>         /// Gets the volcano data for the previous week.         /// </summary>         /// <returns>A queryable collection of <see cref="Volcano"/> objects.</returns>         public IQueryable<Volcano> GetVolcanos()         {             var feed = FeedReader.Load(VolcanoFeedUrl);             var list = new List<Volcano>();               if ( feed != null )             {                 foreach ( var item in feed.Items )                 {                     var quake = CreateVolcano(item);                     if ( quake != null )                     {                         list.Add(quake);                     }                 }             }               return list.AsQueryable();         }           /// <summary>         /// Creates a <see cref="Volcano"/> object for each item in the RSS feed.         /// </summary>         /// <param name="item">The RSS item.</param>         /// <returns></returns>         private Volcano CreateVolcano(SyndicationItem item)         {             Volcano volcano = null;             string title = item.Title.Text;             string desc = item.Summary.Text;             double? latitude = null;             double? longitude = null;               FeedReader.GetGeoRssPoint(item, out latitude, out longitude);               if ( !String.IsNullOrEmpty(title) )             {                 title = title.Substring(0, title.IndexOf('-'));             }             if ( !String.IsNullOrEmpty(desc) )             {                 desc = String.Join("\n\n", desc                         .Replace("<p>", "")                         .Split(                             new string[] { "</p>" },                             StringSplitOptions.RemoveEmptyEntries)                         .Select(s => s.Trim())                         .ToArray())                         .Trim();             }               if ( latitude != null && longitude != null )             {                 volcano = new Volcano()                 {                     Id = item.Id,                     Title = title,                     Description = desc,                     Url = item.Links.Select(l => l.Uri.OriginalString).FirstOrDefault(),                     Latitude = latitude.GetValueOrDefault(),                     Longitude = longitude.GetValueOrDefault()                 };             }               return volcano;         } I then added the corresponding LoadVolcanos() method and Volcanos collection to the EarthquakeViewModel class in much the same way I did with the Earthquakes in my previous article in this series. Now that I am starting to add more information to the map, I wanted to give the user some options as to what is displayed and allowing them to choose what gets turned off.  I have updated the MainPage.xaml to look like this:   <UserControl x:Class="EarthquakeLocator.MainPage"     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"     xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"     xmlns:basic="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"     xmlns:bing="clr-namespace:Microsoft.Maps.MapControl;assembly=Microsoft.Maps.MapControl"     xmlns:vm="clr-namespace:EarthquakeLocator.ViewModel"     mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" >     <UserControl.Resources>         <DataTemplate x:Key="EarthquakeTemplate">             <Ellipse Fill="Red" Stroke="Black" StrokeThickness="1"                      Width="{Binding Size}" Height="{Binding Size}"                      bing:MapLayer.Position="{Binding Location}"                      bing:MapLayer.PositionOrigin="Center">                 <ToolTipService.ToolTip>                     <StackPanel>                         <TextBlock Text="{Binding Title}" FontSize="14" FontWeight="Bold" />                         <TextBlock Text="{Binding UtcTime}" />                         <TextBlock Text="{Binding LocalTime}" />                         <TextBlock Text="{Binding DepthDesc}" />                     </StackPanel>                 </ToolTipService.ToolTip>             </Ellipse>         </DataTemplate>           <DataTemplate x:Key="VolcanoTemplate">             <Polygon Fill="Gold" Stroke="Black" StrokeThickness="1" Points="0,10 5,0 10,10"                      bing:MapLayer.Position="{Binding Location}"                      bing:MapLayer.PositionOrigin="Center"                      MouseLeftButtonUp="Volcano_MouseLeftButtonUp">                 <ToolTipService.ToolTip>                     <StackPanel>                         <TextBlock Text="{Binding Title}" FontSize="14" FontWeight="Bold" />                         <TextBlock Text="Click icon for more information..." />                     </StackPanel>                 </ToolTipService.ToolTip>             </Polygon>         </DataTemplate>     </UserControl.Resources>       <UserControl.DataContext>         <vm:EarthquakeViewModel AutoLoadData="True" />     </UserControl.DataContext>       <Grid x:Name="LayoutRoot">           <bing:Map x:Name="map" CredentialsProvider="--Your-Bing-Maps-Key--"                   Center="{Binding MapCenter, Mode=TwoWay}"                   ZoomLevel="{Binding ZoomLevel, Mode=TwoWay}">               <bing:MapItemsControl ItemsSource="{Binding Earthquakes}"                                   ItemTemplate="{StaticResource EarthquakeTemplate}" />               <bing:MapItemsControl ItemsSource="{Binding Volcanos}"                                   ItemTemplate="{StaticResource VolcanoTemplate}" />         </bing:Map>           <basic:TabControl x:Name="tabs" VerticalAlignment="Bottom" MaxHeight="25" Opacity="0.7">             <basic:TabItem Margin="90,0,-90,0" MouseLeftButtonUp="TabItem_MouseLeftButtonUp">                 <basic:TabItem.Header>                     <TextBlock x:Name="txtHeader" Text="Options"                                FontSize="13" FontWeight="Bold" />                 </basic:TabItem.Header>                   <StackPanel Orientation="Horizontal">                     <TextBlock Text="Earthquakes:" FontWeight="Bold" Margin="3" />                     <StackPanel Margin="3">                         <CheckBox Content=" &lt; 4.0"                                   IsChecked="{Binding ShowLt4, Mode=TwoWay}" />                         <CheckBox Content="4.0 - 4.9"                                   IsChecked="{Binding Show4s, Mode=TwoWay}" />                         <CheckBox Content="5.0 - 5.9"                                   IsChecked="{Binding Show5s, Mode=TwoWay}" />                     </StackPanel>                       <StackPanel Margin="10,3,3,3">                         <CheckBox Content="6.0 - 6.9"                                   IsChecked="{Binding Show6s, Mode=TwoWay}" />                         <CheckBox Content="7.0 - 7.9"                                   IsChecked="{Binding Show7s, Mode=TwoWay}" />                         <CheckBox Content="8.0 +"                                   IsChecked="{Binding ShowGe8, Mode=TwoWay}" />                     </StackPanel>                       <TextBlock Text="Other:" FontWeight="Bold" Margin="50,3,3,3" />                     <StackPanel Margin="3">                         <CheckBox Content="Volcanos"                                   IsChecked="{Binding ShowVolcanos, Mode=TwoWay}" />                     </StackPanel>                 </StackPanel>               </basic:TabItem>         </basic:TabControl>       </Grid> </UserControl> Notice that I added a VolcanoTemplate that uses a triangle-shaped Polygon to represent the Volcano locations, and I also added a second <bing:MapItemsControl /> tag to the map to bind to the Volcanos collection.  The TabControl found below the map houses the options panel that will present the user with several checkboxes so they can filter the different points based on type and other properties (i.e. Magnitude).  Initially, the TabItem is collapsed to reduce it's footprint, but the screen shot below shows the options panel expanded to reveal the available settings:     I have updated the Source Code and Live Demo to include these new features.   Happy Mapping!

    Read the article

  • Part 3 of 4 : Tips/Tricks for Silverlight Developers.

    - by mbcrump
    Part 1 | Part 2 | Part 3 | Part 4 I wanted to create a series of blog post that gets right to the point and is aimed specifically at Silverlight Developers. The most important things I want this series to answer is : What is it?  Why do I care? How do I do it? I hope that you enjoy this series. Let’s get started: Tip/Trick #11) What is it? Underline Text in a TextBlock. Why do I care? I’ve seen people do some crazy things to get underlined text in a Silverlight Application. In case you didn’t know there is a property for that. How do I do it: On a TextBlock you have a property called TextDecorations. You can easily set this property in XAML or CodeBehind with the following snippet: <UserControl x:Class="SilverlightApplication19.MainPage" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <TextBlock Name="txtTB" Text="MichaelCrump.NET" TextDecorations="Underline" /> </Grid> </UserControl> or you can do it in CodeBehind… txtTB.TextDecorations = TextDecorations.Underline;   Tip/Trick #12) What is it? Get the browser information from a Silverlight Application. Why do I care? This will allow you to program around certain browser conditions that otherwise may not be aware of. How do I do it: It is very easy to extract Browser Information out a Silverlight Application by using the BrowserInformation class. You can copy/paste this code snippet to have access to all of them. string strBrowserName = HtmlPage.BrowserInformation.Name; string strBrowserMinorVersion = HtmlPage.BrowserInformation.BrowserVersion.Minor.ToString(); string strIsCookiesEnabled = HtmlPage.BrowserInformation.CookiesEnabled.ToString(); string strPlatform = HtmlPage.BrowserInformation.Platform; string strProductName = HtmlPage.BrowserInformation.ProductName; string strProductVersion = HtmlPage.BrowserInformation.ProductVersion; string strUserAgent = HtmlPage.BrowserInformation.UserAgent; string strBrowserVersion = HtmlPage.BrowserInformation.BrowserVersion.ToString(); string strBrowserMajorVersion = HtmlPage.BrowserInformation.BrowserVersion.Major.ToString(); Tip/Trick #13) What is it? Always check the minRuntimeVersion after creating a new Silverlight Application. Why do I care? Whenever you create a new Silverlight Application and host it inside of an ASP.net website you will notice Visual Studio generates some code for you as shown below. The minRuntimeVersion value is set by the SDK installed on your system. Be careful, if you are playing with beta’s like “Lightswitch” because you will have a higher version of the SDK installed. So when you create a new Silverlight 4 project and deploy it your customers they will get a prompt telling them they need to upgrade Silverlight. They also will not be able to upgrade to your version because its not released to the public yet. How do I do it: Open up the .aspx or .html file Visual Studio generated and look for the line below. Make sure it matches whatever version you are actually targeting. Tip/Trick #14) What is it? The VisualTreeHelper class provides useful methods for involving nodes in a visual tree. Why do I care? It’s nice to have the ability to “walk” a visual tree or to get the rendered elements of a ListBox. I have it very useful for debugging my Silverlight application. How do I do it: Many examples exist on the web, but say that you have a huge Silverlight application and want to find the parent object of a control.  In the code snippet below, we would get 3 MessageBoxes with (StackPanel first, Grid second and UserControl Third). This is a tiny application, but imagine how helpful this would be on a large project. <UserControl x:Class="SilverlightApplication18.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <StackPanel> <Button Content="Button" Height="23" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" /> </StackPanel> </Grid> </UserControl> private void button1_Click(object sender, RoutedEventArgs e) { DependencyObject obj = button1; while ((obj = VisualTreeHelper.GetParent(obj)) != null) { MessageBox.Show(obj.GetType().ToString()); } } Tip/Trick #15) What is it? Add ChildWindows to your Silverlight Application. Why do I care? ChildWindows are a great way to direct a user attention to a particular part of your application. This could be used when saving or entering data. How do I do it: Right click your Silverlight Application and click Add then New Item. Select Silverlight Child Window as shown below. Add an event and call the ChildWindow with the following snippet below: private void button1_Click(object sender, RoutedEventArgs e) { ChildWindow1 cw = new ChildWindow1(); cw.Show(); } Your main application can still process information but this screen forces the user to select an action before proceeding. The code behind of the ChildWindow will look like the following: namespace SilverlightApplication18 { public partial class ChildWindow1 : ChildWindow { public ChildWindow1() { InitializeComponent(); } private void OKButton_Click(object sender, RoutedEventArgs e) { this.DialogResult = true; //TODO: Add logic to save what the user entered. } private void CancelButton_Click(object sender, RoutedEventArgs e) { this.DialogResult = false; } } } Thanks for reading and please come back for Part 4.  Subscribe to my feed CodeProject

    Read the article

  • Blending the Sketchflow Action

    - by GeekAgilistMercenary
    Started a new Sketchflow Prototype in Expression Blend recently and documented each of the steps.  This blog entry covers some of those steps, which are the basic elements of any prototype.  I will have more information regarding design, prototype creation, and the process of the initial phases for development in the future.  For now, I hope you enjoy this short walk through.  Also, be sure to check out my last quick entry on Sketchflow. I started off with a Sketchflow Project, just like I did in my previous entry (more specifics in that entry about how to manipulate and build out the Sketchflow Map). Once I created the project I setup the following Sketchflow Map. The CoreNavigation is a ComponentScreen setup solely for the page navigation at the top of the screen.  The XAML markup in case you want to create a Component Screen with the same design is included below. <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:pb="clr-namespace:Microsoft.Expression.Prototyping.Behavior;assembly=Microsoft.Expression.Prototyping.Interactivity" x:Class="RapidPrototypeSketchScreens.CoreNavigation" d:DesignWidth="624" d:DesignHeight="49" Height="49" Width="624">   <Grid x:Name="LayoutRoot"> <TextBlock HorizontalAlignment="Stretch" Margin="307,3,0,0" Style="{StaticResource TitleCenter-Sketch}" Text="Aütøchart Scorecards" TextWrapping="Wrap"> <i:Interaction.Triggers> <i:EventTrigger EventName="MouseLeftButtonDown"> <pb:NavigateToScreenAction TargetScreen="RapidPrototypeSketchScreens.Screen_1"/> </i:EventTrigger> </i:Interaction.Triggers> </TextBlock> <Button HorizontalAlignment="Left" Margin="164,8,0,11" Style="{StaticResource Button-Sketch}" Width="144" Content="Scorecard"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <pb:NavigateToScreenAction TargetScreen="RapidPrototypeSketchScreens.Screen_1_2"/> </i:EventTrigger> </i:Interaction.Triggers> </Button> <Button HorizontalAlignment="Left" Margin="8,8,0,11" Style="{StaticResource Button-Sketch}" Width="152" Content="Standard Reports"> <i:Interaction.Triggers> <i:EventTrigger EventName="Click"> <pb:NavigateToScreenAction TargetScreen="RapidPrototypeSketchScreens.Screen_1_1"/> </i:EventTrigger> </i:Interaction.Triggers> </Button> </Grid> </UserControl> Now that the CoreNavigation Component Screen is done I built out each of the others.  In each of those screens I included the CoreNavigation Screen (all those little green lines in the image) as the top navigation.  In order to do that, as I created each of the pages I would hover over the CoreNavigation Object in the Sketchflow Map.  When the utilities drawer (the small menu that pops down under a node when you hover over it) shows click on the third little icon and drag it onto the page node you want a navigation screen on. Once I created all the screens I setup the navigation by opening up each screen and right clicking on the objects that needed to point to somewhere else in the prototype. Once I was done with the main page, my Home Navigation Page, it looked something like this in the Expression Blend Designer. I fleshed out each of the additional screens.  Once I was done I wanted to try out the deployment package.  The way to deploy a Sketchflow Prototype is to merely click on File –> Package SketchFlow Project and a prompt will appear.  In the prompt enter what you want the package to be called. I like to see the files generated afterwards too, so I checked the box to see that.  When Expression Blend is done generating everything you’ll have a directory like the one shown below, with all the needed files for deployment. Now these files can be copied or moved to any location for viewing.  One can even copy them (such as via FTP) to a server location to share with others.  Once they are deployed and you run the "TestPage.html" the other features of the Sketchflow Package are available. In the image below I have tagged a few sections to show the Sketchflow Player Features.  To the top left is the navigation, which provides a clearly defined area of movement in a list.  To the center right is the actual prototype application.  I have placed lists of things and made edits.  On the left hand side is the highlight feature, which is available in the Feedback section of the lower left.  On the right hand list I underlined the Autochart with an orange marker, and marked out two list items with a red marker. In the lower left hand side in the Feedback section is also an area to type in your feedback.  This can be useful for time based feedback, when you post this somewhere and want people to provide subsequent follow up feedback. Overall lots of great features, that enable some fairly rapid prototyping with customers.  Once one is familiar with the steps and parts of this Sketchflow Prototype Capabilities it is easy to step through an application without even stopping.  It really is that easy.  So get hold of Expression Blend 3 and get ramped up on Sketchflow, it will pay off in the design phases to do so! Original Entry

    Read the article

  • Unable to connect java webservie to android

    - by nag prakash
    This is my android activity. Please help me out. I will send the project completely if you can drop your mail id. package prakash.ws.connectsql; import org.ksoap2.SoapEnvelope; import org.ksoap2.serialization.SoapObject; import org.ksoap2.serialization.SoapPrimitive; import org.ksoap2.serialization.SoapSerializationEnvelope; import org.ksoap2.transport.AndroidHttpTransport; import android.os.Bundle; import android.app.Activity; import android.widget.EditText; import android.widget.TextView; public class MainActivity extends Activity { private static final String Soap_Action="http://testws.ws.prakash/testws"; private static final String Method_Name="testws"; private static final String Name_Space="http://testws.ws.prakash/"; private static final String URI="http://localhost:8045/testws/services/Testws?wsdl"; EditText ET; TextView Tv; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Packeting the request SoapObject request=new SoapObject(Name_Space,Method_Name); // pass the parameters to the method.If it has one request.addProperty("name", ET.getText().toString()); //passing the entire request to the envelope SoapSerializationEnvelope soapEnvelope=new SoapSerializationEnvelope(SoapEnvelope.VER11); soapEnvelope.setOutputSoapObject(request); //transporting envelope AndroidHttpTransport aht=new AndroidHttpTransport(URI); try{ aht.call(Soap_Action, soapEnvelope); @SuppressWarnings("deprecation") SoapPrimitive resultString=(SoapPrimitive) soapEnvelope.getResult(); Tv.setText(resultString.toString()); }catch(Exception e) { Tv.setText("error"); } } } This XML file does not appear to have any style information associated with it. The document tree is shown below. <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:ns1="http://org.apache.axis2/xsd" xmlns:ns="http://testws.ws.prakash" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" targetNamespace="http://testws.ws.prakash"> <wsdl:documentation>Please Type your service description here</wsdl:documentation> <wsdl:types> <xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://testws.ws.prakash"> <xs:element name="testws"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="name" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> <xs:element name="testwsResponse"> <xs:complexType> <xs:sequence> <xs:element minOccurs="0" name="return" nillable="true" type="xs:string"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> </wsdl:types> <wsdl:message name="testwsRequest"> <wsdl:part name="parameters" element="ns:testws"/> </wsdl:message> <wsdl:message name="testwsResponse"> <wsdl:part name="parameters" element="ns:testwsResponse"/> </wsdl:message> <wsdl:portType name="TestwsPortType"> <wsdl:operation name="testws"> <wsdl:input message="ns:testwsRequest" wsaw:Action="urn:testws"/> <wsdl:output message="ns:testwsResponse" wsaw:Action="urn:testwsResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="TestwsSoap11Binding" type="ns:TestwsPortType"> <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="testws"> <soap:operation soapAction="urn:testws" style="document"/> <wsdl:input> <soap:body use="literal"/> </wsdl:input> <wsdl:output> <soap:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="TestwsSoap12Binding" type="ns:TestwsPortType"> <soap12:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <wsdl:operation name="testws"> <soap12:operation soapAction="urn:testws" style="document"/> <wsdl:input> <soap12:body use="literal"/> </wsdl:input> <wsdl:output> <soap12:body use="literal"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:binding name="TestwsHttpBinding" type="ns:TestwsPortType"> <http:binding verb="POST"/> <wsdl:operation name="testws"> <http:operation location="testws"/> <wsdl:input> <mime:content type="text/xml" part="parameters"/> </wsdl:input> <wsdl:output> <mime:content type="text/xml" part="parameters"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="Testws"> <wsdl:port name="TestwsHttpSoap11Endpoint" binding="ns:TestwsSoap11Binding"> <soap:address location="http://localhost:8045/testws/services/Testws.TestwsHttpSoap11Endpoint/"/> </wsdl:port> <wsdl:port name="TestwsHttpSoap12Endpoint" binding="ns:TestwsSoap12Binding"> <soap12:address location="http://localhost:8045/testws/services/Testws.TestwsHttpSoap12Endpoint/"/> </wsdl:port> <wsdl:port name="TestwsHttpEndpoint" binding="ns:TestwsHttpBinding"> <http:address location="http://localhost:8045/testws/services/Testws.TestwsHttpEndpoint/"/> </wsdl:port> </wsdl:service> </wsdl:definitions> this web service is running fine in the server. Manifest File I have added the internet Permission. Now this is the error in the logcat. 07-04 21:31:00.757: E/dalvikvm(375): Could not find class 'org.ksoap2.serialization.SoapObject', referenced from method prakash.ws.connectsql.MainActivity.onCreate 07-04 21:31:00.757: W/dalvikvm(375): VFY: unable to resolve new-instance 481 (Lorg/ksoap2/serialization/SoapObject;) in Lprakash/ws/connectsql/MainActivity; 07-04 21:31:00.757: D/dalvikvm(375): VFY: replacing opcode 0x22 at 0x0008 07-04 21:31:00.757: D/dalvikvm(375): VFY: dead code 0x000a-004e in Lprakash/ws/connectsql/MainActivity;.onCreate (Landroid/os/Bundle;)V 07-04 21:31:00.937: D/AndroidRuntime(375): Shutting down VM 07-04 21:31:00.937: W/dalvikvm(375): threadid=1: thread exiting with uncaught exception (group=0x40015560) 07-04 21:31:00.957: E/AndroidRuntime(375): FATAL EXCEPTION: main 07-04 21:31:00.957: E/AndroidRuntime(375): java.lang.NoClassDefFoundError: org.ksoap2.serialization.SoapObject 07-04 21:31:00.957: E/AndroidRuntime(375): at prakash.ws.connectsql.MainActivity.onCreate(MainActivity.java:30) 07-04 21:31:00.957: E/AndroidRuntime(375): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 07-04 21:31:00.957: E/AndroidRuntime(375): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611) 07-04 21:31:00.957: E/AndroidRuntime(375): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663) 07-04 21:31:00.957: E/AndroidRuntime(375): at android.app.ActivityThread.access$1500(ActivityThread.java:117) 07-04 21:31:00.957: E/AndroidRuntime(375): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931) 07-04 21:31:00.957: E/AndroidRuntime(375): at android.os.Handler.dispatchMessage(Handler.java:99) 07-04 21:31:00.957: E/AndroidRuntime(375): at android.os.Looper.loop(Looper.java:123) 07-04 21:31:00.957: E/AndroidRuntime(375): at android.app.ActivityThread.main(ActivityThread.java:3683) 07-04 21:31:00.957: E/AndroidRuntime(375): at java.lang.reflect.Method.invokeNative(Native Method) 07-04 21:31:00.957: E/AndroidRuntime(375): at java.lang.reflect.Method.invoke(Method.java:507) 07-04 21:31:00.957: E/AndroidRuntime(375): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839) 07-04 21:31:00.957: E/AndroidRuntime(375): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597) 07-04 21:31:00.957: E/AndroidRuntime(375): at dalvik.system.NativeStart.main(Native Method) 07-04 21:31:05.307: I/Process(375): Sending signal. PID: 375 SIG: 9

    Read the article

  • Missing Edit Option on Silverlight 4 DataForm

    - by rip
    I’m trying out the Silverlight 4 beta DataForm control. I don’t seem to be able to get the edit and paging options at the top of the control like I’ve seen in Silverlight 3 examples. Has something changed or am I doing something wrong? Here’s my code: <UserControl x:Class="SilverlightApplication7.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400" xmlns:dataFormToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm.Toolkit"> <Grid x:Name="LayoutRoot" Background="White"> <dataFormToolkit:DataForm HorizontalAlignment="Left" Margin="10" Name="myDataForm" VerticalAlignment="Top" /> </Grid> </UserControl> public partial class MainPage : UserControl { public MainPage() { InitializeComponent(); this.Loaded += new RoutedEventHandler(MainPage_Loaded); } void MainPage_Loaded(object sender, RoutedEventArgs e) { Movie movie = new Movie(); myDataForm.CurrentItem = movie; } public enum Genres { Comedy, Fantasy, Drama, Thriller } public class Movie { public int MovieID { get; set; } public string Name { get; set; } public int Year { get; set; } public DateTime AddedOn { get; set; } public string Producer { get; set; } public Genres Genre { get; set; } } }

    Read the article

  • Silverlight 4 + MVVM + KeyDown event

    - by jturn
    I'm trying to build a sample game in Silverlight 4 using the MVVM design pattern to broaden my knowledge. I'm using Laurent Bugnion's MvvmLight toolkit as well (found here: http://mvvmlight.codeplex.com/ ). All I want to do right now is move a shape around within a Canvas by pressing specific keys. My solution contains a Player.xaml (just a rectangle; this will be moved around) and MainPage.xaml (the Canvas and an instance of the Player control). To my understanding, Silverlight doesn't support tunneling routed events, only bubbling. My big problem is that Player.xaml never recognizes the KeyDown event. It's always intercepted by MainPage.xaml first and it never reaches any child controls because it bubbles upward. I'd prefer that the logic to move the Player be in the PlayerViewModel class, but I don't think the Player can know about any KeyDown events firing without me explicitly passing them on down from the MainPage. I ended up adding the handler logic to the MainPageViewModel class. Now my problem is that the MainPageViewModel has no knowledge of Player.xaml so it cannot move this object when handling KeyDown events. I guess this is expected, as ViewModels should not have any knowledge of their associated Views. In not so many words...is there a way this Player user control within my MainPage.xaml can directly accept and handle KeyDown events? If not, what's the ideal method for my MainPageViewModel to communicate with its View's child controls? I'm trying to keep code out of the code-behind files as much as possible. Seems like it's best to put logic in the ViewModels for ease of testing and to decouple UI from logic. (MainPage.xaml) <UserControl x:Class="MvvmSampleGame.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:game="clr-namespace:MvvmSampleGame" xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4" mc:Ignorable="d" Height="300" Width="300" DataContext="{Binding Main, Source={StaticResource Locator}}"> <i:Interaction.Triggers> <i:EventTrigger EventName="KeyDown"> <cmd:EventToCommand Command="{Binding KeyPressCommand}" PassEventArgsToCommand="True" /> </i:EventTrigger> </i:Interaction.Triggers> <Canvas x:Name="LayoutRoot"> <game:Player x:Name="Player1"></game:Player> </Canvas> (MainViewModel.cs) public MainViewModel() { KeyPressCommand = new RelayCommand<KeyEventArgs>(KeyPressed); } public RelayCommand<KeyEventArgs> KeyPressCommand { get; private set; } private void KeyPressed(KeyEventArgs e) { if (e.Key == Key.Up || e.Key == Key.W) { // move player up } else if (e.Key == Key.Left || e.Key == Key.A) { // move player left } else if (e.Key == Key.Down || e.Key == Key.S) { // move player down } else if (e.Key == Key.Right || e.Key == Key.D) { // move player right } } Thanks in advance, Jeremy

    Read the article

  • WPF binding to current class property

    - by AnD
    Hello, I have a problem that i cant solve :( I have a user control (xaml file and cs file) in xaml it's like: <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Demo.CtrlContent" x:Name="UserControl" d:DesignWidth="598.333" d:DesignHeight="179.133" xmlns:Demo="clr-namespace:Demo" > <UserControl.Resources> <Storyboard x:Key="SBSmall"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="border" Storyboard.TargetProperty="(FrameworkElement.Width)"> <SplineDoubleKeyFrame KeyTime="00:00:01" Value="I WANT TO BIND VALUE HERE"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </UserControl.Resources> <Border BorderBrush="#FFC2C0C1" CornerRadius="3,3,3,3" BorderThickness="1,1,1,1" RenderTransformOrigin="0.5,0.5" x:Name="border" Margin="1,3,1,3" HorizontalAlignment="Left" VerticalAlignment="Top" Width="300"> and .cs file: public partial class CtrlContent { private mindef W { get { return (mindef) Window.GetWindow(this); } } public double MedWidth { // I WANT BIND THIS VALUE GO TO STORYBOARD VALUE IN XAML ABOVE get { double actualW; if(W == null) actualW = SystemParameters.PrimaryScreenWidth; else actualW = W.WrapMain.ActualWidth; return actualW - border.Margin.Left - border.Margin.Right; } } public double SmlWidth { get { return MedWidth / 2; } } public CtrlContent () { this.InitializeComponent(); } public CtrlContent (Content content) { this.InitializeComponent(); Document = content; } } in my .cs file there's a property called MedWidth, and in XAML file there's a storyboard called: SBSmall I want to bind my storyboard value to my property in class ctrlcontent. *the idea is, the storyboard is an animation to resize the control to a certain width depends on its parent container (the width is dynamic) anybody? please :) thanks!

    Read the article

  • How to change TXSDateTime SOAP serialization in Delphi 7?

    - by LukLed
    I am trying to use Java based webservice and have soap request: <?xml version="1.0"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body xmlns:NS1="http://something/"> <NS1:getRequest id="1"> <sessionId xsi:type="xsd:string"></sessionId> <reportType xsi:type="NS1:reportType">ALL</reportType> <xsd:dateFrom xsi:type="xsd:dateTime">2010-05-30T23:29:43.088+02:00</xsd:dateFrom> <xsd:dateTo xsi:type="xsd:dateTime">2010-05-31T23:29:43.728+02:00</xsd:dateTo> </NS1:getRequest> <parameters href="#1" /> </SOAP-ENV:Body> </SOAP-ENV:Envelope> It doesn't work, because webservice doesn't recognize dates as parameters. When I change <xsd:dateFrom xsi:type="xsd:dateTime">2010-05-30T23:29:43.088+02:00</xsd:dateFrom> <xsd:dateTo xsi:type="xsd:dateTime">2010-05-31T23:29:43.728+02:00</xsd:dateTo> to <dateFrom xsi:type="xsd:dateTime">2010-05-30T23:29:43.088+02:00</xsd:dateFrom> <dateTo xsi:type="xsd:dateTime">2010-05-31T23:29:43.728+02:00</xsd:dateTo> everything works ok, but Delphi (without Delphi source code changes) doesn't allow to change generated XML, it has only some options. Is it possible to set conversion options, so TSXDateTime is converted to <dateFrom, not <xsd:dateFrom tag? Did you meet that problem?

    Read the article

  • How to disable scrolling in ScrollViewer while Ctrl is pressed

    - by zunyite
    I'd like to implement zoom function while Ctrl key is pressed. But the MouseWheel event is not trigger while the mouse is over the ScrollView. Is there any way to do it? ps:SilverLight 4.0 <UserControl x:Class="SilverlightApplication11.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <Grid x:Name="LayoutRoot" Background="White"> <ScrollViewer Background="Gray" MouseWheel="ScrollViewer_MouseWheel" x:Name="scrollViewer"> <Rectangle Width="200" Height="2000" MouseWheel="ScrollViewer_MouseWheel" Fill="AliceBlue" /> </ScrollViewer> </Grid> private void ScrollViewer_MouseWheel(object sender, MouseWheelEventArgs e) { if (Keyboard.Modifiers.HasFlag(ModifierKeys.Control)) { zoom+=0.1; e.Handled = true; } }

    Read the article

  • Binding "Text-Property" of a derived textbox to another textbox doesn´t work

    - by Jehof
    Hello, i have a class 'MyTextBox' that derives from the default TextBox in Silverlight. This class currently contains no additional code. I set up a binding in xaml to bind the Text-Property of MyTextbox to another Textbox to reflect the input made in the Textbox. The effect is that MyTextBox doesn´t update and not display the text of the other Textbox. Additional i made an equal binding for a normal Textbox. And this works. Here´s the XAML for the bindings. <UserControl x:Class="Silverlight.Sample.Dummy" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:my="clr-namespace:Sample" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <StackPanel x:Name="LayoutRoot" Background="White"> <TextBox Height="23" x:Name="textBox2" Width="120" /> <TextBox Text="{Binding ElementName=textBox2, Path=Text, Mode=TwoWay}" Width="120" /> <my:NumberTextBox Width="120" Text="{Binding ElementName=textBox2, Path=Text, Mode=OneWay}" /> </StackPanel> Is there something special to set for binding, when i derive from a control. PS: I tried a binding to a dummy object with INotifyPropertyChanged and set it as DataContext for the existing Textboxes. This test works as expected and my derived textbox gets updated.

    Read the article

  • Mirth Transformer Error

    - by Ryan H
    I'm getting the following error when trying to convert HL7v3 to HL7v2 The message passed in is: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope/"> <S:Body> <PRPA_IN201306UV02 xmlns="urn:hl7-org:v3" xmlns:ns2="urn:gov:hhs:fha:nhinc:common:nhinccommon" xmlns:ns3="urn:gov:hhs:fha:nhinc:common:patientcorrelationfacade" xmlns:ns4="http://schemas.xmlsoap.org/ws/2004/08/addressing" ITSVersion="XML_1.0"> <id extension="4ae5403:12752e71a17:-7b52" root="1.1.1"/> ... </PRPA_IN201306UV02> </S:Body> </S:Envelope> The error I get is: ERROR-300: Transformer error ERROR MESSAGE: Error evaluating transformer com.webreach.mirth.server.MirthJavascriptTransformerException: CHANNEL: v3v2ConversionResponseMessage CONNECTOR: sourceConnector SCRIPT SOURCE: LINE NUMBER: 5 DETAILS: TypeError: The prefix "S" for element "S:Envelope" is not bound. at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.evaluateScript(JavaScriptTransformer.java:460) at com.webreach.mirth.server.mule.transformers.JavaScriptTransformer.transform(JavaScriptTransformer.java:356) at org.mule.transformers.AbstractEventAwareTransformer.doTransform(AbstractEventAwareTransformer.java:48) at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:197) at org.mule.transformers.AbstractTransformer.transform(AbstractTransformer.java:200) at org.mule.impl.MuleEvent.getTransformedMessage(MuleEvent.java:251) at org.mule.routing.inbound.SelectiveConsumer.isMatch(SelectiveConsumer.java:61) at org.mule.routing.inbound.InboundMessageRouter.route(InboundMessageRouter.java:83) at org.mule.providers.AbstractMessageReceiver$DefaultInternalMessageListener.onMessage(AbstractMessageReceiver.java:493) at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:272) at org.mule.providers.AbstractMessageReceiver.routeMessage(AbstractMessageReceiver.java:231) at com.webreach.mirth.connectors.vm.VMMessageReceiver.getMessages(VMMessageReceiver.java:207) at org.mule.providers.TransactedPollingMessageReceiver.poll(TransactedPollingMessageReceiver.java:108) at org.mule.providers.PollingMessageReceiver.run(PollingMessageReceiver.java:90) at org.mule.impl.work.WorkerContext.run(WorkerContext.java:290) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650) at edu.emory.mathcs.backport.java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675) at java.lang.Thread.run(Unknown Source) When I remove the S: tag in front of the Envelope and Body and redefine the namespace to default, it gives me a new error "TypeError: The prefix "xsi" for attribute "xsi:nil" associated with an element type "targetMessage" is not bound." referring to <targetMessage xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/> As if mirth can't handle the namespaces being defined on the same line as the first use of that element. Any suggestions would be useful

    Read the article

  • cxf jaxws with spring on gwt 2.0

    - by Karl
    Hi, I'm trying to use an application which uses cxf-jaxws in bean definition: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:sec="http://cxf.apache.org/configuration/security" xmlns:jaxws="http://cxf.apache.org/jaxws" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://cxf.apache.org/configuration/security http://cxf.apache.org/schemas/configuration/security.xsd http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd"> however in combination with the jetty from gwt 2.0 development shell my context doesn't load and I get this exception: org.springframework.web.context.ContextLoader: Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws] enter code hereOffending resource: class path resource [bean_definition.xml] My project is maven-based and I got cxf-rt-frontend-jaxws which contains the namespacehandler and spring.handlers on the classpath. I added cxf-transports-http-jetty.jar as well. Has anyone experienced this kind of problem and found a solution? It seems to be a classpath issue, added the cxf-rt-frontend-jaxws.jar by hand and it works... Somehow the maven dependency doesn't get added to the classpath. Thanks in advance, karl

    Read the article

  • How can I handle an empty namespace with XDocument.XPathEvaluate?

    - by Kevin
    I'm trying to use XDocument and XPathEvaluate to get values from the woot.com feed. I'm handling other namespaces fine, but this example is giving me problems. <rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0"> <channel> <category text="Comedy" xmlns="http://www.itunes.com/dtds/podcast-1.0.dtd"> </category> <!-- this is a problem node, notice 'xmlns=' --!> So I try this: XmlNamespaceManager man = new XmlNamespaceManager(nt); man.AddNamespace("ns", "http://www.w3.org/2000/xmlns/"); // i've also tried man.AddNamespace("ns", string.Empty); xDocument.Namespace = man; var val = xDocument.XPathEvaluate("/rss/channel/ns:category/@text", xdwn.Namespace); val is always null. I'm using ns: from the suggestion from VS 2010 XPath Navigator plugin. Any thoughts on how to handle this?

    Read the article

  • Secondary monitor bug: a problem in WPF or in the graphics driver?

    - by emddudley
    I have discovered a strange bug with my WPF application and I am trying to determine whether it is a problem with WPF or my graphics driver so that I can report it to the appropriate company. I have a Quadro FX 1700 with the latest drivers (197.54) on a Windows XP system, running a .NET 3.5 SP1 application. I have dual monitors, and when I maximize then minimize a child window of the main window on my primary monitor, the child window gets drawn on the secondary monitor as well. It appears in both places. I made a sample application (code is below) which induces this behavior. Start the application and ensure the main window is on your primary monitor. Double-click the main window. A green child window should appear. Click the green child window to maximize. Click the green child window to minimize. Can anyone else reproduce this problem? On my system the green child restores, but then it's drawn on both my primary and secondary monitors, rather than just the primary monitor. App.xaml <Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="DualMonitorBug.App" StartupUri="Shell.xaml" /> App.xaml.cs using System.Windows; namespace DualMonitorBug { public partial class App : Application { } } Shell.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="DualMonitorBug.Shell" Title="Shell" Height="480" Width="640" MouseDoubleClick="ShowDialog" /> Shell.xaml.cs using System.Windows; using System.Windows.Input; namespace DualMonitorBug { public partial class Shell : Window { public Shell() { InitializeComponent(); } private void ShowDialog(object sender, MouseButtonEventArgs e) { DialogWindow dialog = new DialogWindow(); dialog.Owner = this; dialog.Show(); } } } DialogWindow.xaml <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="DualMonitorBug.DialogWindow" Title="Dialog Window" Height="240" Width="320" AllowsTransparency="True" Background="Green" MouseLeftButtonDown="ShowHideDialog" WindowStyle="None" /> DialogWindow.xaml.cs using System.Windows; using System.Windows.Input; namespace DualMonitorBug { public partial class DialogWindow : Window { public DialogWindow() { InitializeComponent(); } private void ShowHideDialog(object sender, MouseButtonEventArgs e) { this.WindowState = (this.WindowState == WindowState.Normal) ? WindowState.Maximized : WindowState.Normal; } } }

    Read the article

  • Silverlight ComboBox Attached Behavior

    - by Mark Cooper
    I am trying to create an attached behavior that can be applied to a Silverlight ComboBox. My behavior is this: using System.Windows.Controls; using System.Windows; using System.Windows.Controls.Primitives; namespace AttachedBehaviours { public class ConfirmChangeBehaviour { public static bool GetConfirmChange(Selector cmb) { return (bool)cmb.GetValue(ConfirmChangeProperty); } public static void SetConfirmChange(Selector cmb, bool value) { cmb.SetValue(ConfirmChangeProperty, value); } public static readonly DependencyProperty ConfirmChangeProperty = DependencyProperty.RegisterAttached("ConfirmChange", typeof(bool), typeof(Selector), new PropertyMetadata(true, ConfirmChangeChanged)); public static void ConfirmChangeChanged(DependencyObject d, DependencyPropertyChangedEventArgs args) { Selector instance = d as Selector; if (args.NewValue is bool == false) return; if ((bool)args.NewValue) instance.SelectionChanged += OnSelectorSelectionChanged; else instance.SelectionChanged -= OnSelectorSelectionChanged; } static void OnSelectorSelectionChanged(object sender, RoutedEventArgs e) { Selector item = e.OriginalSource as Selector; MessageBox.Show("Unsaved changes. Are you sure you want to change teams?"); } } } This is used in XAML as this: <UserControl x:Class="AttachedBehaviours.MainPage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:this="clr-namespace:AttachedBehaviours" mc:Ignorable="d"> <Grid x:Name="LayoutRoot"> <StackPanel> <ComboBox ItemsSource="{Binding Teams}" this:ConfirmChangeBehaviour.ConfirmChange="true" > </ComboBox> </StackPanel> </Grid> </UserControl> I am getting an error: Unknown attribute ConfirmChangeBehaviour.ConfirmChange on element ComboBox. [Line: 13 Position: 65] Intellisense is picking up the behavior, why is this failing at runtime? Thanks, Mark EDIT: Register() changed to RegisterAttached(). Same error appears.

    Read the article

  • How do I remove the namespaces in Zend_Soap?

    - by Marc
    Hi There I am trying to use the tranlsation webservice from MyMemory: http://mymemory.translated.net/doc/spec.php Unfortunately, Zend_Soap_Client does generate an XML reqest object that is not recognized by the service. I guess it is because of the ns1-Attribute (Namespace) within the tags. So does anyone know how to remove them? That's basically what I do: $client = new Zend_Soap_Client('http://mymemory.translated.net/otms/?wsdl', array( 'soap_version' => SOAP_1_1 )); Then I call the function: try { $client->otmsGet(array( 'key' => 'xxx', 'q' => array( 'source' => 'Computer Science', 'source_lang' => 'en-US', 'target_lang' => 'de-DE' ) )); } catch(Exception $e) { print $client->getLastRequest(); } The resulting XML looks like this: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://tempuri.org/"> <SOAP-ENV:Body> <ns1:otmsGet> <ns1:key>xxx</ns1:key> <ns1:q> <ns1:source>Computer Science</ns1:source> <ns1:source_lang>en-US</ns1:source_lang> <ns1:target_lang>de-DE</ns1:target_lang> </ns1:q> </ns1:otmsGet> </SOAP-ENV:Body> </SOAP-ENV:Envelope> And it should actually look like this: <?xml version="1.0" encoding="UTF-8" standalone="no"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"> <SOAP-ENV:Body> <otmsGet xmlns="http://tempuri.org/"> <key xmlns:SOAPSDK1="http://tempuri.org/">mmDemo123</key> <q xmlns:SOAPSDK2="http://tempuri.org/"> <source>control panel</source> <source_lang>en-US</source_lang> <target_lang>es-ES</target_lang> </q> </otmsGet> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Thanks for your help!

    Read the article

  • Windows Forms Host + System.Windows.Forms.DataVisualization.Chart

    - by dark-elf2
    Good day all I have the following question: I would like to use Chart from Windows Forms due to the fact that it allows to build much more types of graphical visualisation that one from WPF Toolkit does. So, I am adding Chart control for Windows Forms as a child element into the WindowsFormsHost. But, when I run the application I and all my clients see only white area. Though, any other Windows Forms Control works great in Windows Forms Host. What is wrong with the Chart control? Here is the XAML code <Window x:Class="WpfApplication1.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration" xmlns:wf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" xmlns:CHR="clr-namespace:System.Windows.Forms.DataVisualization.Charting;assembly=System.Windows.Forms.DataVisualization" Title="Window1" Height="300" Width="300"> <Grid> <wfi:WindowsFormsHost x:Name="mainFGrid" > <CHR:Chart x:Name="mainChart" /> </wfi:WindowsFormsHost> </Grid> </Window> Kind regards, Anatoliy Sova

    Read the article

  • XMl to XHTML using XSL with namespace

    - by user256007
    How to handle XML Elements with namespace in an XSL. Here goes my XML Document <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xml" href="wpanel.xsl" ?> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:bong="http://bong/glob/wpanel" xml:lang="en" lang="en"> <head> <title> Transitional DTD XHTML Example </title> <link rel="stylesheet" type="text/css" href="wpanel.css" /> </head> <body> <bong:QButton text="Submit"></bong:QButton> <bong:QButton text="Reset"></bong:QButton> </body> </html> and My XSL goes here <?xml version="1.0" ?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:bong="http://bong/glob/wpanel" xmlns:fn="http://www.w3.org/2005/xpath-functions" > <xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" /> <xsl:template match="*|@*"> <xsl:copy> <xsl:apply-templates select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match="processing-instruction()|comment()"> <xsl:copy>.</xsl:copy> </xsl:template> I want to copy the elements without bong namespace as it is But transform those using the bong namespace. I think there will be an xsl element or attribute for that.I've serched the net. but haven't found yet. Thank You.

    Read the article

  • XMLOutputStream, repairing namespaces, and attributes without namespaces

    - by comment_bot
    A simple task: write an element with an unnamespaced attribute: String nsURI = "http://example.com/"; XMLOutputFactory outF = XMLOutputFactory.newFactory(); outF.setProperty(XMLOutputFactory.IS_REPAIRING_NAMESPACES, true); XMLStreamWriter out = outF.createXMLStreamWriter(System.out); out.writeStartElement(XMLConstants.DEFAULT_NS_PREFIX, "element", nsURI); out.writeAttribute(XMLConstants.DEFAULT_NS_PREFIX, XMLConstants.NULL_NS_URI, "attribute", "value"); out.writeEndElement(); out.close(); Woodstox's answer: <element xmlns="http://example.com/" attribute="value"></element> JDK 6 answer: <zdef-159241566:element xmlns="" xmlns:zdef-159241566="http://example.com/" attribute="value"></zdef-159241566:element> What?! Further, if we add a prefix to the element: out.writeStartElement(ns, "element", nsURI); JDK 6 no longer attempts to emit xmlns="": <ns:element xmlns:ns="http://example.com/" attribute="value"></ns:element> I'm fairly sure this is a bug in JDK 6. Am I right? And could anyone suggest a work around that will keep both libraries (and any others) happy? I don't want to require woodstox if I can help it.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >