Jeg har brug for at få konverteret nedenstående C# kode til PHP.
Er der noget der har lyst til at give det et skud?
Dusør gives gerne hvis det kan fremskynde processen, så byd ind hurtigst muligt.
På forhånd tak!
- public object SubmitOAKArticle(string sDOI, string sPublisherid, string sPassword, string sArticleTitle, string sJournalid, string sJournalVolume, string sJournalIssue, string sCorrespondingAuthor, string sCurrency, double dPrice, string sPublishingDate, string sPermanentLink, string sAbstract, string sKeywords)
- {
- string sReturnValue = "";
- try
- {
- com.openaccesskey.publisherservice.OAKPublisherService OAKService = new com.openaccesskey.publisherservice.OAKPublisherService();
- //Production mode
- //OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx"
-
- //Test mode
- OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx";
- sPublisherid = "0020";
- sPassword = "Test";
-
- //Test variables
- if (string.IsNullOrEmpty(sDOI))
- sDOI = DateAndTime.Now.ToOADate().ToString();
- if (string.IsNullOrEmpty(sArticleTitle))
- sArticleTitle = "Article of " + DateAndTime.Now.ToString("MM-dd-yyyy hh:mm:ss");
- if (string.IsNullOrEmpty(sPublishingDate))
- sPublishingDate = DateAndTime.Now.ToString("MM-dd-yyyy");
- if (string.IsNullOrEmpty(sCurrency))
- sCurrency = "USD";
- if (dPrice == null)
- dPrice = 1500;
- //If price is set to 0 then fixed price from database is used. If a fixed price can't be located the insert fails
-
- if (string.IsNullOrEmpty(sJournalid))
- sJournalid = "0959-8154";
- if (string.IsNullOrEmpty(sCorrespondingAuthor))
- sCorrespondingAuthor = "0017";
-
- sReturnValue = OAKService.SubmitArticle(sDOI, sPublisherid, sPassword, sArticleTitle, sJournalid, sJournalVolume, sJournalIssue, sCorrespondingAuthor, sCurrency, dPrice,
- sPublishingDate, sPermanentLink, sAbstract, sKeywords);
-
- //Possible return values
- //1: OK: Article was submitted successfully
- //2: Not authenticated!: Publisherid or password incorrect
-
- //Data errors
- //1: An article with DOI [DOI] already exists
- //2: JournalId [JournalId] does not exist
- //3: OAK ID [CorrespondingAuthor] does not exist. Corresponding author not recognized.
- //4: Journal volume is mandatory
- //5: Journal issue is mandatory
- //6: Article title is mandatory
- //7: Invalid currency
- //8: 'No price found in [Currency] and no price specified
- //9: General error: unspecified error. Contact Open Access Key help desk
-
- }
- catch (Exception ex)
- {
- throw ex;
- }
- return sReturnValue;
- }
-
-
-
-
- public string AddCoAuthor(string sPublisherid, string sPassword, string sDOI, string sAuthorId)
- {
- string sReturnValue = "";
- try
- {
- com.openaccesskey.publisherservice.OAKPublisherService OAKService = new com.openaccesskey.publisherservice.OAKPublisherService();
- //Production mode
- //OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx"
-
- //Test mode
- OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx";
- sPublisherid = "0020";
- sPassword = "Test";
-
- //Test variables
- sDOI = "123456987";
- sAuthorId = "0017";
-
- sReturnValue = OAKService.AddCoAuthor(sDOI, sPublisherid, sPassword, sAuthorId);
-
- if (sReturnValue.StartsWith("OK|"))
- {
- sReturnValue = sReturnValue.Replace("OK|", "");
- //Extract OAKId for use with either SubmitArticle or AddCoAuthor
- }
-
- //Possible return values
- //1: OK
- //2: Not authenticated!: Publisherid or password incorrect
- //3: General error: unspecified error. Contact Open Access Key help desk
- //4: DOI not recognized or not owned by this publisher
- //5: Author does not exist
-
- }
- catch (Exception ex)
- {
- throw ex;
- }
- return sReturnValue;
- }
-
-
-
-
- public Specialized.NameValueCollection AuthorSearch(string sPublisherid, string sPassword, string sQuery)
- {
- System.Collections.Specialized.NameValueCollection nvcAuthors = new System.Collections.Specialized.NameValueCollection();
- try
- {
- com.openaccesskey.publisherservice.OAKPublisherService OAKService = new com.openaccesskey.publisherservice.OAKPublisherService();
- //Production mode
- //OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx"
-
- //Test mode
- OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx";
- sPublisherid = "0020";
- sPassword = "Test";
-
- //Test variables
- sQuery = "J";
- //Search term
-
- string sReturnValue = OAKService.FindAuthor(sPublisherid, sPassword, sQuery);
-
- //Possible return values
- //1: Not authenticated!: Publisherid or password incorrect
-
- //2: List of authors matching the query. Values are semicolon delimited and linebreaks are used
- // First value is OAKId used to identify the author towards the web service.
- // Second value is human readable name.
- // Values can be split in various ways as shown below.
-
- //3: General error: unspecified error. Contact Open Access Key help desk
-
- foreach (object sAuthor_loopVariable in sReturnValue.Split(Strings.Chr(10)))
- {
- sAuthor = sAuthor_loopVariable;
- if (!string.IsNullOrEmpty(sAuthor))
- {
- nvcAuthors.Add(sAuthor.Split(";")(1), sAuthor.Split(";")(0));
- }
- }
- }
- catch (Exception ex)
- {
- throw ex;
- }
- return nvcAuthors;
- }
-
-
-
- public string CreateNewAuthor(string sPublisherid, string sPassword, string sFirstName, string sLastName, string sEmail, string sUniversity)
- {
- string sReturnValue = "";
- try
- {
- com.openaccesskey.publisherservice.OAKPublisherService OAKService = new com.openaccesskey.publisherservice.OAKPublisherService();
- //Production mode
- //OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx"
-
- //Test mode
- OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx";
- sPublisherid = "0020";
- sPassword = "Test";
-
- //Test variables
- sFirstName = "John";
- sLastName = "Doe";
- sEmail = DateAndTime.Now.ToOADate().ToString().Replace(".", "") + "@Somedomain.com";
- sUniversity = "University of OAK";
-
- sReturnValue = OAKService.CreateAuthor(sPublisherid, sPassword, sFirstName, sLastName, sEmail, sUniversity);
-
- if (sReturnValue.StartsWith("OK|"))
- {
- sReturnValue = sReturnValue.Replace("OK|", "");
- //Extract OAKId for use with either SubmitArticle or AddCoAuthor
- }
-
- //Possible return values
- //1: OK|[OAKid]: The OAKId for the new author is returned trailing the pipe character.
- //2: Not authenticated!: Publisherid or password incorrect
- //3: An author with the same [email] already exists.
- //4: General error: unspecified error. Contact Open Access Key help desk
-
- }
- catch (Exception ex)
- {
- throw ex;
- }
- return sReturnValue;
- }
-
-
- public Specialized.NameValueCollection JournalList(string sPublisherid, string sPassword)
- {
- System.Collections.Specialized.NameValueCollection nvcJournals = new System.Collections.Specialized.NameValueCollection();
- try
- {
- com.openaccesskey.publisherservice.OAKPublisherService OAKService = new com.openaccesskey.publisherservice.OAKPublisherService();
- //Production mode
- //OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx"
-
- //Test mode
- OAKService.Url = "http://Somedomain.com/publisherservice/oakpublisherservice.asmx";
- sPublisherid = "0020";
- sPassword = "Test";
-
- string sReturnValue = OAKService.GetJournals(sPublisherid, sPassword);
-
- //Possible return values
- //1: Not authenticated!: Publisherid or password incorrect
-
- //2: List of journals owned by this publisher. Values are semicolon delimited and linebreaks are used
- // First value is JournalId used to identify the journal towards the web service.
- // Second value is human readable name.
- // Values can be split in various ways as shown below.
-
- //3: General error: unspecified error. Contact Open Access Key help desk
-
- foreach (object sJournal_loopVariable in sReturnValue.Split(Strings.Chr(10)))
- {
- sJournal = sJournal_loopVariable;
- if (!string.IsNullOrEmpty(sJournal))
- {
- nvcJournals.Add(sJournal.Split(";")(1), sJournal.Split(";")(0));
- }
- }
- }
- catch (Exception ex)
- {
- throw ex;
- }
- return nvcJournals;
- }