Search Results

Search found 1063 results on 43 pages for 'xsd'.

Page 6/43 | < Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >

  • Defining recursive algebraic data types in XML XSD

    - by Ben Challenor
    Imagine I have a recursive algebraic data type like this (Haskell syntax): data Expr = Zero | One | Add Expr Expr | Mul Expr Expr I'd like to represent this in XML, and I'd like an XSD schema for it. I have figured out how to achieve this syntax: <Expr> <Add> <Expr> <Zero/> </Expr> <Expr> <Mul> <Expr> <One/> </Expr> <Expr> <Add> <Expr> <One/> </Expr> <Expr> <One/> </Expr> </Add> </Expr> </Mul> </Expr> </Add> </Expr> with this schema: <xs:complexType name="Expr"> <xs:choice minOccurs="1" maxOccurs="1"> <xs:element minOccurs="1" maxOccurs="1" name="Zero" type="Zero" /> <xs:element minOccurs="1" maxOccurs="1" name="One" type="One" /> <xs:element minOccurs="1" maxOccurs="1" name="Add" type="Add" /> <xs:element minOccurs="1" maxOccurs="1" name="Mul" type="Mul" /> </xs:choice> </xs:complexType> <xs:complexType name="Zero"> <xs:sequence> </xs:sequence> </xs:complexType> <xs:complexType name="One"> <xs:sequence> </xs:sequence> </xs:complexType> <xs:complexType name="Add"> <xs:sequence> <xs:element minOccurs="2" maxOccurs="2" name="Expr" type="Expr" /> </xs:sequence> </xs:complexType> <xs:complexType name="Mul"> <xs:sequence> <xs:element minOccurs="2" maxOccurs="2" name="Expr" type="Expr" /> </xs:sequence> </xs:complexType> But what I really want is this syntax: <Add> <Zero/> <Mul> <One/> <Add> <One/> <One/> </Add> </Mul> </Add> Is this possible? Thanks!

    Read the article

  • XSD Schema for XML with multiple structures

    - by Xetius
    I am attempting to write an XML Schema to cover a number of XML conditions which I may encounter. I have the same root element (serviceRequest) with different child elements. I was trying to use the xs:extension element to define multiple versions, but it is complaining about unexpected element orderInclusionCriteria etc. Am I going about this the right way, or is there a better way to define this? The other way I thought about this was to have a single xs:choice with all the options inside it, but this seemed somewhat inelegant. These XSD files are for use within XMLBeans if that makes any difference. I have Given the following 2 examples of XML: 1) <?xml version="1.0" encoding="utf-8"?> <serviceRequest method="GOO" debug="NO"> <sessionId sID="ABC1234567" /> <orderInclusionCriteria accountId="1234567" accountNum="1234567890" /> </serviceRequest> 2) <?xml version="1.0" encoding="utf-8"?> <serviceRequest method="GOO" debug="NO"> <sessionId sID="ABC1234567" /> <action aType='MakePayment'> <makePayment accountID='CH91015165S' amount='5.00' /> </action> </serviceRequest> I thought I could use the following schema file: <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="serviceRequest" type="ServiceRequestType" /> <xs:element name="session" type="SessionType" /> <xs:attribute name="method" type="xs:string" /> <xs:attribute name="debug" type="xs:string" /> <xs:complexType name="SessionType"> <xs:attribute name="sID" use="required"> <xs:simpleType> <xs:restriction base="xs:string"/> </xs:simpleType> </xs:attribute> </xs:complexType> <xs:complexType name="ServiceRequestType"> <xs:sequence> <xs:element ref="session" /> </xs:sequence> <xs:attribute ref="method" /> <xs:attribute ref="debug" /> </xs:complexType> <xs:complexType name="OrderTrackingServiceRequest"> <xs:complexContent> <xs:extension base="ServiceRequestType"> <xs:complexType> <xs:sequence> <xs:element name="OrderInclusionCriteria" type="xs:string" /> </xs:sequence> </xs:complexType> </xs:extension> </xs:complexContent> </xs:complexType> <xs:complexType name="Action"> <xs:complexContent> <xs:extension base="ServiceRequestType"> <xs:complexType> <xs:sequence> <xs:element name="makePayment"> <xs:complexType> <xs:attribute name="accountID" type="xs:string" /> <xs:attribute name="amount" type="xs:string" /> <xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="aType" type="xs:string" /> </xs:complexType> </xs:extension> </xs:complexContent> </xs:complexType> </xs:schema>

    Read the article

  • XML and XSD - use element name as replacement of xsi:type for polymorphism

    - by disown
    Taking the W3C vehicle XSD as an example: <schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://cars.example.com/schema" xmlns:target="http://cars.example.com/schema"> <complexType name="Vehicle" abstract="true"/> <complexType name="Car"> <complexContent> <extension base="target:Vehicle"/> ... </complexContent> </complexType> <complexType name="Plane"> <complexContent> <extension base="target:Vehicle"/> <sequence> <element name="wingspan" type="integer"/> </sequence> </complexContent> </complexType> </schema> , and the following definition of 'meansOfTravel': <complexType name="MeansOfTravel"> <complexContent> <sequence> <element name="transport" type="target:Vehicle"/> </sequence> </complexContent> </complexType> <element name="meansOfTravel" type="target:MeansOfTravel"/> With this definition you need to specify the type of your instance using xsi:type, like this: <meansOfTravel> <transport xsi:type="Plane"> <wingspan>3</wingspan> </transport> </meansOfTravel> I would just like to acheive a 'name of type' - 'name of element' mapping so that this could be replaced with just <meansOfTravel> <plane> <wingspan>3</wingspan> </plane> </meansOfTravel> The only way I could do this until now is by making it explicit: <complexType name="MeansOfTravel"> <sequence> <choice> <element name="plane" type="target:Plane"/> <element name="car" type="target:Car"/> </choice> </sequence> </complexType> <element name="meansOfTravel" type="target:MeansOfTravel"/> But this means that I have to list all possible sub-types in the 'MeansOfTravel' complex type. Is there no way of making the XML parser assume that you mean a 'Plane' if you call the element 'plane'? Or do I have to make the choice explicit? I would just like to keep my design DRY - if you have any other suggestions (like groups or so) - i would love to hear them.

    Read the article

  • Problem with develop of XML Schema based on an existent XML

    - by farhad
    Hello! I have a problem with the validation of this piece of XML: <?xml version="1.0" encoding="UTF-8"?> <i-ching xmlns="http://www.oracolo.it/i-ching"> <predizione> <esagramma nome="Pace"> <trigramma> <yang/><yang/><yang/> </trigramma> <trigramma> <yin/><yin/><yin/> </trigramma> </esagramma> <significato>Questa combinazione preannuncia <enfasi>boh</enfasi>, e forse anche <enfasi>mah, chissa</enfasi>.</significato> </predizione> <predizione> <esagramma nome="Ritorno"> <trigramma> <yang/><yin/> <yin/> </trigramma> <trigramma> <yin/><yin/><yin/> </trigramma> </esagramma> <significato>Si prevede con certezza <enfasi>qualcosa</enfasi>, <enfasi>ma anche <enfasi>no</enfasi></enfasi>.</significato> </predizione> </i-ching> This XML Schema was developed with Russian Dolls technique: <?xml version="1.0" encoding="UTF-8"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://www.oracolo.it/i-ching" targetNamespace="http://www.oracolo.it/i-ching" > <xsd:element name="i-ching"> <xsd:complexType> <xsd:sequence> <xsd:element name="predizione" minOccurs="0" maxOccurs="64"> <xsd:complexType> <xsd:sequence> <xsd:element name="esagramma"> <xsd:complexType> <!-- vi sono 2 trigrammi --> <xsd:sequence> <xsd:element name="trigramma" minOccurs="2" maxOccurs="2"> <xsd:complexType> <xsd:sequence minOccurs="3" maxOccurs="3"> <xsd:choice> <xsd:element name="yang"/> <xsd:element name="yin"/> </xsd:choice> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> <xsd:attribute name="nome" type="xsd:string"/> </xsd:complexType> </xsd:element> <!-- significato: context model misto --> <xsd:element name="significato"> <xsd:complexType mixed="true"> <xsd:sequence> <xsd:element name="enfasi" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema> For exercise I have to develop an XML Schema to validate the previous XML. The problem is that oxygen says me this: cvc-complex-type.2.4.a: Invalid content was found starting with element 'predizione'. One of '{predizione}' is expected. Start location: 3:6 End location: 3:16 URL: http://www.w3.org/TR/xmlschema-1/#cvc-complex-type why? is it something wrong with my xml schema? thank you very much

    Read the article

  • map xml element to xsd complexType based on attribute

    - by Joshua Johnson
    Assume there exists an XML instance document that looks like this: <root> <object type="foo"> <!-- ... --> </object> <object type="bar"> <!-- ... --> </object> </root> My goal is to have a small (static) schema that verifies proper <element type="xxx" /> syntax for objects, and another schema (more prone to change) that verifies the contents of each object element against a complexType that matches the type attribute: <complexType name="foo"><!--should match object with type="foo"--></complexType> <complexType name="bar"><!--should match object with type="bar"--></complexType> What is the best way to accomplish this (or something similar)?

    Read the article

  • XSD any element

    - by ofer shwartz
    HI! I'm trying to create a list that some of the elements are defined and some are not, without priority to order. I tried it this way, with an any element: <?xml version="1.0"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:complexType name="object" mixed="true"> <xs:choice> <xs:element name="value" minOccurs="1" maxOccurs="1"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:enumeration value="1"/> </xs:restriction> </xs:simpleType> </xs:element> <xs:any namespace="##any" processContents="skip"/> </xs:choice> </xs:complexType> <xs:element name="object" type="object"/> </xs:schema> And it tells me this error: :0:0: error: complex type 'object' violates the unique particle attribution rule in its components 'value' and '##any' Can someone help me out solve the problem? Ofer

    Read the article

  • Jaxb doesn't generate Interface for element of complex type

    - by user275886
    I have an xsd (for basecamp xml) that contains <xsd:complexType name="ProjectType"> <xsd:sequence> <xsd:element name="announcement" type="TypedNilableStringElementType" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="created-on" type="TypedDateElementType" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="id" type="TypedIntegerElementType" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="last-changed-on" type="TypedDateTimeElementType" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="name" type="xsd:string" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="show-announcement" type="TypedBooleanElementType" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="show-writeboards" type="TypedBooleanElementType" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="start-page" type="xsd:string" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="status" type="xsd:string" maxOccurs="1" minOccurs="1"> </xsd:element> <xsd:element name="company" type="SimpleCompanyType" maxOccurs="1" minOccurs="1"> </xsd:element> </xsd:sequence> </xsd:complexType> and <xsd:element name="project" type="ProjectType"> </xsd:element> I'm looking at http://java.sun.com/javaee/5/docs/tutorial/doc/bnbah.html and can't understand what I'm doing different from the sample schema in Table 17-13 where there is an element named purchaseOrder of type PurchaseOrderType. According to the tutorial, running xjc on the schema, one will get PurchaseOrder.java interface and PurchaseOrderType.java interface. When I run xjc on my schema I only get a ProjectType.java class, and when the xml actually consist of a single element, this won't parse, because there are no Project.java class/interface to match.

    Read the article

  • xml regular expression/regex OR operator

    - by Naz Haque
    Hi am trying to use a regeX to read through my document to identify currency types whether they're $,£ or a €. The regex I've created doesn't seem to work, somebody please advise me what it should be. I'd really appreciate the help: The regEX I've created ("\$|£|€]")is in a simpleType within my XSD file used for validating a document. The code is show after the colon, please note to display on stackoverflow I've had to remove the open/close tags (<): xs:simpleType name="currencyType" xs:restriction base="utf8-string" xs:length value="1" / xs:pattern value="[\$|£|€]"/ /xs:restriction /xs:simpleType

    Read the article

  • Is there a standard Java utility to parse XSD files at runtime?

    - by Andrew
    I've been looking around for a way to programmatically parse XSD files to generate an XML mapping so that I can take any XSD file and create a parser that will parse any XML file that conforms to it, and my google-fu has been coming up short. XSOM looks promising, as it will parse an XSD file and make all its attributes available in a straight forward way. Are there any other options or standard libraries available that will produce an XML file parser from an XSD file? [Conclusion] Thanks everyone for your responses, they were a real help. I was able to write implementations using JAXP, Eclipses EMF and in XSOM that all worked as desired. JAXP was very straight forward and easy to learn and do. EMF was actually a pain to get going properly, there were so many jars that had to be included for it to work standalone that I would not recommend it. XSOM was even simpler than the JAXP implementation, so I went with it in the end.

    Read the article

  • Why does this XML validation via XSD fail in libxml2 (but succeed in xmllint) and how do I fix it?

    - by mtree
    If I run this XML validation via xmllint: xmllint --noout --schema schema.xsd test.xml I get this success message: .../test.xml validates However if I run the same validation via libxml2's C API: int result = xmlSchemaValidateDoc(...) I get a return value of 1845 and this failure message: Element '{http://example.com/XMLSchema/1.0}foo': No matching global declaration available for the validation root. Which I can make absolutely no sense of. :( schema.xsd: <?xml version="1.0" encoding="utf-8" ?> <!DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://example.com/XMLSchema/1.0" targetNamespace="http://example.com/XMLSchema/1.0" elementFormDefault="qualified" attributeFormDefault="unqualified"> <xs:element name="foo"> </xs:element> </xs:schema> test.xml: <?xml version="1.0" encoding="UTF-8"?> <foo xmlns="http://example.com/XMLSchema/1.0"> </foo> main.c: #include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include <string.h> #include <libxml/parser.h> #include <libxml/valid.h> #include <libxml/xmlschemas.h> u_int32_t get_file_size(const char *file_name) { struct stat buf; if ( stat(file_name, &buf) != 0 ) return(0); return (unsigned int)buf.st_size; } void handleValidationError(void *ctx, const char *format, ...) { char *errMsg; va_list args; va_start(args, format); vasprintf(&errMsg, format, args); va_end(args); fprintf(stderr, "Validation Error: %s", errMsg); free(errMsg); } int main (int argc, const char * argv[]) { const char *xsdPath = argv[1]; const char *xmlPath = argv[2]; printf("\n"); printf("XSD File: %s\n", xsdPath); printf("XML File: %s\n", xmlPath); int xmlLength = get_file_size(xmlPath); char *xmlSource = (char *)malloc(sizeof(char) * xmlLength); FILE *p = fopen(xmlPath, "r"); char c; unsigned int i = 0; while ((c = fgetc(p)) != EOF) { xmlSource[i++] = c; } printf("\n"); printf("XML Source:\n\n%s\n", xmlSource); fclose(p); printf("\n"); int result = 42; xmlSchemaParserCtxtPtr parserCtxt = NULL; xmlSchemaPtr schema = NULL; xmlSchemaValidCtxtPtr validCtxt = NULL; xmlDocPtr xmlDocumentPointer = xmlParseMemory(xmlSource, xmlLength); parserCtxt = xmlSchemaNewParserCtxt(xsdPath); if (parserCtxt == NULL) { fprintf(stderr, "Could not create XSD schema parsing context.\n"); goto leave; } schema = xmlSchemaParse(parserCtxt); if (schema == NULL) { fprintf(stderr, "Could not parse XSD schema.\n"); goto leave; } validCtxt = xmlSchemaNewValidCtxt(schema); if (!validCtxt) { fprintf(stderr, "Could not create XSD schema validation context.\n"); goto leave; } xmlSetStructuredErrorFunc(NULL, NULL); xmlSetGenericErrorFunc(NULL, handleValidationError); xmlThrDefSetStructuredErrorFunc(NULL, NULL); xmlThrDefSetGenericErrorFunc(NULL, handleValidationError); result = xmlSchemaValidateDoc(validCtxt, xmlDocumentPointer); leave: if (parserCtxt) { xmlSchemaFreeParserCtxt(parserCtxt); } if (schema) { xmlSchemaFree(schema); } if (validCtxt) { xmlSchemaFreeValidCtxt(validCtxt); } printf("\n"); printf("Validation successful: %s (result: %d)\n", (result == 0) ? "YES" : "NO", result); return 0; } console output: XSD File: /Users/dephiniteloop/Desktop/xml_validate/schema.xsd XML File: /Users/dephiniteloop/Desktop/xml_validate/test.gkml XML Source: <?xml version="1.0" encoding="UTF-8"?> <foo xmlns="http://example.com/XMLSchema/1.0"> </foo> Validation Error: Element '{http://example.com/XMLSchema/1.0}foo': No matching global declaration available for the validation root. Validation successful: NO (result: 1845) In case it matters: I'm on OSX 10.6.7 with its default libxml2.dylib (/Developer/SDKs/MacOSX10.6.sdk/usr/lib/libxml2.2.7.3.dylib)

    Read the article

  • Linked XSD files in Visual Studio 2010 - How to work with a file in the Unauthorized Zone

    - by David
    I am trying to view a 3rd Party's XSD file in Visual Studio 2010. The XSD file is stored on my local drive. It includes another XSD file, which is stored in the same folder on my local drive. Visual Studio (or perhaps the underlying .Net framework) will not process the included XSD file, because it is in an "unauthorized zone". This much is explained in the following MSDN blog. Does anybody know how I can authorize this included file, so I can see it in the beautiful new content model view?

    Read the article

  • How do I correctly reference georss: point in my xsd?

    - by Chris Hinch
    I am putting together an XSD schema to describe an existing GeoRSS feed, but I am stumbling trying to use the external georss.xsd to validate an element of type georss:point. I've reduced the problem to the smallest components thusly: XML: <?xml version="1.0" encoding="utf-8"?> <this> <apoint>45.256 -71.92</apoint> </this> XSD: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:georss="http://www.georss.org/georss"> <xs:import namespace="http://www.georss.org/georss" schemaLocation="http://georss.org/xml/1.1/georss.xsd"/> <xs:element name="this"> <xs:complexType> <xs:sequence> <xs:element name="apoint" type="georss:point"/> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> If I make apoint type "xs: string" instead of "georss: point", the XML validates happily against the XSD, but as soon as I reference an imported type (georss: point), my XML validator (Notepad++ | XML Tools) "cannot parse the schema". What am I doing wrong?

    Read the article

  • Can't connect to SSL web service with WS-Security using PHP SOAP extension - certificate, complex WSDL

    - by BillF
    Using the PHP5 SOAP extension I have been unable to connect to a web service having an https endpoint, with client certificate and using WS-Security, although I can connect using soapUI with the exact same wsdl and client certificate, and obtain the normal response to the request. There is no HTTP authentication and no proxy is involved. The message I get is 'Could not connect to host'. Have been able to verify that I am NOT hitting the host server. (Earlier I wrongly said that I was hitting the server.) The self-signed client SSL certificate is a .pem file converted by openssl from a .p12 keystore which in turn was converted by keytool from a .jks keystore having a single entry consisting of private key and client certificate. In soapUI I did not need to supply a server private certificate, the only two files I gave it were the wdsl and pem. I did have to supply the pem and its passphrase to be able to connect. I am speculating that despite the error message my problem might actually be in the formation of the XML request rather than the SSL connection itself. The wsdl I have been given has nested complex types. The php server is on my Windows XP laptop with IIS. The code, data values and WSDL extracts are shown below. (The WSSoapClient class simply extends SoapClient, adding a WS-Security Username Token header with mustUnderstand = true and including a nonce, both of which the soapUI call had required.) Would so much appreciate any help. I'm a newbie thrown in at the deep end, and how! Have done vast amounts of Googling on this over many days, following many suggestions and have read Pro PHP by Kevin McArthur. An attempt to use classmaps in place of nested arrays also fell flat. The Code class STEeService { public function invokeWebService(array $connection, $operation, array $request) { try { $localCertificateFilespec = $connection['localCertificateFilespec']; $localCertificatePassphrase = $connection['localCertificatePassphrase']; $sslOptions = array( 'ssl' => array( 'local_cert' => $localCertificateFilespec, 'passphrase' => $localCertificatePassphrase, 'allow_self-signed' => true, 'verify_peer' => false ) ); $sslContext = stream_context_create($sslOptions); $clientArguments = array( 'stream_context' => $sslContext, 'local_cert' => $localCertificateFilespec, 'passphrase' => $localCertificatePassphrase, 'trace' => true, 'exceptions' => true, 'encoding' => 'UTF-8', 'soap_version' => SOAP_1_1 ); $oClient = new WSSoapClient($connection['wsdlFilespec'], $clientArguments); $oClient->__setUsernameToken($connection['username'], $connection['password']); return $oClient->__soapCall($operation, $request); } catch (exception $e) { throw new Exception("Exception in eServices " . $operation . " ," . $e->getMessage(), "\n"); } } } $connection is as follows: array(5) { ["username"]=> string(8) "DFU00050" ["password"]=> string(10) "Fabricate1" ["wsdlFilespec"]=> string (63) "c:/inetpub/wwwroot/DMZExternalService_Concrete_WSDL_Staging.xml" ["localCertificateFilespec"]=> string(37) "c:/inetpub/wwwroot/ClientKeystore.pem" ["localCertificatePassphrase"]=> string(14) "password123456" } $clientArguments is as follows: array(7) { ["stream_context"]=> resource(8) of type (stream-context) ["local_cert"]=> string(37) "c:/inetpub/wwwroot/ClientKeystore.pem" ["passphrase"]=> string(14) "password123456" ["trace"]=> bool(true) ["exceptions"]=> bool(true) ["encoding"]=> string(5) "UTF-8" ["soap_version"]=> int(1) } $operation is as follows: 'getConsignmentDetails' $request is as follows: array(1) { [0]=> array(2) { ["header"]=> array(2) { ["source"]=> string(9) "customerA" ["accountNo"]=> string(8) "10072906" } ["consignmentId"]=> string(11) "GKQ00000085" } } Note how there is an extra level of nesting, an array wrapping the request which is itself an array. This was suggested in a post although I don't see the reason, but it seems to help avoid other exceptions. The exception thrown by ___soapCall is as follows: object(SoapFault)#6 (9) { ["message":protected]=> string(25) "Could not connect to host" ["string":"Exception":private]=> string(0) "" ["code":protected]=> int(0) ["file":protected]=> string(43) "C:\Inetpub\wwwroot\eServices\WSSecurity.php" ["line":protected]=> int(85) ["trace":"Exception":private]=> array(5) { [0]=> array(6) { ["file"]=> string(43) "C:\Inetpub\wwwroot\eServices\WSSecurity.php" ["line"]=> int(85) ["function"]=> string(11) "__doRequest" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(4) { [0]=> string(1240) " DFU00050 Fabricate1 E0ByMUA= 2010-10-28T13:13:52Z customerA10072906GKQ00000085 " [1]=> string(127) "https://services.startrackexpress.com.au:7560/DMZExternalService/InterfaceServices/ExternalOps.serviceagent/OperationsEndpoint1" [2]=> string(104) "/DMZExternalService/InterfaceServices/ExternalOps.serviceagent/OperationsEndpoint1/getConsignmentDetails" [3]=> int(1) } } [1]=> array(4) { ["function"]=> string(11) "__doRequest" ["class"]=> string(39) "startrackexpress\eservices\WSSoapClient" ["type"]=> string(2) "->" ["args"]=> array(5) { [0]=> string(1240) " DFU00050 Fabricate1 E0ByMUA= 2010-10-28T13:13:52Z customerA10072906GKQ00000085 " [1]=> string(127) "https://services.startrackexpress.com.au:7560/DMZExternalService/InterfaceServices/ExternalOps.serviceagent/OperationsEndpoint1" [2]=> string(104) "/DMZExternalService/InterfaceServices/ExternalOps.serviceagent/OperationsEndpoint1/getConsignmentDetails" [3]=> int(1) [4]=> int(0) } } [2]=> array(6) { ["file"]=> string(43) "C:\Inetpub\wwwroot\eServices\WSSecurity.php" ["line"]=> int(70) ["function"]=> string(10) "__soapCall" ["class"]=> string(10) "SoapClient" ["type"]=> string(2) "->" ["args"]=> array(4) { [0]=> string(21) "getConsignmentDetails" [1]=> array(1) { [0]=> array(2) { ["header"]=> array(2) { ["source"]=> string(9) "customerA" ["accountNo"]=> string(8) "10072906" } ["consignmentId"]=> string(11) "GKQ00000085" } } [2]=> NULL [3]=> object(SoapHeader)#5 (4) { ["namespace"]=> string(81) "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" ["name"]=> string(8) "Security" ["data"]=> object(SoapVar)#4 (2) { ["enc_type"]=> int(147) ["enc_value"]=> string(594) " DFU00050 Fabricate1 E0ByMUA= 2010-10-28T13:13:52Z " } ["mustUnderstand"]=> bool(true) } } } [3]=> array(6) { ["file"]=> string(42) "C:\Inetpub\wwwroot\eServices\eServices.php" ["line"]=> int(87) ["function"]=> string(10) "__soapCall" ["class"]=> string(39) "startrackexpress\eservices\WSSoapClient" ["type"]=> string(2) "->" ["args"]=> array(2) { [0]=> string(21) "getConsignmentDetails" [1]=> array(1) { [0]=> array(2) { ["header"]=> array(2) { ["source"]=> string(9) "customerA" ["accountNo"]=> string(8) "10072906" } ["consignmentId"]=> string(11) "GKQ00000085" } } } } [4]=> array(6) { ["file"]=> string(58) "C:\Inetpub\wwwroot\eServices\EnquireConsignmentDetails.php" ["line"]=> int(44) ["function"]=> string(16) "invokeWebService" ["class"]=> string(38) "startrackexpress\eservices\STEeService" ["type"]=> string(2) "->" ["args"]=> array(3) { [0]=> array(5) { ["username"]=> string(10) "DFU00050 " ["password"]=> string(12) "Fabricate1 " ["wsdlFilespec"]=> string(63) "c:/inetpub/wwwroot/DMZExternalService_Concrete_WSDL_Staging.xml" ["localCertificateFilespec"]=> string(37) "c:/inetpub/wwwroot/ClientKeystore.pem" ["localCertificatePassphrase"]=> string(14) "password123456" } [1]=> string(21) "getConsignmentDetails" [2]=> array(1) { [0]=> array(2) { ["header"]=> array(2) { ["source"]=> string(9) "customerA" ["accountNo"]=> string(8) "10072906" } ["consignmentId"]=> string(11) "GKQ00000085" } } } } } ["previous":"Exception":private]=> NULL ["faultstring"]=> string(25) "Could not connect to host" ["faultcode"]=> string(4) "HTTP" } Here are some WSDL extracts (TIBCO BusinessWorks): <xsd:complexType name="TransactionHeaderType"> <xsd:sequence> <xsd:element name="source" type="xsd:string"/> <xsd:element name="accountNo" type="xsd:integer"/> <xsd:element name="userId" type="xsd:string" minOccurs="0"/> <xsd:element name="transactionId" type="xsd:string" minOccurs="0"/> <xsd:element name="transactionDatetime" type="xsd:dateTime" minOccurs="0"/> </xsd:sequence> </xsd:complexType> <xsd:element name="getConsignmentDetailRequest"> <xsd:complexType> <xsd:sequence> <xsd:element name="header" type="prim:TransactionHeaderType"/> <xsd:element name="consignmentId" type="prim:ID" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="getConsignmentDetailResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="consignment" type="freight:consignmentType" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="getConsignmentDetailRequest"> <xsd:complexType> <xsd:sequence> <xsd:element name="header" type="prim:TransactionHeaderType"/> <xsd:element name="consignmentId" type="prim:ID" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="getConsignmentDetailResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="consignment" type="freight:consignmentType" minOccurs="0" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> <wsdl:operation name="getConsignmentDetails"> <wsdl:input message="tns:getConsignmentDetailsRequest"/> <wsdl:output message="tns:getConsignmentDetailsResponse"/> <wsdl:fault name="fault1" message="tns:fault"/> </wsdl:operation> <wsdl:service name="ExternalOps"> <wsdl:port name="OperationsEndpoint1" binding="tns:OperationsEndpoint1Binding"> <soap:address location="https://services.startrackexpress.com.au:7560/DMZExternalService/InterfaceServices/ExternalOps.serviceagent/OperationsEndpoint1"/> </wsdl:port> </wsdl:service> And here in case it's relevant is the WSSoapClient class: <?PHP namespace startrackexpress\eservices; use SoapClient, SoapVar, SoapHeader; class WSSoapClient extends SoapClient { private $username; private $password; /*Generates a WS-Security header*/ private function wssecurity_header() { $timestamp = gmdate('Y-m-d\TH:i:s\Z'); $nonce = mt_rand(); $passdigest = base64_encode(pack('H*', sha1(pack('H*', $nonce).pack('a*', $timestamp).pack('a*', $this->password)))); $auth = ' <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken> <wsse:Username>' . $this->username . '</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">' . $this->password . '</wsse:Password> <wsse:Nonce>' . base64_encode(pack('H*', $nonce)).'</wsse:Nonce> <wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">' . $timestamp . '</wsu:Created> </wsse:UsernameToken> </wsse:Security> '; $authvalues = new SoapVar($auth, XSD_ANYXML); $header = new SoapHeader("http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd", "Security",$authvalues, true); return $header; } // Sets a username and passphrase public function __setUsernameToken($username,$password) { $this->username=$username; $this->password=$password; } // Overwrites the original method, adding the security header public function __soapCall($function_name, $arguments, $options=null, $input_headers=null, $output_headers=null) { try { $result = parent::__soapCall($function_name, $arguments, $options, $this->wssecurity_header()); return $result; } catch (exception $e) { throw new Exception("Exception in __soapCall, " . $e->getMessage(), "\n"); } } } ?> Update: The request XML would have been as follows: <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://startrackexpress/Common/Primitives/v1" xmlns:ns2="http://startrackexpress/Common/actions/externals/Consignment/v1" xmlns:ns3="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <SOAP-ENV:Header> <wsse:Security SOAP-ENV:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken> <wsse:Username>DFU00050</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">Fabricate1</wsse:Password> <wsse:Nonce>M4FIeGA=</wsse:Nonce> <wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">2010-10-29T14:05:27Z</wsu:Created> </wsse:UsernameToken> </wsse:Security> </SOAP-ENV:Header> <SOAP-ENV:Body><ns2:getConsignmentDetailRequest> <ns2:header><ns1:source>customerA</ns1:source><ns1:accountNo>10072906</ns1:accountNo></ns2:header> <ns2:consignmentId>GKQ00000085</ns2:consignmentId> </ns2:getConsignmentDetailRequest></SOAP-ENV:Body> </SOAP-ENV:Envelope> This was obtained with the following code in WSSoapClient: public function __doRequest($request, $location, $action, $version) { echo "<p> " . htmlspecialchars($request) . " </p>" ; return parent::__doRequest($request, $location, $action, $version); }

    Read the article

  • Using XmlSerializer deserialize complex type elements are null

    - by Jean Bastos
    I have the following schema: <?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tipos="http://www.ginfes.com.br/tipos_v03.xsd" targetNamespace="http://www.ginfes.com.br/servico_consultar_situacao_lote_rps_resposta_v03.xsd" xmlns="http://www.ginfes.com.br/servico_consultar_situacao_lote_rps_resposta_v03.xsd" attributeFormDefault="unqualified" elementFormDefault="qualified"> <xsd:import schemaLocation="tipos_v03.xsd" namespace="http://www.ginfes.com.br/tipos_v03.xsd" /> <xsd:element name="ConsultarSituacaoLoteRpsResposta"> <xsd:complexType> <xsd:choice> <xsd:sequence> <xsd:element name="NumeroLote" type="tipos:tsNumeroLote" minOccurs="1" maxOccurs="1"/> <xsd:element name="Situacao" type="tipos:tsSituacaoLoteRps" minOccurs="1" maxOccurs="1"/> </xsd:sequence> <xsd:element ref="tipos:ListaMensagemRetorno" minOccurs="1" maxOccurs="1"/> </xsd:choice> </xsd:complexType> </xsd:element> </xsd:schema> and the following class: [System.CodeDom.Compiler.GeneratedCodeAttribute("xsd", "2.0.50727.3038")] [System.SerializableAttribute()] [System.Diagnostics.DebuggerStepThroughAttribute()] [System.ComponentModel.DesignerCategoryAttribute("code")] [System.Xml.Serialization.XmlTypeAttribute(AnonymousType = true, Namespace = "http://www.ginfes.com.br/servico_consultar_situacao_lote_rps_envio_v03.xsd")] [System.Xml.Serialization.XmlRootAttribute(Namespace = "http://www.ginfes.com.br/servico_consultar_situacao_lote_rps_envio_v03.xsd", IsNullable = false)] public partial class ConsultarSituacaoLoteRpsEnvio { [System.Xml.Serialization.XmlElementAttribute(Order = 0)] public tcIdentificacaoPrestador Prestador { get; set; } [System.Xml.Serialization.XmlElementAttribute(Order = 1)] public string Protocolo { get; set; } } Use the following code to deserialize the object: XmlSerializer respSerializer = new XmlSerializer(typeof(ConsultarSituacaoLoteRpsResposta)); StringReader reader = new StringReader(resp); ConsultarSituacaoLoteRpsResposta respModel = (ConsultarSituacaoLoteRpsResposta)respSerializer.Deserialize(reader); does not occur any error but the properties of objects are null, anyone know what is happening?

    Read the article

  • C# XmlSchemaSet - Resolving included schemas to enumerate attribute groups

    - by satixx
    Hi, I currently have a compiled XmlSchemaSet from which I get possible elements/attributes for each specific "parent" element defined in the schema. I have a single "master" xsd schema which includes another schema and uses attributeGroup references for some "common" elements. Here is a sample: (MasterSchema.xsd) <?xml version="1.0" encoding="utf-8"?> <xs:schema id="MasterSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="CommonNamespace.xsd" xmlns="CommonNamespace.xsd" xmlns:mstns="CommonNamespace.xsd" elementFormDefault="qualified" > <xs:include schemaLocation="SourceAttributeGroups.xsd"/> <xs:element name="Binding" minOccurs="0" maxOccurs="2"> <xs:complexType> <xs:attribute name="Name" type="xs:string"/> <xs:attributeGroup ref="BindingSourceAttributeGroup"/> </xs:complexType> </xs:element> </xs:schema> (SourceAttributeGroups.xsd) <?xml version="1.0" encoding="utf-8"?> <xs:schema id="SourceAttributeGroups" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="CommonNamespace.xsd" xmlns="CommonNamespace.xsd" xmlns:mstns="CommonNamespace.xsd" elementFormDefault="qualified" > <xs:attributeGroup id="BindingSourceAttributeGroup" name="BindingSourceAttributeGroup"> <xs:attribute name="Source"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Data"/> </xs:restriction> </xs:simpleType> </xs:attribute> <!-- When Source is None --> <xs:attribute name="Value" type="xs:string"/> <!-- Label --> <xs:attribute name="Label" type="xs:string"/> </attributeGroup> </xs:schema> I would like to create an XmlSchemaSet in C# which would resolve, compile and "merge" every references of the MasterSchema so it would finaly look like this: (MasterSchema.xsd) <?xml version="1.0" encoding="utf-8"?> <xs:schema id="MasterSchema" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="CommonNamespace.xsd" xmlns="CommonNamespace.xsd" xmlns:mstns="CommonNamespace.xsd" elementFormDefault="qualified" > <xs:include schemaLocation="SourceAttributeGroups.xsd"/> <xs:element name="Binding" minOccurs="0" maxOccurs="2"> <xs:complexType> <xs:attribute name="Name" type="xs:string"/> <xs:attribute name="Source"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:enumeration value="Data"/> </xs:restriction> </xs:simpleType> </xs:attribute> <!-- When Source is None --> <xs:attribute name="Value" type="xs:string"/> <!-- Label --> <xs:attribute name="Label" type="xs:string"/> </xs:complexType> </xs:element> </xs:schema> This way, I could traverse each XmlSchemaParticle of the compiled schema to get every single attribute for a specific element, even when its attributes are defined in an external schema. At the moment, when I get the possible attributes for a "Binding" element, I only get the "Name" attribute since it is originally defined in the "master" schema. What would be the possible solutions to this problem? Thanks! Satixx

    Read the article

  • What does "Unatuthorized zone" mean when browsing xsd files with Visual Studio 2010?

    - by starskythehutch
    When I open up an xsd file that includes other xsd files, all of the included files are added to a section called "Unauthorized zone". Visual Studio highlights the element and gives the following error when trying to resolve the schemaLocation attribute: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. I've read the following blog post, but I'm not familiar enough with xsd yet to fully understand it. Can anyone explain why this is happening or point me to a good resource that can help?

    Read the article

  • Can I create a dataset XSD without using the designer?

    - by Per Åkerberg
    Hi everyone, I want to be able to create the XSD file for my typed dataset without using the visual studio dataset designer. Is there a way to do this using for instance a command-line tool? There is some magic happening when a table is dragged from the server explorer to the design surface, but where does that magic come from? To add some flavour to the mix, I am using DB2 LUW 9.1, but I am guessing that the process is similar using other database vendors. Once I have the XSD I can use XSD.exe to create my .CS class, no problem. Thanks for any help or suggestion! /Per

    Read the article

  • Can I use CodeSynthesis XSD (C++/Tree mapping) together with a GPLv3-licensed library?

    - by Erik Sjölund
    Is it possible to write an open source project that uses generated code from CodeSynthesis XSD (C++/Tree) and then link it to a third-party library that is licensed under the GPL version 3? Some background information: CodeSynthesis XSD is licensed under the GPL version 2 but with an extra FLOSS exception (http://www.codesynthesis.com/projects/xsd/FLOSSE). C++ source code generated from CodeSynthesis XSD (C++/Tree) needs to be linked against Xerces (http://xerces.apache.org/xerces-c/) that is licensed under the Apache License 2.0. Update I posted a similar question on the xsd-users mailing list two years ago but I didn't fully understand the answers. In that email thread, I wrote: I think it is the GPL version 3 software that doesn't allow itself be linked to software that can't be "relicensed" to GPL version 3 ( for instance GPL version 2 software ). That would also include XSD as the FLOSS exception doesn't give permission to "relicense" XSD to GPL version 3.

    Read the article

  • What tool can I use to merge wsdl and xsd file?

    - by LukLed
    I have two files, one with webservice description (wsdl), second with data structures used in webservice (xsd). I have nothing more, webservice doesn't work yet. I need to merge them into one, because Delphi 7 WSDL Importer doesn't handle included xsd files to well. Where can I find tool to do it?

    Read the article

  • Book Review: The Art of XSD - SQL Server XML schemas

    The 14 chapters of "The Art of XSD”, written by MVP Jacob Sebastian, will take the reader step-by–step all the way from the basics of XML Schema design all the way to advanced topics on SQL Server XML Schema Collections. Reviewer Hima Bindu Vejella gives it an 8/10 rating, and gives us an excellent distilled description of what the book has to offer.

    Read the article

  • Book Review: The Art of XSD - SQL Server XML schemas

    The 14 chapters of "The Art of XSD, written by MVP Jacob Sebastian, will take the reader step-bystep all the way from the basics of XML Schema design all the way to advanced topics on SQL Server XML Schema Collections. Reviewer Hima Bindu Vejella gives it an 8/10 rating, and gives us an excellent distilled description of what the book has to offer....Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Using XSD file in VS2005

    - by xt_20
    Hello all I want to write an XML file. I have created an XSD file named XMLSchema.xsd, and run the command 'xsd /c XMLSchema.xsd' which generated a c# class file. Now, how do I use this file to generate XML files? Part of my code: <?xml version="1.0" encoding="utf-8"?> <xs:schema id="XMLSchema" targetNamespace="http://tempuri.org/XMLSchema.xsd" elementFormDefault="qualified" xmlns="http://tempuri.org/XMLSchema.xsd" > <xs:element name="root"> <xs:complexType> <xs:sequence> <xs:element name="Audit"> <xs:complexType> ... which generates a c# class 'root'. How do I call 'root' from my C# web program? Thanks

    Read the article

  • Does XSD allow simpleContent and complexContent at the same time?

    - by Willi Schönborn
    I want to write an xsd for the xmlrpc spec (and generate java classes out of it using jaxb). The xmlrpc spec allows values like: <value><int>123</int></value> <value><boolean>1</boolean></value> But at the same time it requires: If no type is indicated, the type is string. Which means i could receive something like this: <value>test123</value> which is equivalent to <value><string>test123</string></value> Is there a way to define this in an xsd.

    Read the article

< Previous Page | 2 3 4 5 6 7 8 9 10 11 12 13  | Next Page >