Jump to content

bossakungen

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

About bossakungen

  • Birthday 02/22/1978

Profile Information

  • Gender
    Male
  • Location
    Sweden

bossakungen's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. It is very much possible to generate all kinds of reports using php, what kind of report did you have in mind?
  2. Problem is probably connected to your variables ($db_host, $db_username, $db_password), maybe you have a mistype somewhere? Do an echo on those three variables to see if they are showing the correct values, should give you some relevant information I think. Also, as previous poster said, it is a good idea to use <?php instead of <?.
  3. I would not recommend putting an order_id in the items_table, this will make it so that for every order created you must create a new item row that is related to that order, causing heavy redundancy. Instead I would suggest putting the item_ids in the order table, like say: ORDER Table ========= order_id item_id items_complete items_progress items_remaining This would cause one order row to contain the following information: - what kind of item to be shipped - how many items that are complete related to that order - how many items that are remaining related to that order The order could then be updated when unit counts are changed. Now, you might want to add customer_ids etc to the order row too but that is not what this thread is about ITEM Table ======== item_id item_name (or something else) The above example does not need a UNIT table, however I might have misunderstood the question so please tell me if this is not what you meant. Also, there are a lot of ways to do things when it comes to databases, this is just one One key factor, imo, is to reduce redundancy, I would recommend reading about the normal forms.
  4. Try this: "DELETE FROM emails WHERE id = '$GET[id]'" should work in you php code.
  5. Ok, I have this XML code that works fine if I send it, to a WSDL web service, via a program called SOAPSonar. I would like to use NuSoap (or any other PHP compatible library) to do the same request. I have the client already connected and everything in place but I cannot get it to work exactly like SOAPSonar. There seems to be some problem when it comes to getting the service to understand exactly what I send it. Does anyone have any idea about this, this cannot be that hard tbh (I am an XML/SOAP newbie). Basically I just want to send the service this raw XML: <?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://net.sfd.se/WebService/CKDB" xmlns:s="http://www.w3.org/2001/XMLSchema"> <soap:Header> <tns:SoapAuthenticator> <tns:UserId>XXXXX</tns:UserId> <tns:Password>XXXXXXXXXXXXXXXXXX</tns:Password> </tns:SoapAuthenticator> </soap:Header> <soap:Body> <tns:Save> <tns:strTransactionId>ADD_ADR_DISTRIBUTED</tns:strTransactionId> <tns:intDBSpace>XXXXXX</tns:intDBSpace> <tns:dsSave> <xs:schema id="ADD_ADR_DISTRIBUTED" xmlns="" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xs:element name="ADD_ADR_DISTRIBUTED" msdata:IsDataSet="true" msdata:UseCurrentLocale="true"> <xs:complexType> <xs:choice minOccurs="0" maxOccurs="unbounded"> <xs:element name="EgetAdr"> <xs:complexType> <xs:sequence> <xs:element name="Foretag" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="50" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Namn" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="50" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="ENamn" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="40" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Adress" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="2147483647" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Personnr" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="15" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="TelArb" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="17" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="TelBost" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="17" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="TelMobil" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="17" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="TelAnnat" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="17" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Fax" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="17" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Email" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="100" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Hemsida" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="100" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Anteckning" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="2147483647" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="ChangeDate" type="xs:dateTime" minOccurs="0" /> <xs:element name="NyAdress" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="2147483647" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Inkomst" type="xs:int" minOccurs="0" /> <xs:element name="RegDatum" type="xs:dateTime" minOccurs="0" /> <xs:element name="AktDatum" type="xs:dateTime" minOccurs="0" /> <xs:element name="NyAdressFrom" type="xs:dateTime" minOccurs="0" /> <xs:element name="EjUtskick" type="xs:boolean" minOccurs="0" /> <xs:element name="UserGID" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="40" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="GID" default="ADR"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="40" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="MasterGID" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="40" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="ClassGID" default="CLS_ADR_PERSON" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="40" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="FNamn" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="40" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Email2" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="100" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="Postnr" type="xs:int" minOccurs="0" /> <xs:element name="Postort" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="25" /> </xs:restriction> </xs:simpleType> </xs:element> <xs:element name="NyPostnr" type="xs:int" minOccurs="0" /> <xs:element name="NyPostort" minOccurs="0"> <xs:simpleType> <xs:restriction base="xs:string"> <xs:maxLength value="25" /> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:choice> </xs:complexType> <xs:unique name="Constraint1" msdata:PrimaryKey="true"> <xs:selector xpath=".//ToDo" /> <xs:field xpath="GID" /> </xs:unique> <xs:unique name="Log_Constraint1" msdata:ConstraintName="Constraint1" msdata:PrimaryKey="true"> <xs:selector xpath=".//Log" /> <xs:field xpath="GID" /> </xs:unique> </xs:element> </xs:schema> <diffgr:diffgram xmlns:msdata="urn:schemas-microsoft-com:xml-msdata" xmlns:diffgr="urn:schemas-microsoft-com:xml-diffgram-v1"> <EgetAdr> <EgetAdr diffgr:id="EgetAdr1" msdata:rowOrder="0" diffgr:hasChanges="inserted"> <Namn>Fredrik Testar!</Namn> <RegDatum>2007-03-16T00:00:00+01:00</RegDatum> <AktDatum>2007-03-16T00:00:00+01:00</AktDatum> <GID>ADR5FAD7FF29DFA4B708B21B0F72245EB6E</GID> <ClassGID>CLS_ADR_PERSON</ClassGID> </EgetAdr> </EgetAdr> </diffgr:diffgram> </tns:dsSave> </tns:Save> </soap:Body> </soap:Envelope>
  6. Hello all! First let me say that I have searched the net all over but I cannot find an answer, that is why I am trying here hoping some of you PHP gurus might know something I work as a PHP programmer and recently I got the task of connecting (using PHP5) to a .NET webservice using wsdl and datasets. Now, after a week of frustration and hard work I am really stuck. Here is my problem. My task is to save user variables in the webservice using a method called ‘Save’. I can connect fine and also generate the required ID for the operation, the problem comes when I try to save the variables, I can create the dataset via a method called GetNew but how can I access it after creating it? If I assign a variable to the GetNew call I get a fairly large array, but populating it and sending it into the webservice won’t work. I guess what I am trying to ask is if it is possible to use, in PHP, a remote .NET webservice using datasets to save rows in its database. Here is my code: I connect to the webservice using NuSOAP: $url = 'http://webservice.address.here.com/WebService/folder/Main.asmx?wsdl'; $client = new soapclient($url, true); This works fine, next step is to authenticate myself, this also works fine: $headers = '<SoapAuthenticator xmlns="'http://webservice.address.here.com/WebService/folder/"><UserId>xxxx</UserId><Password>xxxxx</Password></SoapAuthenticator>'; $client->setHeaders($headers); Next step is to generate a unique id using a method called GenerateSFDDBGID, again this works fine: $GetID = array('strGIDPrefix'=>$adr); $GID = $client->call('GenerateSFDDBGID', array('parameters'=>$GetID)); Now we come to the tricky part, creating, populating and saving the dataset, here is the code in .NET: DataSet dsCKDB = ws.GetNew("DATASET_IDENTIFIER"); The above code I try to recreate by doing this: $param_init= ' DATASET_IDENTIFIER'; $GetNew = array('strTransactionId'=>$param_init); $ds = $client->call('GetNew', array('parameters'=>$GetNew)); This give me a large array filled with values… the next line is what is driving me crazy: //New row DataRow drLogCKDB = dsCKDB.Tables["Log"].NewRow(); Is this possible in any way to do in php? Can I somehow recreate the NewRow() call? rest of the .NET code here: //Add extern source values drLogCKDB["AdrGID"] = "XXXXXXXXXXXXXXXXXXXXX"; drLogCKDB["Datum"] = DateTime.Now; drLogCKDB["Text"] = "CKDB WS Devnet - " + DateTime.Now.ToString(); drLogCKDB["ClassGID"] = "CLS_LOG_FRITEXT"; //Add Row dsCKDB.Tables["Log"].Rows.Add(drLogCKDB); //Save dsCKDB = ws.Save("DATASET_IDENTIFIER ", intDBSpace, dsCKDB); Anyhow, thanks for reading this post and If you know anything about .NET datasets and PHP please reply. I would like to know if it is even possible, been wasting a lot of time on this :/ Have a nice day! Best regards /Fredrik
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.