Monday, March 26, 2012

How to create ENDPOINT in Sql Server CTP Beta 2

I am learnig to create a endpoint in Sql Server 2005. I have create a simple SP to get a customer in Northwind.
Then create a endpoint using HTTP.

SP:
CREATE PROCEDURE [db_accessadmin].[upGetCustomer]
@.CustId nchar(5)
AS

SELECT CustomerID,CompanyName,ContactName,ContactTitle,Address,City,PostalCode,Country,Phone,Fax
FROM Customers
WHERE CustomerId=@.CustId
ORDER by CompanyName,CustomerID,Country DESC

Then, create the ENDPOINT script,
USE [Northwind]
GO

CREATE ENDPOINT customer_endpoint
STATE=STARTED
AS HTTP (
PATH='/sql',
AUTHENTICATION= (INTEGRATED),
PORTS = (CLEAR),
SITE = '*'
)
FOR SOAP (
WEBMETHOD 'http://tempUri.org','GetCustomerInfo'
(
NAME='Northwind.dbo.upGetCustomer', FORMAT=ROWSETS_ONLY,
schema=STANDARD
),
WSDL=DEFAULT,
BATCHES=ENABLED,
DATABASE='Northwind'
)
GO

I followed to .Net show - Sql Server 2005 and an article from DevX website, http://www.devx.com/dbzone/Article/28525/1954?pf=true.

Everything seems to be ok, i think but when I tried to check syntax/runs the script I gets error message,

.Net SqlClient Data Provider: Msg 102, Level 15, State 1, Line 11

Incorrect syntax near ','.

This error situated at close bracket before FOR SOAP statement.

Thanks in advance
Punpromk Tongue Tied

WEBMETHOD 'http://tempUri.org','GetCustomerInfo'

should be:

WEBMETHOD 'http://tempUri.org'.'GetCustomerInfo'|||Thanks,
Its complied and installed but I have another problem.
The problem is the Win XP SP2 IIS 5.1 which is not "http.sys.based" as it conflict with SQL Server 2005. This problem, an article I found on the yukonxml.com, http://yukonxml.com/weblog/darshan/archive/2005/02/21.aspx.

The article stated that I can runs IIS or HTTP SOAP Web Services on the same port, and can use different ports to run both simultaneously.
Well, does not say how?, anyone can help me.

Please note, don't try to stop IIS and installed the ENDPOINT on the Win XP, almost screw my system up. (unlike me.. If you know what to do that Ok..)

Thanks in advance.
Punprom Kasemsant Big Smile
|||try using this:

CREATE ENDPOINT customer_endpoint
STATE=STARTED
AS HTTP (
PATH='/sql',
AUTHENTICATION= (INTEGRATED),
PORTS = (CLEAR),
CLEAR_PORT = 8080,
SITE = '*'
)

No comments:

Post a Comment