Gemini Community Support Site

This Gemini community support site can be used to find solutions to product issues. You can log in using Open Id, Google Profile and even Facebook. Feel free to ask a question or browse FAQs and documentation. Product tour videos are also available along with how-to videos demonstrating key Gemini capabilities.




Call Web Service, Pass Value to It ( a way to integrate Gemini with Vault.)

api

Hi, to everyone.
I am a newbie to creating a C# coding applying inside .aspx file .
I did faced a lot of problem while i doing a way to integrate Gemini with Vault.

Now the situation is, i need to pass value from software name --> Vault Client to another software with name --> Gemini
Both of their data were stored seperately into different database.
Now i would  like to  create a .aspx file which will be called by the IIS i create name Fogbugz .

Below is the source should be worked. However, due to the version of Gemini changed, the method to be used i need to change.

http://gemini.countersoft.com/issue/ViewIssue.aspx?ID=470&PROJID=2


I am creating a aspx file with following code:

<!-- /* Font Definitions / @font-face {font-family:SimSun; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-alt:宋体; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} @font-face {font-family:"\@SimSun"; panose-1:2 1 6 0 3 1 1 1 1 1; mso-font-charset:134; mso-generic-font-family:auto; mso-font-pitch:variable; mso-font-signature:3 135135232 16 0 262145 0;} / Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0in; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:SimSun;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} --> <% @ Import Namespace ="System" %>

<% @ Import Namespace ="System.Net" %>

<% @ Import Namespace ="System.IO" %>

 

<% @ Page Language ="c#" Debug ="true" %>

 

 

<%

 

string ixBug;

string sFile;

string sPrev;

string sNew;

string url;

string vaultUrl;

string reposNumber;

string pathToFile;

string fileName;

 

ixBug = Request.QueryString["ixBug" ];

sFile = Request.QueryString["sFile" ];

sPrev = Request.QueryString["sPrev" ];

sNew = Request.QueryString["sNew" ];

 

/*reposNumber = Left(sFile, Instr(sFile, "$") - 1);

pathToFile = Right(sFile, Len(sFile) - Instr(sFile, "$") + 1);

fileName = Right(sFile, Len(sFile) - InStrRev(sFile, "/"));

 

vaultUrl = "http://localhost/VaultService/VaultWeb/GetFile.aspx?repid=" & reposNumber & "&path=" & pathToFile & "&version=" & sNew;

  */

/*'url = "http://localhost/gemini/sc/AddSCFile.aspx?ii=" & ixBug & "&fn=" & fileName & "&scr=" & Server.UrlEncode(vaultUrl) & "&fp=" & pathToFile

 

'Response.Redirect(url)

'Response.Write(url)

  */

Response.Write("test" );

 

 

    string soap = @"<?xml version=""1.0"" encoding=""utf-8""?>

<soap:Envelope xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance""

   xmlns:xsd=""http://www.w3.org/2001/XMLSchema""

   xmlns:soap=""http://schemas.xmlsoap.org/soap/envelope/"">

  <soap:Body>

    <CreateSourceControlFile xmlns=""http://syleetemp/gemini/webservices/"">

      <data>

 

        <IssueID>32</IssueID>

        <FileName>whatever</FileName>

        <FilePath>whateverrr</FilePath>

        <SourceControlRepository>Vault Server</SourceControlRepository>

      </data>

    </CreateSourceControlFile>

  </soap:Body>

</soap:Envelope>" ;

    HttpWebRequest req = (HttpWebRequest )WebRequest .Create("http://localhost/Gemini/webservices/IssuesWS.asmx/CreateSourceControlFile" );

    req.Headers.Add("SOAPAction" , "\"http://tempuri.org/Register\"" );

    req.ContentType = "text/xml;charset=\"utf-8\"" ;

    req.Accept = "text/xml" ;

    req.Method = "POST" ;

 

    using (Stream stm = req.GetRequestStream())

    {

        using (StreamWriter stmw = new StreamWriter (stm))

        {

            stmw.Write(soap);

        }

    }

 

    WebResponse response = req.GetResponse();

 

    Stream responseStream = response.GetResponseStream();

 

%>




But after i execute it inside IIS, it show error of

The remote server returned an error: (500) Internal Server Error.

Server Error in '/FogBugz' Application.

The remote server returned an error: (500) Internal Server Error.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Net.WebException: The remote server returned an error: (500) Internal Server Error.

Source Error:

Line 67:     }
Line 68:
Line 69: WebResponse response = req.GetResponse();

Line 70:
Line 71: Stream responseStream = response.GetResponseStream();




Is any professional can teach me? I am helpless now... Thank you a lot..
Appreciate from bottom of my heart..

Regards, Jim

keansuai
· 1
keansuai
Replies (1)
helpful
0
not helpful

The web service that you are trying to use is using WSE so you will need to add the WSE headers.

Note that we provide an SDK helper dll to do this, see our downloads page: http://countersoft.com/downloads.aspx


Mark Wing
· 9108
Mark Wing