Quantcast
Viewing latest article 11
Browse Latest Browse All 20

New Post: RegisterSensor and InsertObservation Services

Oleg (1 of 1),

Please remove the “.allow” at the end of the file.

From: olegkap [mailto:notifications@codeplex.com]
Sent: Tuesday, January 19, 2010 10:09 AM
To: Suppan, Scott J
Subject: Re: RegisterSensor and InsertObservation Services [ogc:78870]

From: olegkap

sorry for late response,

Did you try to run the example as it is or did some modifications to the code?
If so can you attach the project and I can a look?

From error message it seems that it doesn't invoke correct method.

Oleg

On Wed, Jan 13, 2010 at 3:54 PM, ScottSuppan <notifications@codeplex.com> wrote:

From: ScottSuppan

Oleg,

Sure, here’s the response I captured via Visual Studio 2008.

<HTML><HEAD><link rel=\"alternate\" type=\"text/xml\" href=\"http://localhost:5786/Swe.svc?disco\"/><STYLE type=\"text/css\">#content{ FONT-SIZE: 0.7em; PADDING-BOTTOM: 2em; MARGIN-LEFT: 30px}BODY{MARGIN-TOP: 0px; MARGIN-LEFT: 0px; COLOR: #000000; FONT-FAMILY: Verdana; BACKGROUND-COLOR: white}P{MARGIN-TOP: 0px; MARGIN-BOTTOM: 12px; COLOR: #000000; FONT-FAMILY: Verdana}PRE{BORDER-RIGHT: #f0f0e0 1px solid; PADDING-RIGHT: 5px; BORDER-TOP: #f0f0e0 1px solid; MARGIN-TOP: -5px; PADDING-LEFT: 5px; FONT-SIZE: 1.2em; PADDING-BOTTOM: 5px; BORDER-LEFT: #f0f0e0 1px solid; PADDING-TOP: 5px; BORDER-BOTTOM: #f0f0e0 1px solid; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e5e5cc}.heading1{MARGIN-TOP: 0px; PADDING-LEFT: 15px; FONT-WEIGHT: normal; FONT-SIZE: 26px; MARGIN-BOTTOM: 0px; PADDING-BOTTOM: 3px; MARGIN-LEFT: -30px; WIDTH: 100%; COLOR: #ffffff; PADDING-TOP: 10px; FONT-FAMILY: Tahoma; BACKGROUND-COLOR: #003366}.intro{MARGIN-LEFT: -15px}</STYLE><TITLE>Swe Service</TITLE></HEAD><BODY>

Swe Service

You have created a service.

To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:

svcutil.exe http://localhost:5786/Swe.svc?wsdl\">http://localhost:5786/Swe.svc?wsdl

This will generate a configuration file and a code file that contains the client class. Add the two files to your client application and use the generated client class to call the Service. For example:

C#

<font color=\"blue\">class </font><font color=\"teal\">Test\n</font>{\n<font color=\"blue\">    static void </font>Main()\n    {\n        <font color=\"teal\">SweClient</font> client = <font color=\"blue\">new </font><font color=\"teal\">SweClient</font>();\n\n<font color=\"green\">        // Use the 'client' variable to call operations on the service.\n\n</font><font color=\"green\">        // Always close the client.\n</font>        client.Close();\n    }\n}\n

Visual Basic

<font color=\"blue\">Class </font><font color=\"teal\">Test\n</font><font color=\"blue\">    Shared Sub </font>Main()\n<font color=\"blue\">        Dim </font>client As <font color=\"teal\">SweClient</font> = <font color=\"blue\">New </font><font color=\"teal\">SweClient</font>()\n<font color=\"green\">        ' Use the 'client' variable to call operations on the service.\n\n</font><font color=\"green\">        ' Always close the client.\n</font>        client.Close()\n<font color=\"blue\">    End Sub\n</font><font color=\"blue\">End Class</font>

</BODY></HTML>

I got this value back from here [see responseData variable below]:

private TResponse CreateResponse<TResponse>(HttpWebResponse webResponse)

{

StreamReader responseStream = newStreamReader(webResponse.GetResponseStream());

string responseData = responseStream.ReadToEnd();

What happens next is that an exception is thrown when the code attempts to deserialize the xml [for obvious reasons :-) ]

if (ser.CanDeserialize(XmlReader.Create(newStringReader(responseData))))

{

response = (TResponse)ser.Deserialize(newStringReader(responseData));

}

elseif (this._exceptionSerializer.CanDeserialize(XmlReader.Create(newStringReader(responseData))))

{

Read the full discussion online.

To add a post to this discussion, reply to this email (ogc@discussions.codeplex.com)

To start a new discussion for this project, email ogc@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Read the full discussion online.

To add a post to this discussion, reply to this email (ogc@discussions.codeplex.com)

To start a new discussion for this project, email ogc@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe on CodePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at CodePlex.com


Viewing latest article 11
Browse Latest Browse All 20

Trending Articles